ice.util.security
Class ProxyException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ice.util.security.ProxyException
- All Implemented Interfaces:
- Serializable
- public final class ProxyException
- extends RuntimeException
Utility class to wrap checked exception to pass then out of BoxedCode.run
implementation.
Usage example which is messy but Java lives not much options here
...
Socket socket;
try {
socket = (Socket)SecurityKit.doPrivileged(new BoxedCode() {
public Object run() {
try { return new Socket(ip, port); }
catch (IOException ex) { throw new ProxyException(ex); }
}
});
}
catch (ProxyException ex) {
throw (IOException)ex.getTarget();
}
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
ProxyException
public ProxyException(Exception target)
getTarget
public Exception getTarget()