public class ResourceProcessorException extends Exception
ResourceProcessorException
always contains an error code
(one of the constants specified in this class), and may optionally contain
the textual description of the error condition and a nested cause exception.Modifier and Type | Field and Description |
---|---|
static int |
CODE_OTHER_ERROR
Other error condition.
|
static int |
CODE_PREPARE
Resource Processors are allowed to raise an exception with this error
code to indicate that the processor is not able to commit the operations
it made since the last call of
ResourceProcessor.begin(DeploymentSession) method. |
static int |
CODE_RESOURCE_SHARING_VIOLATION
An artifact of any resource already exists.
|
Constructor and Description |
---|
ResourceProcessorException(int code)
Create an instance of the exception.
|
ResourceProcessorException(int code,
String message)
Create an instance of the exception.
|
ResourceProcessorException(int code,
String message,
Throwable cause)
Create an instance of the exception.
|
Modifier and Type | Method and Description |
---|---|
Throwable |
getCause()
Returns the cause of this exception or
null if no cause was set. |
int |
getCode() |
Throwable |
initCause(Throwable cause)
Initializes the cause of this exception to the specified value.
|
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public static final int CODE_PREPARE
ResourceProcessor.begin(DeploymentSession)
method.
Only the ResourceProcessor.prepare()
method is allowed to throw
exception with this error code.
public static final int CODE_RESOURCE_SHARING_VIOLATION
Only the ResourceProcessor.process(String, InputStream)
method is
allowed to throw exception with this error code.
public static final int CODE_OTHER_ERROR
All Resource Processor methods which throw
ResourceProcessorException
is allowed throw an exception with
this error code if the error condition cannot be categorized.
public ResourceProcessorException(int code, String message, Throwable cause)
code
- The error code of the failure. Code should be one of the
predefined integer values (CODE_X
).message
- Message associated with the exceptioncause
- the originating exceptionpublic ResourceProcessorException(int code, String message)
code
- The error code of the failure. Code should be one of the
predefined integer values (CODE_X
).message
- Message associated with the exceptionpublic ResourceProcessorException(int code)
code
- The error code of the failure. Code should be one of the
predefined integer values (CODE_X
).public Throwable getCause()
null
if no cause was set.public Throwable initCause(Throwable cause)
initCause
in class Throwable
cause
- The cause of this exception.IllegalArgumentException
- If the specified cause is this
exception.IllegalStateException
- If the cause of this exception has already
been set.public int getCode()
Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0