Class ResourceProcessorException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.osgi.service.deploymentadmin.spi.ResourceProcessorException
- All Implemented Interfaces:
Serializable
Checked exception received when something fails during a call to a Resource
Processor. A
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.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
static final int
Other error condition.static final int
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 ofResourceProcessor.begin(DeploymentSession)
method.static final int
An artifact of any resource already exists.private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionResourceProcessorException
(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. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
CODE_PREPARE
public static final int CODE_PREPAREResource 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 ofResourceProcessor.begin(DeploymentSession)
method.Only the
ResourceProcessor.prepare()
method is allowed to throw exception with this error code.- See Also:
-
CODE_RESOURCE_SHARING_VIOLATION
public static final int CODE_RESOURCE_SHARING_VIOLATIONAn artifact of any resource already exists.Only the
ResourceProcessor.process(String, InputStream)
method is allowed to throw exception with this error code.- See Also:
-
CODE_OTHER_ERROR
public static final int CODE_OTHER_ERROROther error condition.All Resource Processor methods which throw
ResourceProcessorException
is allowed throw an exception with this error code if the error condition cannot be categorized.- See Also:
-
code
private final int code
-
-
Constructor Details
-
ResourceProcessorException
Create an instance of the exception.- Parameters:
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 exception
-
ResourceProcessorException
Create an instance of the exception. Cause exception is implicitly set to null.- Parameters:
code
- The error code of the failure. Code should be one of the predefined integer values (CODE_X
).message
- Message associated with the exception
-
ResourceProcessorException
public ResourceProcessorException(int code) Create an instance of the exception. Cause exception and message are implicitly set to null.- Parameters:
code
- The error code of the failure. Code should be one of the predefined integer values (CODE_X
).
-
-
Method Details
-
getCause
Returns the cause of this exception ornull
if no cause was set. -
initCause
Initializes the cause of this exception to the specified value.- Overrides:
initCause
in classThrowable
- Parameters:
cause
- The cause of this exception.- Returns:
- This exception.
- Throws:
IllegalArgumentException
- If the specified cause is this exception.IllegalStateException
- If the cause of this exception has already been set.- Since:
- 1.0.1
-
getCode
public int getCode()- Returns:
- Returns the code.
-