public class OAVEventHandler
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set |
added_objects
The objects that have been added in current change set.
|
protected java.util.Set |
beanevents
The collected bean events (may be added from external thread).
|
protected java.util.List |
directlisteners
The direct state listeners.
|
protected java.util.List |
listeners
The bunch state listeners.
|
protected boolean |
notifying
Flag that is only true, while listeners are being notified.
|
protected java.util.Set |
oavevents
The collected change events.
|
protected java.util.Set |
removed_objects
The objects that have been removed in current change set.
|
protected IOAVState |
state
The state.
|
| Constructor and Description |
|---|
OAVEventHandler(IOAVState state)
Create a new OAV event handler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addStateListener(IOAVStateListener listener,
boolean bunch)
Add a new state listener.
|
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.
|
protected java.util.Set |
createIdSet()
Create a set for holding object ids.
|
void |
notifyEventListeners()
Throw collected events and notify the listeners.
|
protected void |
notifyOneEvent(java.lang.Object evt)
Notify one event to all listeners.
|
void |
objectAdded(java.lang.Object id,
OAVObjectType type,
boolean root)
Notification when an object has been added to the state.
|
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.
|
void |
objectRemoved(java.lang.Object id,
OAVObjectType type)
Notification when an object has been removed from state.
|
void |
removeStateListener(IOAVStateListener listener)
Remove a state listener.
|
protected IOAVState state
protected java.util.List listeners
protected java.util.List directlisteners
protected java.util.Set oavevents
protected java.util.Set beanevents
protected java.util.Set removed_objects
protected java.util.Set added_objects
protected boolean notifying
public OAVEventHandler(IOAVState state)
public void addStateListener(IOAVStateListener listener, boolean bunch)
listener - The state listener.public void removeStateListener(IOAVStateListener listener)
listener - The state listener.public void notifyEventListeners()
protected void notifyOneEvent(java.lang.Object evt)
evt - The event.public void objectModified(java.lang.Object id,
OAVObjectType type,
OAVAttributeType attr,
java.lang.Object oldvalue,
java.lang.Object newvalue)
id - The object id.type - The object type.attr - The attribute type.oldvalue - The oldvalue.newvalue - The newvalue.public void beanModified(java.lang.Object bean,
OAVObjectType type,
OAVAttributeType attr,
java.lang.Object oldvalue,
java.lang.Object newvalue)
bean - The bean.type - The object type.attr - The attribute type.oldvalue - The oldvalue.newvalue - The newvalue.public void objectAdded(java.lang.Object id,
OAVObjectType type,
boolean root)
id - The object id.type - The object type.public void objectRemoved(java.lang.Object id,
OAVObjectType type)
id - The object id.type - The object type.protected java.util.Set createIdSet()