Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (c) OSGi Alliance (2000, 2012). 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.framework;

A Framework exception used to indicate that a bundle lifecycle problem occurred.

A BundleException object is created by the Framework to denote an exception condition in the lifecycle of a bundle. BundleExceptions should not be created by bundle developers. A type code is used to identify the exception type for future extendability.

OSGi Alliance reserves the right to extend the set of types.

This exception conforms to the general purpose exception chaining mechanism.

Version:
$Id: 0c97ed2696b4576d61440020922b1a97545beb1e $
 
 
 public class BundleException extends Exception {
 	static final long		serialVersionUID		= 3571095144220455665L;
Type of bundle exception.

Since:
1.5
 
 	private final int		type;

No exception type is specified.

Since:
1.5
 
 	public static final int	UNSPECIFIED				= 0;
The operation was unsupported. This type can be used anywhere a BundleException can be thrown.

Since:
1.5
 
 	public static final int	UNSUPPORTED_OPERATION	= 1;
The operation was invalid.

Since:
1.5
 
 	public static final int	INVALID_OPERATION		= 2;
The bundle manifest was in error.

Since:
1.5
 
 	public static final int	MANIFEST_ERROR			= 3;
The bundle was not resolved.

Since:
1.5
 
 	public static final int	RESOLVE_ERROR			= 4;
The bundle activator was in error.

Since:
1.5
 
 	public static final int	ACTIVATOR_ERROR			= 5;
The operation failed due to insufficient permissions.

Since:
1.5
 
 	public static final int	SECURITY_ERROR			= 6;
The operation failed to complete the requested lifecycle state change.

Since:
1.5
 
 	public static final int	STATECHANGE_ERROR		= 7;

The bundle could not be resolved due to an error with the Bundle-NativeCode header.

Since:
1.5
	public static final int	NATIVECODE_ERROR		= 8;

The install or update operation failed because another already installed bundle has the same symbolic name and version. This exception type will only occur if the framework is configured to only allow a single bundle to be installed for a given symbolic name and version.

Since:
1.5
See also:
Constants.FRAMEWORK_BSNVERSION
	public static final int	DUPLICATE_BUNDLE_ERROR	= 9;

The start transient operation failed because the start level of the bundle is greater than the current framework start level

Since:
1.5
	public static final int	START_TRANSIENT_ERROR	= 10;

The framework received an error while reading the input stream for a bundle.

Since:
1.6
	public static final int	READ_ERROR				= 11;

A framework hook rejected the operation.

Since:
1.6
	public static final int	REJECTED_BY_HOOK		= 12;

Creates a BundleException with the specified message and exception cause.

Parameters:
msg The associated message.
cause The cause of this exception.
	public BundleException(String msgThrowable cause) {
		this(msgcause);
	}

Creates a BundleException with the specified message.

Parameters:
msg The message.
	public BundleException(String msg) {
		this(msg);
	}

Creates a BundleException with the specified message, type and exception cause.

Parameters:
msg The associated message.
type The type for this exception.
cause The cause of this exception.
Since:
1.5
	public BundleException(String msgint typeThrowable cause) {
		super(msgcause);
		this. = type;
	}

Creates a BundleException with the specified message and type.

Parameters:
msg The message.
type The type for this exception.
Since:
1.5
	public BundleException(String msgint type) {
		super(msg);
		this. = type;
	}

Returns the cause of this exception or null if no cause was specified when this exception was created.

This method predates the general purpose exception chaining mechanism. The getCause() method is now the preferred means of obtaining this information.

Returns:
The result of calling getCause().
		return getCause();
	}

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.
Since:
1.3
	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.3
	public Throwable initCause(Throwable cause) {
		return super.initCause(cause);
	}

Returns the type for this exception or UNSPECIFIED if the type was unspecified or unknown.

Returns:
The type of this exception.
Since:
1.5
	public int getType() {
		return ;
	}
New to GrepCode? Check out our FAQ X