org.jabber.jabberbeans
Class ConnectionEvent
java.lang.Object
|
+--java.util.EventObject
|
+--org.jabber.jabberbeans.ConnectionEvent
- All Implemented Interfaces:
- java.io.Serializable
- public class ConnectionEvent
- extends java.util.EventObject
A ConnectionEvent
is an event occuring on a connection (from
the ConnectionBean) describing a change in the connection state, being
offline, online, connecting, or an error condition (connectFailed).
The main purpose for a ConnectionEvent currently is to mark the 'source'
of the event, so that the same event handler code can handle multiple
connections.
- See Also:
- Serialized Form
Fields inherited from class java.util.EventObject |
source |
Methods inherited from class java.util.EventObject |
getSource, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
STATE_UNKNOWN
public static final ConnectionEvent.EState STATE_UNKNOWN
STATE_DISCONNECTED
public static final ConnectionEvent.EState STATE_DISCONNECTED
STATE_CONNECTING
public static final ConnectionEvent.EState STATE_CONNECTING
STATE_CONNECTED
public static final ConnectionEvent.EState STATE_CONNECTED
REASON_UNKNOWN
public static final ConnectionEvent.EReason REASON_UNKNOWN
REASON_CLIENT_INITIATED
public static final ConnectionEvent.EReason REASON_CLIENT_INITIATED
REASON_SERVER_INITIATED
public static final ConnectionEvent.EReason REASON_SERVER_INITIATED
REASON_IO_ERROR
public static final ConnectionEvent.EReason REASON_IO_ERROR
ConnectionEvent
public ConnectionEvent(java.lang.Object source,
ConnectionEvent.EState state,
ConnectionEvent.EState oldState,
ConnectionEvent.EReason reason)
- Creates a new
ConnectionEvent
instance. This should
only really be called by ConnectionBean.
- Parameters:
source
- an Object
valuestate
- an Estate
valueoldState
- an EState
valuereason
- an Estate
value
getState
public ConnectionEvent.EState getState()
getState
returns the state change which prompted this
event.
- Returns:
- an
EState
value
getOldState
public ConnectionEvent.EState getOldState()
getOldState
returns the state which we were in before this
event
- Returns:
- an
EState
value
getReason
public ConnectionEvent.EReason getReason()
getReason
returns the reason the state changed, indicating
why the source sent this event (connection lost,
client requested disconnect, server requested disconnect)
- Returns:
- an
EReason
value