Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (c) OSGi Alliance (2005, 2010). All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package org.osgi.service.deploymentadmin.spi;
 
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.
 
 public class ResourceProcessorException extends Exception {

 
 	private static final long	serialVersionUID	= 9135007015668223386L;

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(org.osgi.service.deploymentadmin.spi.DeploymentSession) method.

Only the ResourceProcessor.prepare() method is allowed to throw exception with this error code.

 
 	public static final int	CODE_PREPARE					= 1;

An artifact of any resource already exists.

Only the ResourceProcessor.process(java.lang.String,java.io.InputStream) method is allowed to throw exception with this error code.

 
 	public static final int	CODE_RESOURCE_SHARING_VIOLATION	= 461;

Other 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.

 
 	public static final int	CODE_OTHER_ERROR				= 463;
 
 	private final int				code;

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 exception
cause the originating exception
 
 	public ResourceProcessorException(int codeString messageThrowable cause) {
 		super(messagecause);
 		this. = code;
 	}

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
 
 	public ResourceProcessorException(int codeString message) {
 		super(message);
 		this. = 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).
 
 	public ResourceProcessorException(int code) {
 		super();
 		this. = code;
 	}

Returns the cause of this exception or null if no cause was set.

Returns:
The cause of this exception or null if no cause was set.
	public Throwable getCause() {
		return super.getCause();
	}

Initializes the cause of this exception to the specified value.

Parameters:
cause The cause of this exception.
Returns:
This exception.
Throws:
java.lang.IllegalArgumentException If the specified cause is this exception.
java.lang.IllegalStateException If the cause of this exception has already been set.
Since:
1.0.1
	public Throwable initCause(Throwable cause) {
		return super.initCause(cause);
	}

Returns:
Returns the code.
	public int getCode() {
		return ;
	}
New to GrepCode? Check out our FAQ X