|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.presents.dobj.DynamicListener<T>
public class DynamicListener<T extends DSet.Entry>
Maps distributed object events to methods using reflection.
| Field Summary | |
|---|---|
protected MethodFinder |
_finder
Used to look up methods. |
protected HashMap<String,Method> |
_mcache
A cache of already resolved methods. |
protected Object |
_target
The object on which we will dynamically dispatch events. |
| Constructor Summary | |
|---|---|
DynamicListener(Object target)
Creates a listener that dynamically dispatches events on the supplied target. |
|
DynamicListener(Object target,
MethodFinder finder)
Creates a listener that dynamically dispatches events on the supplied target using the methods in finder. |
|
| Method Summary | |
|---|---|
void |
attributeChanged(AttributeChangedEvent event)
Called when an attribute changed event has been dispatched on an object. |
void |
dispatchMethod(String name,
Object[] arguments)
Dynamically looks up the method in question on our target and dispatches an event if it does. |
void |
elementUpdated(ElementUpdatedEvent event)
Called when an element updated event has been dispatched on an object. |
void |
entryAdded(EntryAddedEvent<T> event)
Called when an entry added event has been dispatched on an object. |
void |
entryRemoved(EntryRemovedEvent<T> event)
Called when an entry removed event has been dispatched on an object. |
void |
entryUpdated(EntryUpdatedEvent<T> event)
Called when an entry updated event has been dispatched on an object. |
protected Method |
resolveMethod(String name,
Object[] arguments)
Looks for a method that matches the supplied signature. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Object _target
protected MethodFinder _finder
protected HashMap<String,Method> _mcache
| Constructor Detail |
|---|
public DynamicListener(Object target)
public DynamicListener(Object target,
MethodFinder finder)
| Method Detail |
|---|
public void attributeChanged(AttributeChangedEvent event)
AttributeChangeListener
attributeChanged in interface AttributeChangeListenerevent - The event that was dispatched on the object.public void elementUpdated(ElementUpdatedEvent event)
ElementUpdateListener
elementUpdated in interface ElementUpdateListenerevent - The event that was dispatched on the object.public void entryAdded(EntryAddedEvent<T> event)
SetListener
entryAdded in interface SetListener<T extends DSet.Entry>event - The event that was dispatched on the object.public void entryUpdated(EntryUpdatedEvent<T> event)
SetListener
entryUpdated in interface SetListener<T extends DSet.Entry>event - The event that was dispatched on the object.public void entryRemoved(EntryRemovedEvent<T> event)
SetListener
entryRemoved in interface SetListener<T extends DSet.Entry>event - The event that was dispatched on the object.
public void dispatchMethod(String name,
Object[] arguments)
protected Method resolveMethod(String name,
Object[] arguments)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||