|
Oracle® Fusion Middleware Java API Reference for Oracle Event Processing 11g Release 1 (11.1.1.9) E14303-12 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Builder for creating events of a certain event type. Defining a custom builder for an event type is necessary when the POJO representing a event does not expose the necessary setter and getter methods for the event properties. For example, if the POJO is immutable, a builder would be necessary to invoke the constructor with all of the required property values in the createEvent method since the default system builder would not be able to set the properties through reflection. An EventBuilder
must only be used to build a single event. Access to a builder should also be synchronized if multiple threads are using it. Thus, a simple coding idiom for using an event builder is: EventBuilder builder = targetEventType.getEventBuilderFactory().createBuilder(); for (EventProperty property : sourceEventType.getProperties()) { Object value = property.getValue(sourceEvent); builder.put(property.getName(), value); } targetEvent = builder.createEvent();
Inner Class Summary | |
static interface |
EventBuilder.Factory Factory for event builder. |
Field Summary | |
static java.lang.String |
ELEMENT_TIME Should the event have an element time (see CQL documentation), it is put in Builder using this constant as the property name. |
Method Summary | |
java.lang.Object |
createEvent() Instantiate an event of the type associated with this event builder. |
void |
put(java.lang.String property, java.lang.Object value) Set the property of the event being created to the specified value. |
Field Detail |
public static final java.lang.String ELEMENT_TIME
Method Detail |
public void put(java.lang.String property, java.lang.Object value) throws java.lang.IllegalStateException
property
- name of the propertyvalue
- value for the propertypublic java.lang.Object createEvent()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |