wt.clients.util
Class RefreshEvent

java.lang.Object
  extended byjava.util.EventObject
      extended bywt.clients.util.RefreshEvent
All Implemented Interfaces:
Serializable

public class RefreshEvent
extends EventObject

Class RefreshEvent is an event class used by clients for capturing object creation, modification, and deletion events. This class maintains the type of action that has occurred, the object on which the action occurred, and the object which generated the event. This utility class is used in conjunction with RefreshListener and RefreshService. A RefreshEvent is broadcast by the RefreshService to objects registered as RefreshListeners:

    obj = (Object) MyTaskLogic.updateObject( obj );
    RefreshEvent evt = new RefreshEvent( this, RefreshEvent.UPDATE, obj );
    RefreshService.getRefreshService().dispatchRefresh( evt );
  

See Also:
RefreshListener,

Supported API: true

Extendable: false
, Serialized Form

Field Summary
private  int action
           
static int CREATE
          Defined int constant representing a create action being performed.
static int DELETE
          Defined int constant representing a delete action being performed.
private  PropertyChangeEvent[] propertyChanges
           
private  Object target
           
static int UNKNOWN
          Defined int constant representing an unknown action being performed.
static int UPDATE
          Defined int constant representing an update action being performed.
private static String versionID
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
RefreshEvent(Object source, int action, Object target)
          Constructor for RefreshEvent.
RefreshEvent(Object source, int action, Object target, PropertyChangeEvent[] property_changes)
          Constructor for RefreshEvent.
 
Method Summary
 int getAction()
          Returns the action associated with the event.
 PropertyChangeEvent[] getPropertyChanges()
          In the case of an UPDATE event, this method returns the array of PropertyChangeEvents that specify what updates occurred.
 Object getTarget()
          Returns the target object on which the action of this event occurred.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

action

private int action

target

private Object target

propertyChanges

private PropertyChangeEvent[] propertyChanges

UNKNOWN

public static final int UNKNOWN
Defined int constant representing an unknown action being performed.

See Also:
Constant Field Values

CREATE

public static final int CREATE
Defined int constant representing a create action being performed.

See Also:
Constant Field Values

UPDATE

public static final int UPDATE
Defined int constant representing an update action being performed.

See Also:
Constant Field Values

DELETE

public static final int DELETE
Defined int constant representing a delete action being performed.

See Also:
Constant Field Values

versionID

private static final String versionID
See Also:
Constant Field Values
Constructor Detail

RefreshEvent

public RefreshEvent(Object source,
                    int action,
                    Object target)
Constructor for RefreshEvent.

Parameters:
source - the source Object which is responsible for generating this event
action - the int action which has occurred (CREATE, UPDATE, DELETE)
target - the target Object on which the action occurred

RefreshEvent

public RefreshEvent(Object source,
                    int action,
                    Object target,
                    PropertyChangeEvent[] property_changes)
Constructor for RefreshEvent. This constructor supports passing the array of PropertyChangeEvents that are associated with an UPDATE event.

Parameters:
source - the source Object which is responsible for generating this event
action - the int action which has occurred (CREATE, UPDATE, DELETE)
target - the target Object on which the action occurred
property_changes - the array of PropertyChangeEvents that correspond with an UPDATE event
Method Detail

getAction

public int getAction()
Returns the action associated with the event.

Returns:
int value representing the action of this event

getTarget

public Object getTarget()
Returns the target object on which the action of this event occurred.

Returns:
the Object which has been created, updated, deleted.

getPropertyChanges

public PropertyChangeEvent[] getPropertyChanges()
In the case of an UPDATE event, this method returns the array of PropertyChangeEvents that specify what updates occurred. The array is not intended to have meaning in the case of a CREATE or DELETE event.

Returns:
the array of PropertyChangeEvent