Package jadex.rules.state.javaimpl
Class OAVEventHandler
- java.lang.Object
- 
- jadex.rules.state.javaimpl.OAVEventHandler
 
- 
 public class OAVEventHandler extends java.lang.ObjectThis class handles the collection and distribution OAV events to registered listeners.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.util.Setadded_objectsThe objects that have been added in current change set.protected java.util.SetbeaneventsThe collected bean events (may be added from external thread).protected java.util.ListdirectlistenersThe direct state listeners.protected java.util.ListlistenersThe bunch state listeners.protected booleannotifyingFlag that is only true, while listeners are being notified.protected java.util.SetoaveventsThe collected change events.protected java.util.Setremoved_objectsThe objects that have been removed in current change set.protected IOAVStatestateThe state.
 - 
Constructor SummaryConstructors Constructor Description OAVEventHandler(IOAVState state)Create a new OAV event handler.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStateListener(IOAVStateListener listener, boolean bunch)Add a new state listener.voidbeanModified(java.lang.Object bean, OAVObjectType type, OAVAttributeType attr, java.lang.Object oldvalue, java.lang.Object newvalue)Notification when an attribute value of a bean has been set.protected java.util.SetcreateIdSet()Create a set for holding object ids.voidnotifyEventListeners()Throw collected events and notify the listeners.protected voidnotifyOneEvent(java.lang.Object evt)Notify one event to all listeners.voidobjectAdded(java.lang.Object id, OAVObjectType type, boolean root)Notification when an object has been added to the state.voidobjectModified(java.lang.Object id, OAVObjectType type, OAVAttributeType attr, java.lang.Object oldvalue, java.lang.Object newvalue)Notification when an attribute value of an object has been set.voidobjectRemoved(java.lang.Object id, OAVObjectType type)Notification when an object has been removed from state.voidremoveStateListener(IOAVStateListener listener)Remove a state listener.
 
- 
- 
- 
Field Detail- 
stateprotected IOAVState state The state.
 - 
listenersprotected java.util.List listeners The bunch state listeners.
 - 
directlistenersprotected java.util.List directlisteners The direct state listeners.
 - 
oaveventsprotected java.util.Set oavevents The collected change events.
 - 
beaneventsprotected java.util.Set beanevents The collected bean events (may be added from external thread).
 - 
removed_objectsprotected java.util.Set removed_objects The objects that have been removed in current change set.
 - 
added_objectsprotected java.util.Set added_objects The objects that have been added in current change set.
 - 
notifyingprotected boolean notifying Flag that is only true, while listeners are being notified.
 
- 
 - 
Constructor Detail- 
OAVEventHandlerpublic OAVEventHandler(IOAVState state) Create a new OAV event handler.
 
- 
 - 
Method Detail- 
addStateListenerpublic void addStateListener(IOAVStateListener listener, boolean bunch) Add a new state listener.- Parameters:
- listener- The state listener.
 
 - 
removeStateListenerpublic void removeStateListener(IOAVStateListener listener) Remove a state listener.- Parameters:
- listener- The state listener.
 
 - 
notifyEventListenerspublic void notifyEventListeners() Throw collected events and notify the listeners.
 - 
notifyOneEventprotected void notifyOneEvent(java.lang.Object evt) Notify one event to all listeners.- Parameters:
- evt- The event.
 
 - 
objectModifiedpublic void objectModified(java.lang.Object id, OAVObjectType type, OAVAttributeType attr, java.lang.Object oldvalue, java.lang.Object newvalue)Notification when an attribute value of an object has been set.- Parameters:
- id- The object id.
- type- The object type.
- attr- The attribute type.
- oldvalue- The oldvalue.
- newvalue- The newvalue.
 
 - 
beanModifiedpublic void beanModified(java.lang.Object bean, OAVObjectType type, OAVAttributeType attr, java.lang.Object oldvalue, java.lang.Object newvalue)Notification when an attribute value of a bean has been set.- Parameters:
- bean- The bean.
- type- The object type.
- attr- The attribute type.
- oldvalue- The oldvalue.
- newvalue- The newvalue.
 
 - 
objectAddedpublic void objectAdded(java.lang.Object id, OAVObjectType type, boolean root)Notification when an object has been added to the state.- Parameters:
- id- The object id.
- type- The object type.
 
 - 
objectRemovedpublic void objectRemoved(java.lang.Object id, OAVObjectType type)Notification when an object has been removed from state.- Parameters:
- id- The object id.
- type- The object type.
 
 - 
createIdSetprotected java.util.Set createIdSet() Create a set for holding object ids.
 
- 
 
-