|
|||||||||||
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 behavior subclasses must implement when a remote
exception occurs during a remote method invocation:
First, a RemoteExceptionInfo
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.
RemoteExceptionInfo
,
ExceptionHandler
,
Remote
,
Serialized FormField 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(java.lang.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. |
java.lang.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.
Syslog
protected 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.
SyslogExceptionHandler
protected 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
objectSyslog
public static void setSyslog(Syslog syslog)
Sets the Syslog
object facility.
Each message (debug, log, warning, error, ...) are wrote to this message logger.
Syslog
public ExceptionHandler getExceptionHandler()
Remote
Returns the RemoteExceptionHandler
which manage network
related exceptions.
getExceptionHandler
in interface Remote
RemoteExceptionHandler
which manage network
related exceptionspublic void setExceptionHandler(ExceptionHandler exceptionHandler)
Remote
Set the RemoteExceptionHandler
which manage network
related exceptions.
setExceptionHandler
in interface Remote
exceptionHandler
- 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(java.lang.Throwable throwable)
Check that the given throwable
is a
RuntimeException
or an Error
and throws
it.
throwable
- a Throwable
valuepublic java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |