public class StateChangeEvent
extends java.lang.Object
state
change at a node
to the StateChangeListener. There is a distinct instance of this event
representing each state change at a node.
Each event instance may have zero or more state change related exceptions
associated with it. The exceptions are of type StateChangeException
.
StateChangeException
has a method called StateChangeException.getEvent()
that can be used to associate an event with
an exception.
StateChangeListener
Constructor and Description |
---|
StateChangeEvent(ReplicatedEnvironment.State state,
NameIdPair masterNameId) |
Modifier and Type | Method and Description |
---|---|
long |
getEventTime()
Returns the time (in nano second units) the event occurred, as reported
by
System.nanoTime() |
java.lang.String |
getMasterNodeName()
Returns the node name identifying the master at the time of the event.
|
ReplicatedEnvironment.State |
getState()
Returns the state that the node has transitioned to.
|
public StateChangeEvent(ReplicatedEnvironment.State state, NameIdPair masterNameId)
state
- the new statemasterNameId
- the new master or NULL
if there isn't
one.public ReplicatedEnvironment.State getState()
State resulting from this event
public long getEventTime()
System.nanoTime()
public java.lang.String getMasterNodeName() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the node is in the
DETACHED
or UNKNOWN
state.Copyright (c) 2004-2012 Oracle. All rights reserved.