|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectmandala.jacob.remote.AbstractRemote
Abstract base class for remote implementation.
This class defines the ExceptionInfo and the behavior
subclasses must implement when a remote exception occurs during a remote
method invocation:
First, an AbstractRemote.ExceptionInfo must be created and given in argument to the
method ExceptionHandler.handleException(Object) of the
ExceptionHandler returned by getExceptionHandler().
Then, the object returned is used to known what to further do:
ExceptionHandler.RejectExceptionHandling.REJECT,
then the thrown exception is re-thrown in an ExceptionHandler.UnHandledException wrapper;
The handler must be able to return a value conforming to the return type of the method which throws the original exception. If the type is a primitive type, it must be wrapped in the corresponding wrapper class, implementation will convert it to the necessary primitive corresponding type.
Note that on deserialization, the exceptionHandler field is set
to defaultExceptionHandler if the one written on serialization is
not serializable.
AbstractRemote.ExceptionInfo,
ExceptionHandler,
Remote,
Serialized Form| Nested Class Summary | |
class |
AbstractRemote.ExceptionInfo
This class contains any usefull informations that may be used to recover from a catched remote exception to a valid state. |
| Field Summary | |
protected static ExceptionHandler |
defaultExceptionHandler
The exception handler used when none are specified. |
protected ExceptionHandler |
exceptionHandler
The ExceptionHandler instance to use when a remote
exception occurs. |
protected static Syslog |
syslog
Message logger. |
| Constructor Summary | |
protected |
AbstractRemote()
Creates a new AbstractRemote. |
protected |
AbstractRemote(ExceptionHandler exceptionHandler)
Creates a new AbstractRemote. |
| Method Summary | |
static ExceptionHandler |
getDefaultExceptionHandler()
Get the DefaultExceptionHandler value. |
ExceptionHandler |
getExceptionHandler()
Returns the RemoteExceptionHandler which manage network
related exceptions. |
static Syslog |
getSyslog()
Returns the Syslog object facility. |
static void |
handleException(Throwable throwable)
Check that the given throwable is a
RuntimeException or an Error and throws
it. |
static void |
setDefaultExceptionHandler(ExceptionHandler handler)
Set the DefaultExceptionHandler value. |
void |
setExceptionHandler(ExceptionHandler exceptionHandler)
Set the RemoteExceptionHandler which manage network
related exceptions. |
static void |
setSyslog(Syslog syslog)
Sets the Syslog object facility. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static Syslog syslog
Message logger.
Each message (debug, log, warning, error, ...) are wrote to this message logger.
Syslogprotected static ExceptionHandler defaultExceptionHandler
The exception handler used when none are specified.
protected transient ExceptionHandler exceptionHandler
The ExceptionHandler instance to use when a remote
exception occurs.
ExceptionHandler| Constructor Detail |
protected AbstractRemote()
Creates a new AbstractRemote.
The ExceptionHandler to use when an exception occurs is
set to a new SyslogExceptionHandler instance.
SyslogExceptionHandlerprotected AbstractRemote(ExceptionHandler exceptionHandler)
Creates a new AbstractRemote.
exceptionHandler - The ExceptionHandler to use when a
remote exception occurs.ExceptionHandler| Method Detail |
public static Syslog getSyslog()
Returns the Syslog object facility.
Each message (debug, log, warning, error, ...) are wrote to this message logger.
Syslog objectSyslogpublic static void setSyslog(Syslog syslog)
Sets the Syslog object facility.
Each message (debug, log, warning, error, ...) are wrote to this message logger.
Syslogpublic ExceptionHandler getExceptionHandler()
RemoteReturns the RemoteExceptionHandler which manage network
related exceptions.
getExceptionHandler in interface RemoteRemoteExceptionHandler which manage network
related exceptionspublic void setExceptionHandler(ExceptionHandler exceptionHandler)
RemoteSet the RemoteExceptionHandler which manage network
related exceptions.
setExceptionHandler in interface RemoteexceptionHandler - the RemoteExceptionHandler which
should manage network related exceptionspublic static ExceptionHandler getDefaultExceptionHandler()
Get the DefaultExceptionHandler value.
public static void setDefaultExceptionHandler(ExceptionHandler handler)
Set the DefaultExceptionHandler value.
handler - The new default exception handler value.public static void handleException(Throwable throwable)
Check that the given throwable is a
RuntimeException or an Error and throws
it.
throwable - a Throwable valuepublic String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||