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

Field Summary
static int GATEWAY_ALLOCATED
          Identifier for event issued when gateway allocation is complete.
static int GATEWAY_ALLOCATING_RESOURCES
          Identifier for event issued when gateway allocation has commenced.
static int GATEWAY_DEALLOCATED
          Identifier for event issued when gateway deallocation is complete.
static int GATEWAY_DEALLOCATING_RESOURCES
          Identifier for event issued when gateway deallocation has commenced.
static int GATEWAY_PAUSED
          Identifier for event issued when gateway is paused.
static int GATEWAY_RESUMED
          Identifier for event issued when gateway is resumed.
protected  long newGatewayState
          Gateway state following this event.
protected  long oldGatewayState
          Gateway state prior to this event.
 
Fields inherited from class com.jpeterson.x10.ControlEvent
id
 
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 com.jpeterson.x10.ControlEvent
getId, toString
 
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
 

Field Detail

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
Constructor Detail

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 event
id - the identifier for the event type
oldGatewayState - gateway state prior to this event
newGatewayState - gateway state following this event
See Also:
getGatewayState
Method Detail

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