com.espertech.esper.event
Class EventAdapterServiceImpl

java.lang.Object
  extended by com.espertech.esper.event.EventAdapterServiceImpl
All Implemented Interfaces:
EventAdapterService

public class EventAdapterServiceImpl
extends java.lang.Object
implements EventAdapterService

Implementation for resolving event name to event type.

The implementation assigned a unique identifier to each event type. For Class-based event types, only one EventType instance and one event type id exists for the same class.

Event type names must be unique, that is an name must resolve to a single event type.

Each event type can have multiple names defined for it. For example, expressions such as "select * from A" and "select * from B" in which A and B are names for the same class X the select clauses each fireStatementStopped for events of type X. In summary, names A and B point to the same underlying event type and therefore event type id.


Field Summary
 
Fields inherited from interface com.espertech.esper.event.EventAdapterService
ANONYMOUS_TYPE_NAME_PREFIX
 
Constructor Summary
EventAdapterServiceImpl(EventTypeIdGenerator eventTypeIdGenerator, int anonymousTypeCacheSize)
          Ctor.
 
Method Summary
 EventBean adapterForBean(java.lang.Object theEvent)
          Create an event bean given an event of object id.
 EventBean adapterForDOM(org.w3c.dom.Node node)
          Returns an adapter for the XML DOM document that exposes it's data as event properties for use in statements.
 EventBean adapterForMap(java.util.Map<java.lang.String,java.lang.Object> theEvent, java.lang.String eventTypeName)
          Wrap the Map-type event returning an EventBean using the event type name to identify the EventType that the event should carry.
 EventBean adapterForObjectArray(java.lang.Object[] theEvent, java.lang.String eventTypeName)
           
 EventBean adapterForType(java.lang.Object theEvent, EventType eventType)
          Returns an adapter for an event underlying object when the event type is known.
 EventBean adapterForTypedBean(java.lang.Object bean, EventType eventType)
          Creates a thin adaper for an event object given an event type.
 EventBean adapterForTypedDOM(org.w3c.dom.Node node, EventType eventType)
          Returns an adapter for the XML DOM document that exposes it's data as event properties for use in statements.
 EventBean adapterForTypedMap(java.util.Map<java.lang.String,java.lang.Object> properties, EventType eventType)
          Create an event map bean from a set of event properties (name and value objectes) stored in a Map.
 EventBean adapterForTypedObjectArray(java.lang.Object[] properties, EventType eventType)
           
 EventBean adapterForTypedWrapper(EventBean theEvent, java.util.Map<java.lang.String,java.lang.Object> properties, EventType eventType)
          Creata a wrapper around an event and some additional properties
 void addAutoNamePackage(java.lang.String javaPackageName)
          Adds a Java package name of a package that Java event classes reside in.
 EventType addBeanType(java.lang.String eventTypeName, java.lang.Class clazz, boolean isPreconfiguredStatic, boolean isPreconfigured, boolean isConfigured)
          Add an event type with the given name and Java class.
 EventType addBeanType(java.lang.String eventTypeName, java.lang.String fullyQualClassName, boolean considerAutoName, boolean isPreconfiguredStatic, boolean isPreconfigured, boolean isConfigured)
          Add an event type for the given Java class name.
 EventType addBeanTypeByName(java.lang.String eventTypeName, java.lang.Class clazz, boolean isNamedWindow)
           
 void addEventRepresentation(java.net.URI eventRepURI, PlugInEventRepresentation pluginEventRep)
          Add a plug-in event representation.
 EventType addNestableMapType(java.lang.String eventTypeName, java.util.Map<java.lang.String,java.lang.Object> propertyTypes, ConfigurationEventTypeMap optionalConfig, boolean isPreconfiguredStatic, boolean isPreconfigured, boolean isConfigured, boolean namedWindow, boolean insertInto)
          Add an event type with the given name and a given set of properties, wherein properties may itself be Maps, nested and strongly-typed.
 EventType addNestableObjectArrayType(java.lang.String eventTypeName, java.util.Map<java.lang.String,java.lang.Object> propertyTypes, ConfigurationEventTypeObjectArray optionalConfig, boolean isPreconfiguredStatic, boolean isPreconfigured, boolean isConfigured, boolean namedWindow, boolean insertInto, boolean table, java.lang.String tableName)
           
 EventType addPlugInEventType(java.lang.String eventTypeName, java.net.URI[] resolutionURIs, java.io.Serializable initializer)
          Adds a plug-in event type.
 void addTypeByName(java.lang.String name, EventType eventType)
          Adds an event type to the registery available for use, and originating outside as a non-adapter.
 EventType addWrapperType(java.lang.String eventTypeName, EventType underlyingEventType, java.util.Map<java.lang.String,java.lang.Object> propertyTypes, boolean isNamedWindow, boolean isInsertInto)
          Add an event type with the given name and the given underlying event type, as well as the additional given properties.
 EventType addXMLDOMType(java.lang.String eventTypeName, ConfigurationEventTypeXMLDOM configurationEventTypeXMLDOM, SchemaModel optionalSchemaModel, boolean isPreconfiguredStatic)
          Add a configured XML DOM event type.
 EventType createAnonymousBeanType(java.lang.String eventTypeName, java.lang.Class clazz)
           
 EventType createAnonymousMapType(java.lang.String typeName, java.util.Map<java.lang.String,java.lang.Object> propertyTypes)
          Creates a new anonymous EventType instance for an event type that contains a map of name value pairs.
 EventType createAnonymousObjectArrayType(java.lang.String typeName, java.util.Map<java.lang.String,java.lang.Object> propertyTypes)
           
 EventType createAnonymousWrapperType(java.lang.String typeName, EventType underlyingEventType, java.util.Map<java.lang.String,java.lang.Object> propertyTypes)
          Create a new anonymous event type with the given underlying event type, as well as the additional given properties.
 EventType createSemiAnonymousMapType(java.lang.String typeName, java.util.Map<java.lang.String,Pair<EventType,java.lang.String>> taggedEventTypes, java.util.Map<java.lang.String,Pair<EventType,java.lang.String>> arrayEventTypes, boolean isUsedByChildViews)
          Creates an anonymous map that has no name, however in a fail-over scenario events of this type may be recoverable and therefore the type is only semi-anonymous, identified by the tags and event type names used.
 EventBeanAdapterFactory getAdapterFactoryForType(EventType eventType)
           
 EventType[] getAllTypes()
          Return all known event types.
 BeanEventTypeFactory getBeanEventTypeFactory()
          Returns a subset of the functionality of the service specific to creating POJO bean event types.
 ConfigurationEventTypeLegacy getClassLegacyConfigs(java.lang.String className)
          Returns the configured legacy Java class information or null if none defined.
 java.util.Map<java.lang.String,EventType> getDeclaredEventTypes()
           
 EventSender getDynamicTypeEventSender(EPRuntimeEventSender epRuntime, java.net.URI[] uri, ThreadingService threadingService)
          Returns an event sender that dynamically decides what the event type for a given object is.
 EventType getExistsTypeByName(java.lang.String eventTypeName)
          Return the event type for a given event name, or null if none is registered for that name.
 EventBeanManufacturer getManufacturer(EventType eventType, WriteablePropertyDescriptor[] properties, EngineImportService engineImportService, boolean allowAnyType)
          Returns a factory for creating and populating event object instances for the given type.
 EventBeanSPI getShellForType(EventType eventType)
           
 EventSender getStaticTypeEventSender(EPRuntimeEventSender runtimeEventSender, java.lang.String eventTypeName, ThreadingService threadingService)
          Returns an event sender for a specific type, only generating events of that type.
 java.util.Set<WriteablePropertyDescriptor> getWriteableProperties(EventType eventType, boolean allowAnyType)
          Returns descriptors for all writable properties.
