Class RemoteWrappedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.identityconnectors.framework.common.exceptions.ConnectorException
org.identityconnectors.framework.impl.api.remote.RemoteWrappedException
- All Implemented Interfaces:
Serializable
RemoteWrappedException wraps every exception which are received from Remote
Connector Server.
This Exception is not allowed to use in Connectors!!!
This type of exception is not allowed to be serialise because this exception
represents any after deserialization.
This code example show how to get the remote stack trace and how to use the
same catches to handle the exceptions regardless its origin.
String stackTrace = null;
try {
try {
facade.getObject(ObjectClass.ACCOUNT, uid, null);
} catch (RemoteWrappedException e) {
stackTrace = e.getStackTrace()
}
} catch (Throwable t) {
if (null != stackTrace) {
System.err.println(stackTrace);
} else {
t.printStackTrace();
}
}
- Since:
- 1.4
- Author:
- Laszlo Hordos
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRemoteWrappedException(String throwableClass, String message, RemoteWrappedException cause, String stackTrace) -
Method Summary
Modifier and TypeMethodDescriptionConverts the throwable object to a new Map object that representing itself.getCause()Returns the cause of original throwable ornullif the cause is nonexistent or unknown.Gets the class name of the original exception.static StringgetStackTrace(Throwable throwable) Gets the stack trace from a Throwable as a String.booleanChecks if the exception is the expected class.voidvoidstatic RemoteWrappedExceptionWraps the Throwable into a RemoteWrappedException instance.Methods inherited from class org.identityconnectors.framework.common.exceptions.ConnectorException
rethrowMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString
-
Field Details
-
FIELD_CLASS
- See Also:
-
FIELD_MESSAGE
- See Also:
-
FIELD_CAUSE
- See Also:
-
FIELD_STACK_TRACE
- See Also:
-
-
Constructor Details
-
RemoteWrappedException
public RemoteWrappedException(String throwableClass, String message, RemoteWrappedException cause, String stackTrace)
-
-
Method Details
-
getExceptionClass
Gets the class name of the original exception. This value is constructed bythrowable.getClass().getName().- Returns:
- name of the original exception.
-
is
Checks if the exception is the expected class.- Parameters:
expected- the expected throwable class.- Returns:
trueif the class name are equals.
-
getCause
Returns the cause of original throwable ornullif the cause is nonexistent or unknown. (The cause is the throwable that caused the original throwable to get thrown.) -
printStackTrace
- Overrides:
printStackTracein classThrowable
-
printStackTrace
- Overrides:
printStackTracein classThrowable
-
readStackTrace
-
getStackTrace
Gets the stack trace from a Throwable as a String.- Parameters:
throwable- theThrowableto be examined- Returns:
- the stack trace as generated by the exception's
printStackTrace(PrintWriter)method
-
wrap
Wraps the Throwable into a RemoteWrappedException instance.- Parameters:
ex- Exception to wrap or cast and return.- Returns:
- a
RemoteWrappedExceptionthat either is the specified exception or contains the specified exception.
-
convert
Converts the throwable object to a new Map object that representing itself.- Parameters:
throwable- theThrowableto be converted- Returns:
- the Map representing the throwable.
-