Top Description Fields Constructors Methods
org.osgi.framework

public Class BundleEvent

extends EventObject
Class Inheritance
Imports
java.util.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.

Author
$Id: cd49848213816c4f76541b70be12ac3af7900972 $
See Also
BundleListener, SynchronousBundleListener

Field Summary

Modifier and TypeField and Description
private final Bundle
bundle

Bundle that had a change occur in its lifecycle.

public static final int
INSTALLED

The bundle has been installed.

public static final int
LAZY_ACTIVATION

The bundle will be lazily activated.

private final Bundle
origin

Bundle that was the origin of the event.

public static final int
RESOLVED

The bundle has been resolved.

pack-priv static final long
public static final int
STARTED

The bundle has been started.

public static final int
STARTING

The bundle is about to be activated.

public static final int
STOPPED

The bundle has been stopped.

public static final int
STOPPING

The bundle is about to deactivated.

private final int
type

Type of bundle lifecycle change.

public static final int
UNINSTALLED

The bundle has been uninstalled.

public static final int
UNRESOLVED

The bundle has been unresolved.

public static final int
UPDATED

The bundle has been updated.

Inherited from java.util.EventObject:
source

Constructor Summary

AccessConstructor and Description
public
BundleEvent(int
The event type.
type
,
Bundle
The bundle which had a lifecycle change.
bundle
,
Bundle
The bundle which is the origin of the event. For the event type INSTALLED, this is the bundle whose context was used to install the bundle. Otherwise it is the bundle itself.
origin
)

Creates a bundle event of the specified type.

public
BundleEvent(int
The event type.
type
,
Bundle
The bundle which had a lifecycle change. This bundle is used as the origin of the event.
bundle
)

Creates a bundle event of the specified type.

Method Summary

Modifier and TypeMethod and Description
public Bundle

Returns:

The bundle that had a change occur in its lifecycle.
getBundle
()

Returns the bundle which had a lifecycle change.

public Bundle

Returns:

The bundle that was the origin of the event.
getOrigin
()

Returns the bundle that was the origin of the event.

public int

Returns:

The type of lifecycle event.
getType
()

Returns the type of lifecyle event.

Inherited from java.util.EventObject:
getSourcetoString

Field Detail

bundleback to summary
private final Bundle bundle

Bundle that had a change occur in its lifecycle.

INSTALLEDback to summary
public static final int INSTALLED

The bundle has been installed.

See Also
BundleContext#installBundle(String)
LAZY_ACTIVATIONback to summary
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.

Since
1.4
originback to summary
private final Bundle origin

Bundle that was the origin of the event. For install event type, this is the bundle whose context was used to install the bundle. Otherwise it is the bundle itself.

Since
1.6
RESOLVEDback to summary
public static final int RESOLVED

The bundle has been resolved.

Since
1.3
See Also
Bundle#RESOLVED
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides java.util.EventObject.serialVersionUID.

STARTEDback to summary
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.

See Also
Bundle#start()
STARTINGback to summary
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 SynchronousBundleListener s. It is not delivered to BundleListeners.

Since
1.3
See Also
Bundle#start()
STOPPEDback to summary
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.

See Also
Bundle#stop()
STOPPINGback to summary
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 SynchronousBundleListener s. It is not delivered to BundleListeners.

Since
1.3
See Also
Bundle#stop()
typeback to summary
private final int type

Type of bundle lifecycle change.

UNINSTALLEDback to summary
public static final int UNINSTALLED

The bundle has been uninstalled.

See Also
Bundle#uninstall()
UNRESOLVEDback to summary
public static final int UNRESOLVED

The bundle has been unresolved.

Since
1.3
See Also
Bundle#INSTALLED
UPDATEDback to summary
public static final int UPDATED

The bundle has been updated.

See Also
Bundle#update()

Constructor Detail

BundleEventback to summary
public BundleEvent(int type, Bundle bundle, Bundle origin)

Creates a bundle event of the specified type.

Parameters
type:int

The event type.

bundle:Bundle

The bundle which had a lifecycle change.

origin:Bundle

The bundle which is the origin of the event. For the event type INSTALLED, this is the bundle whose context was used to install the bundle. Otherwise it is the bundle itself.

Since
1.6
BundleEventback to summary
public BundleEvent(int type, Bundle bundle)

Creates a bundle event of the specified type.

Parameters
type:int

The event type.

bundle:Bundle

The bundle which had a lifecycle change. This bundle is used as the origin of the event.

Method Detail

getBundleback to summary
public Bundle getBundle()

Returns the bundle which had a lifecycle change. This bundle is the source of the event.

Returns:Bundle

The bundle that had a change occur in its lifecycle.

getOriginback to summary
public Bundle getOrigin()

Returns the bundle that was the origin of the event.

For the event type INSTALLED, this is the bundle whose context was used to install the bundle. Otherwise it is the bundle itself.

Returns:Bundle

The bundle that was the origin of the event.

Since
1.6
getTypeback to summary
public int getType()

Returns the type of lifecyle event. The type values are:

Returns:int

The type of lifecycle event.