org.osgi.framework

Class BundleEvent

public class BundleEvent extends EventObject

An event from the Framework describing a bundle lifecycle change.

BundleEvent objects are delivered to SynchronousBundleListeners and BundleListeners when a change occurs in a bundle's lifecycle. A type code is used to identify the event type for future extendability.

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

Version: $Revision: 1.19 $

See Also: BundleListener SynchronousBundleListener

UNKNOWN:

Field Summary
static intINSTALLED
The bundle has been installed.
static intLAZY_ACTIVATION
The bundle will be lazily activated.
static intRESOLVED
The bundle has been resolved.
static intSTARTED
The bundle has been started.
static intSTARTING
The bundle is about to be activated.
static intSTOPPED
The bundle has been stopped.
static intSTOPPING
The bundle is about to deactivated.
static intUNINSTALLED
The bundle has been uninstalled.
static intUNRESOLVED
The bundle has been unresolved.
static intUPDATED
The bundle has been updated.
Constructor Summary
BundleEvent(int type, Bundle bundle)
Creates a bundle event of the specified type.
Method Summary
BundlegetBundle()
Returns the bundle which had a lifecycle change.
intgetType()
Returns the type of lifecyle event.

Field Detail

INSTALLED

public static final int INSTALLED
The bundle has been installed.

The value of INSTALLED is 0x00000001.

See Also: installBundle

LAZY_ACTIVATION

public static final int LAZY_ACTIVATION
The bundle will be lazily activated.

The bundle has a lazy activation policy and is waiting to be activated. It is now in the STARTING state and has a valid BundleContext. This event is only delivered to SynchronousBundleListeners. It is not delivered to BundleListeners.

The value of LAZY_ACTIVATION is 0x00000200.

Since: 1.4

RESOLVED

public static final int RESOLVED
The bundle has been resolved.

The value of RESOLVED is 0x00000020.

Since: 1.3

See Also: RESOLVED

STARTED

public static final int STARTED
The bundle has been started.

The bundle's BundleActivator start method has been executed if the bundle has a bundle activator class.

The value of STARTED is 0x00000002.

See Also: start

STARTING

public static final int STARTING
The bundle is about to be activated.

The bundle's BundleActivator start method is about to be called if the bundle has a bundle activator class. This event is only delivered to SynchronousBundleListeners. It is not delivered to BundleListeners.

The value of STARTING is 0x00000080.

Since: 1.3

See Also: start

STOPPED

public static final int STOPPED
The bundle has been stopped.

The bundle's BundleActivator stop method has been executed if the bundle has a bundle activator class.

The value of STOPPED is 0x00000004.

See Also: stop

STOPPING

public static final int STOPPING
The bundle is about to deactivated.

The bundle's BundleActivator stop method is about to be called if the bundle has a bundle activator class. This event is only delivered to SynchronousBundleListeners. It is not delivered to BundleListeners.

The value of STOPPING is 0x00000100.

Since: 1.3

See Also: stop

UNINSTALLED

public static final int UNINSTALLED
The bundle has been uninstalled.

The value of UNINSTALLED is 0x00000010.

See Also: Bundle

UNRESOLVED

public static final int UNRESOLVED
The bundle has been unresolved.

The value of UNRESOLVED is 0x00000040.

Since: 1.3

See Also: INSTALLED

UPDATED

public static final int UPDATED
The bundle has been updated.

The value of UPDATED is 0x00000008.

See Also: update

Constructor Detail

BundleEvent

public BundleEvent(int type, Bundle bundle)
Creates a bundle event of the specified type.

Parameters: type The event type. bundle The bundle which had a lifecycle change.

Method Detail

getBundle

public Bundle getBundle()
Returns the bundle which had a lifecycle change. This bundle is the source of the event.

Returns: The bundle that had a change occur in its lifecycle.

getType

public int getType()
Returns the type of lifecyle event. The type values are:

Returns: The type of lifecycle event.