org.objectweb.jac.aspects.queue
Class MessageQueue

java.lang.Object
  |
  +--org.objectweb.jac.aspects.queue.MessageQueue

public class MessageQueue
extends Object

Handles an asynchronous message queue.


Constructor Summary
MessageQueue()
           
 
Method Summary
 void fieldChanged(Object substance, FieldItem field, Object previousValue, Object currentValue)
          Send a message to the queue saying that the field of an object has changed, so that it will be sent to all registered clients.
 Map getFieldClients()
          Gets the map of field change client callbacks.
 void notifyFieldChange(FieldChangeEvent event)
          Notify registered clients of a field change.
 void registerFieldChange(FieldItem field, MethodItem callback)
          Register for the changes of a field.
 void unregisterFieldChange(FieldItem field, MethodItem callback)
          Unregister for the changes of a field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageQueue

public MessageQueue()
Method Detail

getFieldClients

public Map getFieldClients()
Gets the map of field change client callbacks.

Returns:
a Map whose keys are of type FieldItem, and whose values are sets of MethodItem

fieldChanged

public void fieldChanged(Object substance,
                         FieldItem field,
                         Object previousValue,
                         Object currentValue)
Send a message to the queue saying that the field of an object has changed, so that it will be sent to all registered clients.

Parameters:
substance - the object whose field has changed
field - the field that changed

registerFieldChange

public void registerFieldChange(FieldItem field,
                                MethodItem callback)
Register for the changes of a field.

Parameters:
field - the field to register for
callback - a static method to be called when the field changes.
See Also:
unregisterFieldChange(FieldItem,MethodItem)

notifyFieldChange

public void notifyFieldChange(FieldChangeEvent event)
Notify registered clients of a field change.

Parameters:
event - the FieldChangeEvent to dispatch

unregisterFieldChange

public void unregisterFieldChange(FieldItem field,
                                  MethodItem callback)
Unregister for the changes of a field.

Parameters:
field - the field to unregister from
callback - a static method to to call anymore when the field changes.
See Also:
registerFieldChange(FieldItem,MethodItem)