static java.lang.String isCompatibleWrapper(EventType existingType, EventType underlyingType, java.util.Map<java.lang.String,java.lang.Object> propertyTypes)
          Returns true if the wrapper type is compatible with an existing wrapper type, for the reason that the underlying event is a subtype of the existing underlying wrapper's type.
 boolean removeType(java.lang.String name)
          Removes an event type by a given name indicating by the return value whether the type was found or not.
 EventType replaceXMLEventType(java.lang.String xmlEventTypeName, ConfigurationEventTypeXMLDOM config, SchemaModel schemaModel)
           
 void setClassLegacyConfigs(java.util.Map<java.lang.String,ConfigurationEventTypeLegacy> classToLegacyConfigs)
          Set the legacy Java class type information.
 void setDefaultAccessorStyle(ConfigurationEventTypeLegacy.AccessorStyle defaultAccessorStyle)
           
 void setDefaultPropertyResolutionStyle(Configuration.PropertyResolutionStyle defaultPropertyResolutionStyle)
          Sets the default property resolution style.
 EventBean[] typeCast(java.util.List<EventBean> events, EventType targetType)
          Casts event type of a list of events to either Wrapper or Map type.
 void updateMapEventType(java.lang.String mapeventTypeName, java.util.Map<java.lang.String,java.lang.Object> typeMap)
          Update a given Map event type.
 void updateObjectArrayEventType(java.lang.String objectArrayEventTypeName, java.util.Map<java.lang.String,java.lang.Object> typeMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventAdapterServiceImpl

public EventAdapterServiceImpl(EventTypeIdGenerator eventTypeIdGenerator,
                               int anonymousTypeCacheSize)
Ctor.

Method Detail

getDeclaredEventTypes

public java.util.Map<java.lang.String,EventType> getDeclaredEventTypes()
Specified by:
getDeclaredEventTypes in interface EventAdapterService

setClassLegacyConfigs

public void setClassLegacyConfigs(java.util.Map<java.lang.String,ConfigurationEventTypeLegacy> classToLegacyConfigs)
Set the legacy Java class type information.

Specified by:
setClassLegacyConfigs in interface EventAdapterService
Parameters:
classToLegacyConfigs - is the legacy class configs

getClassLegacyConfigs

public ConfigurationEventTypeLegacy getClassLegacyConfigs(java.lang.String className)
Description copied from interface: EventAdapterService
Returns the configured legacy Java class information or null if none defined.

Specified by:
getClassLegacyConfigs in interface EventAdapterService
Parameters:
className - is the fully-qualified class name

getWriteableProperties

public java.util.Set<WriteablePropertyDescriptor> getWriteableProperties(EventType eventType,
                                                                         boolean allowAnyType)
Description copied from interface: EventAdapterService
Returns descriptors for all writable properties.

Specified by:
getWriteableProperties in interface EventAdapterService
Parameters:
eventType - to reflect on
Returns:
list of writable properties

getManufacturer

public EventBeanManufacturer getManufacturer(EventType eventType,
                                             WriteablePropertyDescriptor[] properties,
                                             EngineImportService engineImportService,
                                             boolean allowAnyType)
                                      throws EventBeanManufactureException
Description copied from interface: EventAdapterService
Returns a factory for creating and populating event object instances for the given type.

Specified by:
getManufacturer in interface EventAdapterService
Parameters:
eventType - to create underlying objects for
properties - to write
Returns:
factory
Throws:
EventBeanManufactureException - if a factory cannot be created for the type

getAllTypes

public EventType[] getAllTypes()
Description copied from interface: EventAdapterService
Return all known event types.

Specified by:
getAllTypes in interface EventAdapterService
Returns:
event types

addTypeByName

public void addTypeByName(java.lang.String name,
                          EventType eventType)
                   throws EventAdapterException
Description copied from interface: EventAdapterService
Adds an event type to the registery available for use, and originating outside as a non-adapter.

Specified by:
addTypeByName in interface EventAdapterService
Parameters:
name - to add an event type under
eventType - the type to add
Throws:
EventAdapterException - if the name is already in used by another type

addEventRepresentation

public void addEventRepresentation(java.net.URI eventRepURI,
                                   PlugInEventRepresentation pluginEventRep)
                            throws EventAdapterException
Description copied from interface: EventAdapterService
Add a plug-in event representation.

Specified by:
addEventRepresentation in interface EventAdapterService
Parameters:
eventRepURI - URI is the unique identifier for the event representation
pluginEventRep - is the instance
Throws:
EventAdapterException

addPlugInEventType

public EventType addPlugInEventType(java.lang.String eventTypeName,
                                    java.net.URI[] resolutionURIs,
                                    java.io.Serializable initializer)
                             throws EventAdapterException
Description copied from interface: EventAdapterService
Adds a plug-in event type.

Specified by:
addPlugInEventType in interface EventAdapterService
Parameters:
eventTypeName - is the name of the event type
resolutionURIs - is the URIs of plug-in event representations, or child URIs of such
initializer - is configs for the type
Returns:
type
Throws:
EventAdapterException

getStaticTypeEventSender

public EventSender getStaticTypeEventSender(EPRuntimeEventSender runtimeEventSender,
                                            java.lang.String eventTypeName,
                                            ThreadingService threadingService)
                                     throws EventTypeException
Description copied from interface: EventAdapterService
Returns an event sender for a specific type, only generating events of that type.

Specified by:
getStaticTypeEventSender in interface EventAdapterService
Parameters:
runtimeEventSender - the runtime handle for sending the wrapped type
eventTypeName - is the name of the event type to return the sender for
threadingService - threading service
Returns:
event sender that is static, single-type
Throws:
EventTypeException

updateMapEventType

public void updateMapEventType(java.lang.String mapeventTypeName,
                               java.util.Map<java.lang.String,java.lang.Object> typeMap)
                        throws EventAdapterException
Description copied from interface: EventAdapterService
Update a given Map event type.

Specified by:
updateMapEventType in interface EventAdapterService
Parameters:
mapeventTypeName - name to update
typeMap - additional properties to add, nesting allowed
Throws:
EventAdapterException - when the type is not found or is not a Map

updateObjectArrayEventType

public void updateObjectArrayEventType(java.lang.String objectArrayEventTypeName,
                                       java.util.Map<java.lang.String,java.lang.Object> typeMap)
                                throws EventAdapterException
Specified by:
updateObjectArrayEventType in interface EventAdapterService
Throws:
EventAdapterException

getDynamicTypeEventSender

public EventSender getDynamicTypeEventSender(EPRuntimeEventSender epRuntime,
                                             java.net.URI[] uri,
                                             ThreadingService threadingService)
                                      throws EventTypeException
Description copied from interface: EventAdapterService
Returns an event sender that dynamically decides what the event type for a given object is.

Specified by:
getDynamicTypeEventSender in interface EventAdapterService
Parameters:
epRuntime - the runtime handle for sending the wrapped type
uri - is for plug-in event representations to provide implementations, if accepted, to make a wrapped event
threadingService - threading service
Returns:
event sender that is dynamic, multi-type based on multiple event bean factories provided by plug-in event representations
Throws:
EventTypeException

getBeanEventTypeFactory

public BeanEventTypeFactory getBeanEventTypeFactory()
Description copied from interface: EventAdapterService
Returns a subset of the functionality of the service specific to creating POJO bean event types.

Specified by:
getBeanEventTypeFactory in interface EventAdapterService
Returns:
bean event type factory

setDefaultPropertyResolutionStyle

public void setDefaultPropertyResolutionStyle(Configuration.PropertyResolutionStyle defaultPropertyResolutionStyle)
Sets the default property resolution style.

Specified by:
setDefaultPropertyResolutionStyle in interface EventAdapterService
Parameters:
defaultPropertyResolutionStyle - is the default style

setDefaultAccessorStyle

public void setDefaultAccessorStyle(ConfigurationEventTypeLegacy.AccessorStyle defaultAccessorStyle)
Specified by:
setDefaultAccessorStyle in interface EventAdapterService

getExistsTypeByName

public EventType getExistsTypeByName(java.lang.String eventTypeName)
Description copied from interface: EventAdapterService
Return the event type for a given event name, or null if none is registered for that name.

Specified by:
getExistsTypeByName in interface EventAdapterService
Parameters:
eventTypeName - is the event type name to return type for
Returns:
event type for named event, or null if unknown/unnamed type

addBeanType

public EventType addBeanType(java.lang.String eventTypeName,
                             java.lang.Class clazz,
                             boolean isPreconfiguredStatic,
                             boolean isPreconfigured,
                             boolean isConfigured)
                      throws EventAdapterException
Description copied from interface: EventAdapterService
Add an event type with the given name and Java class.

If the name already exists with the same Class, returns the existing EventType instance.

If the name already exists with different Class name, throws an exception.

If the name does not already exists, adds the name and constructs a new BeanEventType.

Specified by:
addBeanType in interface EventAdapterService
Parameters:
eventTypeName - is the name for the event type
clazz - is the fully Java class
isConfigured - if the class is application-configured
Returns:
event type is the type added
Throws:
EventAdapterException - if name already exists and doesn't match class names

addBeanTypeByName

public EventType addBeanTypeByName(java.lang.String eventTypeName,
                                   java.lang.Class clazz,
                                   boolean isNamedWindow)
                            throws EventAdapterException
Specified by:
addBeanTypeByName in interface EventAdapterService
Throws:
EventAdapterException

adapterForBean

public EventBean adapterForBean(java.lang.Object theEvent)
Create an event bean given an event of object id.

Specified by:
adapterForBean in interface EventAdapterService
Parameters:
theEvent - is the event class
Returns:
event

addBeanType

public EventType addBeanType(java.lang.String eventTypeName,
                             java.lang.String fullyQualClassName,
                             boolean considerAutoName,
                             boolean isPreconfiguredStatic,
                             boolean isPreconfigured,
                             boolean isConfigured)
                      throws EventAdapterException
Add an event type for the given Java class name.

Specified by:
addBeanType in interface EventAdapterService
Parameters:
eventTypeName - is the name
fullyQualClassName - is the Java class name
considerAutoName - whether auto-name by Java packages should be considered
Returns:
event type
Throws:
EventAdapterException - if the Class name cannot resolve or other error occured

addNestableMapType

public EventType addNestableMapType(java.lang.String eventTypeName,
                                    java.util.Map<java.lang.String,java.lang.Object> propertyTypes,
                                    ConfigurationEventTypeMap optionalConfig,
                                    boolean isPreconfiguredStatic,
                                    boolean isPreconfigured,
                                    boolean isConfigured,
                                    boolean namedWindow,
                                    boolean insertInto)
                             throws EventAdapterException
Description copied from interface: EventAdapterService
Add an event type with the given name and a given set of properties, wherein properties may itself be Maps, nested and strongly-typed.

If the name already exists with the same event property information, returns the existing EventType instance.

If the name already exists with different event property information, throws an exception.

If the name does not already exists, adds the name and constructs a new MapEventType.

Specified by:
addNestableMapType in interface EventAdapterService
Parameters:
eventTypeName - is the name for the event type
propertyTypes - is the names and types of event properties
optionalConfig - an optional set of Map event type names that are supertypes to the type
isConfigured - if the type is application-configured
namedWindow - if the type is from a named window
insertInto - if inserting into a stream
Returns:
event type is the type added
Throws:
EventAdapterException - if name already exists and doesn't match property type info

addNestableObjectArrayType

public EventType addNestableObjectArrayType(java.lang.String eventTypeName,
                                            java.util.Map<java.lang.String,java.lang.Object> propertyTypes,
                                            ConfigurationEventTypeObjectArray optionalConfig,
                                            boolean isPreconfiguredStatic,
                                            boolean isPreconfigured,
                                            boolean isConfigured,
                                            boolean namedWindow,
                                            boolean insertInto,
                                            boolean table,
                                            java.lang.String tableName)
                                     throws EventAdapterException
Specified by:
addNestableObjectArrayType in interface EventAdapterService
Throws:
EventAdapterException

adapterForMap

public EventBean adapterForMap(java.util.Map<java.lang.String,java.lang.Object> theEvent,
                               java.lang.String eventTypeName)
                        throws EPException
Description copied from interface: EventAdapterService
Wrap the Map-type event returning an EventBean using the event type name to identify the EventType that the event should carry.

Specified by:
adapterForMap in interface EventAdapterService
Parameters:
theEvent - to be wrapped
eventTypeName - name for the event type of the event
Returns:
event bean wrapping native underlying event
Throws:
EventAdapterException - if the name has not been declared, or the event cannot be wrapped using that name's event type
EPException

adapterForObjectArray

public EventBean adapterForObjectArray(java.lang.Object[] theEvent,
                                       java.lang.String eventTypeName)
                                throws EPException
Specified by:
adapterForObjectArray in interface EventAdapterService
Throws:
EPException

adapterForDOM

public EventBean adapterForDOM(org.w3c.dom.Node node)
Description copied from interface: EventAdapterService
Returns an adapter for the XML DOM document that exposes it's data as event properties for use in statements.

Specified by:
adapterForDOM in interface EventAdapterService
Parameters:
node - is the node to wrap
Returns:
event wrapper for document

adapterForTypedDOM

public EventBean adapterForTypedDOM(org.w3c.dom.Node node,
                                    EventType eventType)
Description copied from interface: EventAdapterService
Returns an adapter for the XML DOM document that exposes it's data as event properties for use in statements.

Specified by:
adapterForTypedDOM in interface EventAdapterService
Parameters:
node - is the node to wrap
eventType - the event type associated with the node
Returns:
event wrapper for document

addXMLDOMType

public EventType addXMLDOMType(java.lang.String eventTypeName,
                               ConfigurationEventTypeXMLDOM configurationEventTypeXMLDOM,
                               SchemaModel optionalSchemaModel,
                               boolean isPreconfiguredStatic)
Add a configured XML DOM event type.

Specified by:
addXMLDOMType in interface EventAdapterService
Parameters:
eventTypeName - is the name name of the event type
configurationEventTypeXMLDOM - configures the event type schema and namespace and XPath property information.
optionalSchemaModel - is the object model of the schema, or null in none provided
Returns:
event type

replaceXMLEventType

public EventType replaceXMLEventType(java.lang.String xmlEventTypeName,
                                     ConfigurationEventTypeXMLDOM config,
                                     SchemaModel schemaModel)
Specified by:
replaceXMLEventType in interface EventAdapterService

adapterForType

public final EventBean adapterForType(java.lang.Object theEvent,
                                      EventType eventType)
Description copied from interface: EventAdapterService
Returns an adapter for an event underlying object when the event type is known.

Specified by:
adapterForType in interface EventAdapterService
Parameters:
theEvent - underlying
eventType - type
Returns:
event wrapper for object

adapterForTypedMap

public final EventBean adapterForTypedMap(java.util.Map<java.lang.String,java.lang.Object> properties,
                                          EventType eventType)
Description copied from interface: EventAdapterService
Create an event map bean from a set of event properties (name and value objectes) stored in a Map.

Specified by:
adapterForTypedMap in interface EventAdapterService
Parameters:
properties - is key-value pairs for the event properties
eventType - is the type metadata for any maps of that type
Returns:
EventBean instance

adapterForTypedObjectArray

public final EventBean adapterForTypedObjectArray(java.lang.Object[] properties,
                                                  EventType eventType)
Specified by:
adapterForTypedObjectArray in interface EventAdapterService

addWrapperType

public EventType addWrapperType(java.lang.String eventTypeName,
                                EventType underlyingEventType,
                                java.util.Map<java.lang.String,java.lang.Object> propertyTypes,
                                boolean isNamedWindow,
                                boolean isInsertInto)
                         throws EventAdapterException
Description copied from interface: EventAdapterService
Add an event type with the given name and the given underlying event type, as well as the additional given properties.

Specified by:
addWrapperType in interface EventAdapterService
Parameters:
eventTypeName - is the name for the event type
underlyingEventType - is the event type for the event type that this wrapper wraps
propertyTypes - is the names and types of any additional properties
isNamedWindow - if the type is from a named window
isInsertInto - if inserting into a stream
Returns:
eventType is the type added
Throws:
EventAdapterException - if name already exists and doesn't match this type's info

isCompatibleWrapper

public static java.lang.String isCompatibleWrapper(EventType existingType,
                                                   EventType underlyingType,
                                                   java.util.Map<java.lang.String,java.lang.Object> propertyTypes)
Returns true if the wrapper type is compatible with an existing wrapper type, for the reason that the underlying event is a subtype of the existing underlying wrapper's type.

Parameters:
existingType - is the existing wrapper type
underlyingType - is the proposed new wrapper type's underlying type
propertyTypes - is the additional properties
Returns:
true for compatible, or false if not

createAnonymousMapType

public final EventType createAnonymousMapType(java.lang.String typeName,
                                              java.util.Map<java.lang.String,java.lang.Object> propertyTypes)
                                       throws EventAdapterException
Description copied from interface: EventAdapterService
Creates a new anonymous EventType instance for an event type that contains a map of name value pairs. The method accepts a Map that contains the property names as keys and Class objects as the values. The Class instances represent the property types.

New instances are createdStatement by this method on every invocation. Clients to this method need to cache the returned EventType instance to reuse EventType's for same-typed events.

Specified by:
createAnonymousMapType in interface EventAdapterService
propertyTypes - is a map of String to Class objects
Returns:
EventType implementation for map field names and value types
Throws:
EventAdapterException

createAnonymousObjectArrayType

public final EventType createAnonymousObjectArrayType(java.lang.String typeName,
                                                      java.util.Map<java.lang.String,java.lang.Object> propertyTypes)
                                               throws EventAdapterException
Specified by:
createAnonymousObjectArrayType in interface EventAdapterService
Throws:
EventAdapterException

createSemiAnonymousMapType

public EventType createSemiAnonymousMapType(java.lang.String typeName,
                                            java.util.Map<java.lang.String,Pair<EventType,java.lang.String>> taggedEventTypes,
                                            java.util.Map<java.lang.String,Pair<EventType,java.lang.String>> arrayEventTypes,
                                            boolean isUsedByChildViews)
Description copied from interface: EventAdapterService
Creates an anonymous map that has no name, however in a fail-over scenario events of this type may be recoverable and therefore the type is only semi-anonymous, identified by the tags and event type names used.

Specified by:
createSemiAnonymousMapType in interface EventAdapterService
taggedEventTypes - simple type per property name
arrayEventTypes - array type per property name
isUsedByChildViews - if the type is going to be in used by child views
Returns:
event type

createAnonymousWrapperType

public final EventType createAnonymousWrapperType(java.lang.String typeName,
                                                  EventType underlyingEventType,
                                                  java.util.Map<java.lang.String,java.lang.Object> propertyTypes)
                                           throws EventAdapterException
Description copied from interface: EventAdapterService
Create a new anonymous event type with the given underlying event type, as well as the additional given properties.

Specified by:
createAnonymousWrapperType in interface EventAdapterService
underlyingEventType - is the event type for the event type that this wrapper wraps
propertyTypes - is the names and types of any additional properties
Returns:
eventType is the type createdStatement
Throws:
EventAdapterException - if name already exists and doesn't match this type's info

adapterForTypedWrapper

public final EventBean adapterForTypedWrapper(EventBean theEvent,
                                              java.util.Map<java.lang.String,java.lang.Object> properties,
                                              EventType eventType)
Description copied from interface: EventAdapterService
Creata a wrapper around an event and some additional properties

Specified by:
adapterForTypedWrapper in interface EventAdapterService
Parameters:
theEvent - is the wrapped event
properties - are the additional properties
eventType - os the type metadata for any wrappers of this type
Returns:
wrapper event bean

adapterForTypedBean

public final EventBean adapterForTypedBean(java.lang.Object bean,
                                           EventType eventType)
Description copied from interface: EventAdapterService
Creates a thin adaper for an event object given an event type.

Specified by:
adapterForTypedBean in interface EventAdapterService
Parameters:
bean - event object
eventType - event type
Returns:
event

addAutoNamePackage

public void addAutoNamePackage(java.lang.String javaPackageName)
Description copied from interface: EventAdapterService
Adds a Java package name of a package that Java event classes reside in.

Specified by:
addAutoNamePackage in interface EventAdapterService
Parameters:
javaPackageName - is the fully-qualified Java package name of the Java package that event classes reside in

createAnonymousBeanType

public EventType createAnonymousBeanType(java.lang.String eventTypeName,
                                         java.lang.Class clazz)
Specified by:
createAnonymousBeanType in interface EventAdapterService

typeCast

public EventBean[] typeCast(java.util.List<EventBean> events,
                            EventType targetType)
Description copied from interface: EventAdapterService
Casts event type of a list of events to either Wrapper or Map type.

Specified by:
typeCast in interface EventAdapterService
Parameters:
events - to cast
targetType - target type
Returns:
type casted event array

removeType

public boolean removeType(java.lang.String name)
Description copied from interface: EventAdapterService
Removes an event type by a given name indicating by the return value whether the type was found or not.

Does not uncache an existing class loaded by a JVM. Does remove XML root element names. Does not handle value-add event types.

Specified by:
removeType in interface EventAdapterService
Parameters:
name - to remove
Returns:
true if found and removed, false if not found

getShellForType

public EventBeanSPI getShellForType(EventType eventType)
Specified by:
getShellForType in interface EventAdapterService

getAdapterFactoryForType

public EventBeanAdapterFactory getAdapterFactoryForType(EventType eventType)
Specified by:
getAdapterFactoryForType in interface EventAdapterService

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com