|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
com.sun.jini.proxy.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 Form| Constructor 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 throw
public ThrowThis(RemoteException toThrow,
String message)
toThrow - RemoteException you proxy to throwmessage - Message to construct super object with| Method Detail |
public void throwRemoteException()
throws RemoteException
RemoteException the server wants thrown
RemoteExceptionpublic String getMessage()
public void printStackTrace()
System.err.
public void printStackTrace(PrintWriter pw)
pw
pw - the print writerpublic void printStackTrace(PrintStream ps)
ps.
ps - the print stream
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||