com.jpeterson.x10
Class GatewayEvent
java.lang.Object
|
+--java.util.EventObject
|
+--com.jpeterson.x10.ControlEvent
|
+--com.jpeterson.x10.GatewayEvent
- Direct Known Subclasses:
- GatewayErrorEvent
- public class GatewayEvent
- extends ControlEvent
GatewayEvent
notifies changes in state of a gateway that
transmits or receives. GatewayEvents
are issued to each
GatewayListener
attached to a gateway. The
TransmissionEvent
and ReceptionEvent
classes both
extend GatewayEvent
to provide specific events for transmitters
and receivers.
- See Also:
- Serialized Form
Fields inherited from class java.util.EventObject |
source |
Constructor Summary |
GatewayEvent(Gateway source,
int id,
long oldGatewayState,
long newGatewayState)
Constructs an GatewayEvent with an event identifier, old
gateway state and new gateway state. |
Method Summary |
long |
getNewGatewayState()
Return the state following this GatewayEvent . |
long |
getOldGatewayState()
Return the state prior to this GatewayEvent . |
java.lang.String |
paramString()
Returns a parameter string identifying this event. |
Methods inherited from class java.util.EventObject |
getSource |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
GATEWAY_ALLOCATED
public static final int GATEWAY_ALLOCATED
- Identifier for event issued when gateway allocation is complete. The
ALLOCATED
flag of the newGatewayState
is set.
- See Also:
getNewGatewayState
,
getId
,
allocate
,
gatewayAllocated
GATEWAY_DEALLOCATED
public static final int GATEWAY_DEALLOCATED
- Identifier for event issued when gateway deallocation is complete. The
DEALLOCATED
flag of the newGatewayState
is set.
- See Also:
getNewGatewayState
,
getId
,
allocate
,
gatewayDeallocated
GATEWAY_ALLOCATING_RESOURCES
public static final int GATEWAY_ALLOCATING_RESOURCES
- Identifier for event issued when gateway allocation has commenced. The
ALLOCATING_RESOURCES
flag of the
newGatewayState
is set.
- See Also:
getNewGatewayState
,
getId
,
allocate
,
gatewayAllocatingResources
GATEWAY_DEALLOCATING_RESOURCES
public static final int GATEWAY_DEALLOCATING_RESOURCES
- Identifier for event issued when gateway deallocation has commenced. The
DEALLOCATING_RESOURCES
flag of the
newGatewayState
is set.
- See Also:
getNewGatewayState
,
getId
,
allocate
,
gatewayDeallocatingResources
GATEWAY_PAUSED
public static final int GATEWAY_PAUSED
- Identifier for event issued when gateway is paused. The
PAUSED
flag of the newGatewayState
is set.
- See Also:
getNewGatewayState
,
getId
,
pause
,
gatewayPaused
GATEWAY_RESUMED
public static final int GATEWAY_RESUMED
- Identifier for event issued when gateway is resumed. The
RESUMED
flag of the newGatewayState
is set.
- See Also:
getNewGatewayState
,
getId
,
resume
,
gatewayResumed
newGatewayState
protected long newGatewayState
- Gateway state following this event.
- See Also:
getNewGatewayState
oldGatewayState
protected long oldGatewayState
- Gateway state prior to this event.
- See Also:
getOldGatewayState
GatewayEvent
public GatewayEvent(Gateway source,
int id,
long oldGatewayState,
long newGatewayState)
- Constructs an
GatewayEvent
with an event identifier, old
gateway state and new gateway state.
- Parameters:
source
- the object that issued the eventid
- the identifier for the event typeoldGatewayState
- gateway state prior to this eventnewGatewayState
- gateway state following this event- See Also:
getGatewayState
getNewGatewayState
public long getNewGatewayState()
- Return the state following this
GatewayEvent
. The value
matches the getGatewayState
method.
- See Also:
getGatewayState
getOldGatewayState
public long getOldGatewayState()
- Return the state prior to this
GatewayEvent
.
- See Also:
getGatewayState
paramString
public java.lang.String paramString()
- Returns a parameter string identifying this event. This method is useful
for event-logging and for debugging.
- Overrides:
- paramString in class ControlEvent
- Returns:
- a string identifying the event