|
GigaSpaces XAP 9.7.2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception com.sun.jini.proxy.ThrowThis
public class ThrowThis
The semi-official way for remote methods on registration objects
(e.g LeaseRenewalSet
,
LookupDiscoveryRegistration
,
MailboxRegistration
) to indicate that the registration
no longer exists is to throw NoSuchObjectException
.
Unfortunately if the registration object is implemented as a smart
proxy that uses RMI to communicate back to the server (instead of a
straight RMI object) it is not possible for the server to throw
NoSuchObjectException
directly since RMI will wrap
such an exception in a ServerException
.
ThrowThis
provides a solution to this problem. When
the server wants to throw a RemoteException
it creates a
ThrowThis
object that wraps the
RemoteException
and then throws the
ThrowThis
. The proxy catches ThrowThis
exceptions and in the catch block and calls
throwRemoteException
to throw the intended exception.
NoSuchObjectException
,
ServerException
,
Serialized FormConstructor Summary | |
---|---|
ThrowThis(RemoteException toThrow)
Simple constructor |
|
ThrowThis(RemoteException toThrow,
String message)
Simple constructor. |
Method Summary | |
---|---|
String |
getMessage()
Returns the detail message, including the message from the nested exception the server wants thrown |
void |
printStackTrace()
Prints the composite message to System.err . |
void |
printStackTrace(PrintStream ps)
Prints the composite message and the embedded stack trace to the specified stream ps . |
void |
printStackTrace(PrintWriter pw)
Prints the composite message and the embedded stack trace to the specified print writer pw |
void |
throwRemoteException()
Throw the RemoteException the server wants thrown |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ThrowThis(RemoteException toThrow)
toThrow
- RemoteException
you proxy to throwpublic ThrowThis(RemoteException toThrow, String message)
toThrow
- RemoteException
you proxy to throwmessage
- Message to construct super object withMethod Detail |
---|
public void throwRemoteException() throws RemoteException
RemoteException
the server wants thrown
RemoteException
public String getMessage()
getMessage
in class Throwable
public void printStackTrace()
System.err
.
printStackTrace
in class Throwable
public void printStackTrace(PrintWriter pw)
pw
printStackTrace
in class Throwable
pw
- the print writerpublic void printStackTrace(PrintStream ps)
ps
.
printStackTrace
in class Throwable
ps
- the print stream
|
GigaSpaces XAP 9.7.2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |