Package jadex.bridge
Class RemoteChangeListenerHandler
- java.lang.Object
-
- jadex.bridge.RemoteChangeListenerHandler
-
- Direct Known Subclasses:
SRemoteClock.RemoteClockChangeListener
,SRemoteClock.RemoteSimServiceChangeListener
,SRemoteClock.RemoteTimerChangeListener
,SRemoteGui.ConsoleListener
public abstract class RemoteChangeListenerHandler extends java.lang.Object
A listener to be installed remotely in a component. Events are collected and sent to a remote change listener in bulk events.
-
-
Field Summary
Fields Modifier and Type Field Description protected MultiCollection<java.lang.String,java.lang.Object>
added
The added elements (if any).protected MultiCollection<java.lang.String,java.lang.Object>
changed
The changed elements (if any).static java.lang.String
EVENT_ADDED
The event type suffix for added events.static java.lang.String
EVENT_BULK
The event type for bulk events.static java.lang.String
EVENT_CHANGED
The event type suffix for changed events.static java.lang.String
EVENT_OCCURRED
The event type suffix for occurred events.static java.lang.String
EVENT_REMOVED
The event type suffix for removed events.protected java.lang.String
id
The id for remote listener deregistration.protected IInternalAccess
instance
The component instance.protected static int
MAX_EVENTS
Maximum number of events per delay period.protected MultiCollection<java.lang.String,java.lang.Object>
occurred
The listed occurrences (if any).protected IRemoteChangeListener
rcl
The change listener (proxy) to be informed about important changes.protected MultiCollection<java.lang.String,java.lang.Object>
removed
The removed elements (if any).protected boolean
started
The flag that the timer has been started.protected java.util.Timer
timer
The update timer (if any).protected static long
UPDATE_DELAY
Update delay.
-
Constructor Summary
Constructors Constructor Description RemoteChangeListenerHandler(java.lang.String id, IInternalAccess instance, IRemoteChangeListener rcl)
Create a BDI listener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
dispose()
Remove local listeners.void
elementAdded(java.lang.String type, java.lang.Object value)
An element was added.void
elementChanged(java.lang.String type, java.lang.Object value)
An element was changed.void
elementRemoved(java.lang.String type, java.lang.Object value)
An element was removed.boolean
equals(java.lang.Object obj)
Test equality based on id.int
hashCode()
Hash code based on id.void
occurrenceAppeared(java.lang.String type, java.lang.Object value)
An occurrence appeared.protected void
startTimer()
-
-
-
Field Detail
-
EVENT_ADDED
public static final java.lang.String EVENT_ADDED
The event type suffix for added events.- See Also:
- Constant Field Values
-
EVENT_REMOVED
public static final java.lang.String EVENT_REMOVED
The event type suffix for removed events.- See Also:
- Constant Field Values
-
EVENT_CHANGED
public static final java.lang.String EVENT_CHANGED
The event type suffix for changed events.- See Also:
- Constant Field Values
-
EVENT_OCCURRED
public static final java.lang.String EVENT_OCCURRED
The event type suffix for occurred events.- See Also:
- Constant Field Values
-
EVENT_BULK
public static final java.lang.String EVENT_BULK
The event type for bulk events.- See Also:
- Constant Field Values
-
UPDATE_DELAY
protected static final long UPDATE_DELAY
Update delay.- See Also:
- Constant Field Values
-
MAX_EVENTS
protected static final int MAX_EVENTS
Maximum number of events per delay period.- See Also:
- Constant Field Values
-
id
protected java.lang.String id
The id for remote listener deregistration.
-
instance
protected IInternalAccess instance
The component instance.
-
rcl
protected IRemoteChangeListener rcl
The change listener (proxy) to be informed about important changes.
-
added
protected MultiCollection<java.lang.String,java.lang.Object> added
The added elements (if any).
-
changed
protected MultiCollection<java.lang.String,java.lang.Object> changed
The changed elements (if any).
-
removed
protected MultiCollection<java.lang.String,java.lang.Object> removed
The removed elements (if any).
-
occurred
protected MultiCollection<java.lang.String,java.lang.Object> occurred
The listed occurrences (if any).
-
timer
protected java.util.Timer timer
The update timer (if any).
-
started
protected boolean started
The flag that the timer has been started.
-
-
Constructor Detail
-
RemoteChangeListenerHandler
public RemoteChangeListenerHandler(java.lang.String id, IInternalAccess instance, IRemoteChangeListener rcl)
Create a BDI listener.
-
-
Method Detail
-
elementAdded
public void elementAdded(java.lang.String type, java.lang.Object value)
An element was added.- Parameters:
type
- The element type used as prefix for the event (e.g. use 'goal' for 'goal_added' events).value
- The element value (must be transferable).
-
elementRemoved
public void elementRemoved(java.lang.String type, java.lang.Object value)
An element was removed.- Parameters:
type
- The element type used as prefix for the event (e.g. use 'goal' for 'goal_removed' events).value
- The element value (must be transferable).
-
elementChanged
public void elementChanged(java.lang.String type, java.lang.Object value)
An element was changed.- Parameters:
type
- The element type used as prefix for the event (e.g. use 'goal' for 'goal_changed' events).value
- The element value (must be transferable).
-
occurrenceAppeared
public void occurrenceAppeared(java.lang.String type, java.lang.Object value)
An occurrence appeared.- Parameters:
type
- The occurrence type used as prefix for the event (e.g. use 'step' for 'step_occurred' events).value
- The occurrence value (must be transferable).
-
startTimer
protected void startTimer()
-
equals
public boolean equals(java.lang.Object obj)
Test equality based on id.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Hash code based on id.- Overrides:
hashCode
in classjava.lang.Object
-
dispose
protected void dispose()
Remove local listeners.
-
-