|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EventAdapterService
Interface for a service to resolve event names to event type.
Method Summary | |
---|---|
EventBean |
adapterForBean(java.lang.Object event)
Wrap the native event returning an EventBean . |
EventBean |
adapterForMap(java.util.Map<java.lang.String,java.lang.Object> event,
java.lang.String eventTypeAlias)
Wrap the Map-type event returning an EventBean using the event type alias name
to identify the EventType that the event should carry. |
EventType |
addBeanType(java.lang.String eventTypeAlias,
java.lang.Class clazz)
Add an event type with the given alias and Java class. |
EventType |
addBeanType(java.lang.String eventTypeAlias,
java.lang.String fullyQualClassName)
Add an event type with the given alias and Java fully-qualified class name. |
EventType |
addMapType(java.lang.String eventTypeAlias,
java.util.Map<java.lang.String,java.lang.Class> propertyTypes)
Add an event type with the given alias and a given set of properties. |
EventType |
createAddToEventType(EventType originalType,
java.lang.String[] fieldNames,
java.lang.Class[] fieldTypes)
Create an event type based on the original type passed in adding one or more properties. |
EventType |
createAnonymousMapType(java.util.Map<java.lang.String,java.lang.Class> propertyTypes)
Creates a new anonymous EventType instance for an event type that contains a map of name value pairs. |
EventBean |
createMapFromUnderlying(java.util.Map<java.lang.String,EventBean> events,
EventType eventType)
Create an aggregate event wrapper bean from a set of named events stored in a Map. |
EventBean |
createMapFromValues(java.util.Map<java.lang.String,java.lang.Object> properties,
EventType eventType)
Create an event wrapper bean from a set of event properties (name and value objectes) stored in a Map. |
EventType |
getEventType(java.lang.String eventTypeAlias)
Return the event type for a given event name, or null if none is registered for that name. |
Method Detail |
---|
EventType getEventType(java.lang.String eventTypeAlias)
eventTypeAlias
- is the event type alias name to return type for
EventType addMapType(java.lang.String eventTypeAlias, java.util.Map<java.lang.String,java.lang.Class> propertyTypes) throws EventAdapterException
If the alias already exists with the same event property information, returns the existing EventType instance.
If the alias already exists with different event property information, throws an exception.
If the alias does not already exists, adds the alias and constructs a new MapEventType
.
eventTypeAlias
- is the alias name for the event typepropertyTypes
- is the names and types of event properties
EventAdapterException
- if alias already exists and doesn't match property type infoEventType createAnonymousMapType(java.util.Map<java.lang.String,java.lang.Class> propertyTypes)
New instances are created 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.
propertyTypes
- is a map of String to Class objects
EventBean createMapFromValues(java.util.Map<java.lang.String,java.lang.Object> properties, EventType eventType)
properties
- is key-value pairs for the event propertieseventType
- is the type metadata for any maps of that type
EventBean createMapFromUnderlying(java.util.Map<java.lang.String,EventBean> events, EventType eventType)
events
- is key-value pairs where the key is the event name and the value is the eventeventType
- is the type metadata for any maps of that type
EventType addBeanType(java.lang.String eventTypeAlias, java.lang.String fullyQualClassName) throws EventAdapterException
If the alias already exists with the same class name, returns the existing EventType instance.
If the alias already exists with different class name, throws an exception.
If the alias does not already exists, adds the alias and constructs a new BeanEventType
.
eventTypeAlias
- is the alias name for the event typefullyQualClassName
- is the fully qualified class name
EventAdapterException
- if alias already exists and doesn't match class namesEventType addBeanType(java.lang.String eventTypeAlias, java.lang.Class clazz) throws EventAdapterException
If the alias already exists with the same Class, returns the existing EventType instance.
If the alias already exists with different Class name, throws an exception.
If the alias does not already exists, adds the alias and constructs a new BeanEventType
.
eventTypeAlias
- is the alias name for the event typeclazz
- is the fully Java class
EventAdapterException
- if alias already exists and doesn't match class namesEventBean adapterForBean(java.lang.Object event)
EventBean
.
event
- to be wrapped
EventBean adapterForMap(java.util.Map<java.lang.String,java.lang.Object> event, java.lang.String eventTypeAlias) throws EventAdapterException
EventBean
using the event type alias name
to identify the EventType that the event should carry.
event
- to be wrappedeventTypeAlias
- alias for the event type of the event
EventAdapterException
- if the alias has not been declared, or the event cannot be wrapped using that
alias's event typeEventType createAddToEventType(EventType originalType, java.lang.String[] fieldNames, java.lang.Class[] fieldTypes)
originalType
- - event type to add property tofieldNames
- - names of propertiesfieldTypes
- - types of properties
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |