org.avis.client
Class CloseEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.avis.client.CloseEvent
All Implemented Interfaces:
Serializable

public class CloseEvent
extends EventObject

An event sent when the connection to the Elvin router is closed.

Author:
Matthew Phillips
See Also:
Serialized Form

Field Summary
 Throwable error
          The exception that was associated with the reason for closing.
 String message
          The message from the router, if any, or the client's description of the reason otherwise.
 int reason
          The reason for the shutdown: REASON_CLIENT_SHUTDOWN, REASON_ROUTER_SHUTDOWN, REASON_ROUTER_SHUTDOWN_UNEXPECTEDLY, REASON_ROUTER_STOPPED_RESPONDING, REASON_PROTOCOL_VIOLATION, REASON_IO_ERROR.
static int REASON_CLIENT_SHUTDOWN
          The client was shut down normally with a call to Elvin.close().
static int REASON_IO_ERROR
          An I/O exception was thrown while communicating with the router.
static int REASON_PROTOCOL_VIOLATION
          Either the client or the router decided that the protocol rules have been violated.
static int REASON_ROUTER_SHUTDOWN
          The router was shut down normally.
static int REASON_ROUTER_SHUTDOWN_UNEXPECTEDLY
          The network connection to the router was terminated abnormally without the standard shutdown protocol.
static int REASON_ROUTER_STOPPED_RESPONDING
          The router failed to respond to a liveness check.
 
Constructor Summary
CloseEvent(Object source, int reason, String message, Throwable error)
           
 
Method Summary
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REASON_CLIENT_SHUTDOWN

public static final int REASON_CLIENT_SHUTDOWN
The client was shut down normally with a call to Elvin.close().

See Also:
Constant Field Values

REASON_ROUTER_SHUTDOWN

public static final int REASON_ROUTER_SHUTDOWN
The router was shut down normally.

See Also:
Constant Field Values

REASON_ROUTER_STOPPED_RESPONDING

public static final int REASON_ROUTER_STOPPED_RESPONDING
The router failed to respond to a liveness check. Either the router has crashed, or network problems have stopped messages getting through.

See Also:
Constant Field Values

REASON_ROUTER_SHUTDOWN_UNEXPECTEDLY

public static final int REASON_ROUTER_SHUTDOWN_UNEXPECTEDLY
The network connection to the router was terminated abnormally without the standard shutdown protocol. Most likely the network connection between client and router has been disconnected.

See Also:
Constant Field Values

REASON_PROTOCOL_VIOLATION

public static final int REASON_PROTOCOL_VIOLATION
Either the client or the router decided that the protocol rules have been violated. This would only happen in the case of a serious bug in the client or router.

See Also:
Constant Field Values

REASON_IO_ERROR

public static final int REASON_IO_ERROR
An I/O exception was thrown while communicating with the router. The exception will be in the error field.

See Also:
Constant Field Values

reason

public final int reason
The reason for the shutdown: REASON_CLIENT_SHUTDOWN, REASON_ROUTER_SHUTDOWN, REASON_ROUTER_SHUTDOWN_UNEXPECTEDLY, REASON_ROUTER_STOPPED_RESPONDING, REASON_PROTOCOL_VIOLATION, REASON_IO_ERROR.


message

public final String message
The message from the router, if any, or the client's description of the reason otherwise.


error

public final Throwable error
The exception that was associated with the reason for closing. This may be null. It will be set in the case where an exception occurred during decoding a message from the router and triggered a close due to protocol violation.

Constructor Detail

CloseEvent

public CloseEvent(Object source,
                  int reason,
                  String message,
                  Throwable error)


Copyright © 2008 Matthew Phillips. All Rights Reserved.