Package com.iizix.event
Class RemoteEvent
- java.lang.Object
- com.iizix.event.GEvent
- com.iizix.event.BubbleEvent
- com.iizix.event.RemoteEvent
- All Implemented Interfaces:
IPostEventProcessing
public class RemoteEvent extends BubbleEvent
A remote event is used to communicate between end-points property instances. The event can hold optional parameters in a property container that must be able to be sent over a transaction.When this event is triggered, it will cause the event to bubble in a non-sinking way. The
isRemoteInduced
state can be checked by listeners. The property that is the destination of this event will not be event-notified the standard way usingonEventSelf()
, but rather with theonRemoteEvent(remoteEvent)
method that should be overridden in the property class.- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from class com.iizix.event.GEvent
GEvent.Operation
Field Summary
Fields inherited from class com.iizix.event.GEvent
PROP_ADDED, PROP_ATTR_CHANGED, PROP_CNR_ADDED, PROP_CNR_FOCUS, PROP_CNR_MOVED, PROP_CNR_RENAMED, PROP_DESIGNER_ASSET_CHANGED, PROP_DESIGNER_JAVA_CLASS_CHANGED, PROP_DESIGNER_JAVA_METHOD_RENAMED, PROP_DESIGNER_KSTRING, PROP_DESIGNER_VIEWER_UPDATE, PROP_DESIGNER_VS_REFERENCE, PROP_DISPOSED, PROP_FOCUS, PROP_MOVED_FROM, PROP_MOVED_TO, PROP_PROJECT_RENAMED, PROP_QUERY_DESIGNER_PROPS, PROP_REFRESH, PROP_REMOVED, PROP_RENAMED, PROP_REORDERED, PROP_RESOLVE_REFERENCES_DIRECT, PROP_VALUE_CHANGED, REMOTE
Constructor Summary
Constructors Constructor Description RemoteEvent(GProp<?> source, int localID, PropCnr params)
Creates a new remote event (locally).RemoteEvent(GProp<?> source, int localID, PropCnr params, PropMgr originator)
Creates a new remote event.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getLocalID()
Gets the property-local event ID.PropMgr
getOriginator()
Gets the originator Property Manager.PropCnr
getParameters()
Gets the property container that is used to add parameters.protected java.lang.StringBuilder
paramString(java.lang.StringBuilder buf)
Returns the parameter string representing the state of this event.void
retarget(GProp<?> newTarget)
Re-targets this event to a new source property and sends it.void
retarget(GProp<?> newTarget, PropMgr propMgr)
Re-target this event to a Property Manager for queued sending.Methods inherited from class com.iizix.event.BubbleEvent
getOperations
Methods inherited from class com.iizix.event.GEvent
addPostProcessor, cancel, consume, getAlternateDestination, getEventID, getEventName, getEventName, getEventTarget, getOperation, getPostProcessors, getSender, getSource, getTrigger, isCancelled, isClearCacheEvent, isConsumed, isEventProcessed, isPropertyChange, isPropertyChange, isPropertyChange, isPropertyChangeIn, isPropertyChangeInTree, isRefreshEvent, isRemoteInduced, isVerifyEvent, send, send, sendSelf, setInitialProperty, setOperation, setProgressMonitor, toString
Constructor Detail
RemoteEvent
public RemoteEvent(GProp<?> source, int localID, PropCnr params)
Creates a new remote event (locally).- Parameters:
source
- The source property.localID
- The property-local event ID.params
- Parameters for the event, null for none.- Throws:
java.lang.IllegalArgumentException
- If the localID is not between 0 and 0x3FFFFFFF.
RemoteEvent
public RemoteEvent(GProp<?> source, int localID, PropCnr params, PropMgr originator)
Creates a new remote event. This method should be used from thePropMgr
instance only, ifisRemote
istrue
.- Parameters:
source
- The source property.localID
- The property-local event ID.params
- The parameters or null for none.originator
- The originator.- Throws:
java.lang.IllegalArgumentException
- If originator is not valid.
Method Detail
getLocalID
public int getLocalID()
Gets the property-local event ID.
getParameters
public PropCnr getParameters()
Gets the property container that is used to add parameters.- Returns:
- The parameters container, or null if not present.
getOriginator
public PropMgr getOriginator()
Gets the originator Property Manager.- Returns:
- The instance of the Property Manager for the remote party, null when local.
paramString
protected java.lang.StringBuilder paramString(java.lang.StringBuilder buf)
Returns the parameter string representing the state of this event. This string is useful for debugging. Super classes adds extra information to the string by preceding it with a comma followed by the extra information.- Overrides:
paramString
in classGEvent
- Parameters:
buf
- The StringBuilder to append the string to.- Returns:
- The StringBuilder, i.e. the
buf
input parameter.
retarget
public void retarget(GProp<?> newTarget)
Re-targets this event to a new source property and sends it. This is used typically by the proxy property container to re-target an incoming remote event from the proxy container to the proxied container. The same originator is kept. The event is then notified in the target tree starting with thenewTarget
.- Parameters:
newTarget
- The new target property.