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
-
Constructor Summary
ConstructorDescriptionRemoteWrappedException
(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 ornull
if the cause is nonexistent or unknown.Gets the class name of the original exception.static String
getStackTrace
(Throwable throwable) Gets the stack trace from a Throwable as a String.boolean
Checks if the exception is the expected class.void
void
static RemoteWrappedException
Wraps the Throwable into a RemoteWrappedException instance.Methods inherited from class org.identityconnectors.framework.common.exceptions.ConnectorException
rethrow
Methods 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:
true
if the class name are equals.
-
getCause
Returns the cause of original throwable ornull
if the cause is nonexistent or unknown. (The cause is the throwable that caused the original throwable to get thrown.) -
printStackTrace
- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
- Overrides:
printStackTrace
in classThrowable
-
readStackTrace
-
getStackTrace
Gets the stack trace from a Throwable as a String.- Parameters:
throwable
- theThrowable
to 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
RemoteWrappedException
that 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
- theThrowable
to be converted- Returns:
- the Map representing the throwable.
-