|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectConnProcessorExceptionEvent
An event that occurs when an exception is thrown somewhere in a
ConnProcessor.
| Field Summary | |
static java.lang.Object |
ERRTYPE_CMD_GEN
An exception type indicating that an exception was thrown while converting a raw packet to a command object in a command factory. |
static java.lang.Object |
ERRTYPE_CMD_WRITE
An exception type indicating that an exception was thrown while writing a command to a stream. |
static java.lang.Object |
ERRTYPE_CONNECTION_ERROR
An exception type indicating that an exception was thrown while attempting to read from the attached input stream. |
static java.lang.Object |
ERRTYPE_PACKET_LISTENER
An exception type indicating that an exception was thrown while passing a packet event to a packet listener. |
| Constructor Summary | |
protected |
ConnProcessorExceptionEvent(java.lang.Object type,
java.lang.Throwable exception,
java.lang.Object reason)
Creates a new exception event with the given properties. |
| Method Summary | |
java.lang.Throwable |
getException()
Returns the exception that was thrown. |
java.lang.Object |
getReason()
Returns an object describing or providing more detail regarding the exception that was thrown. |
java.lang.Object |
getType()
Returns the type of this exception, possibly indicating when or why this exception was thrown. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.Object ERRTYPE_CONNECTION_ERROR
getReason()) in this case will be
null.
public static final java.lang.Object ERRTYPE_CMD_WRITE
getReason()) will be the
command object whose stream-writing method (like write)
threw an exception.
public static final java.lang.Object ERRTYPE_CMD_GEN
getReason() will be the raw packet
used in the command generation attempt which threw the exception).
public static final java.lang.Object ERRTYPE_PACKET_LISTENER
| Constructor Detail |
protected ConnProcessorExceptionEvent(java.lang.Object type,
java.lang.Throwable exception,
java.lang.Object reason)
type - the type of the event, like ERRTYPE_CMD_GENexception - the exception that occurred, if anyreason - a "reason object" that describes why the given exception
occurred, if any| Method Detail |
public final java.lang.Object getType()
ERRTYPE_CONNECTION_ERROR,
ERRTYPE_CMD_WRITE, ERRTYPE_CMD_GEN, and ERRTYPE_PACKET_LISTENER, but other classes may define their own types
as well.
public final java.lang.Throwable getException()
public final java.lang.Object getReason()
FlapPacketListener, for example, if that was
the source of this exception, for example. The type of this value may
change, so code such as the following is suggested for handling it:
if (e.getReason() instanceof Throwable) {
((Throwable) e.getReason()).printStackTrace();
} else {
System.err.println(e.getReason());
}
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||