Class BundleEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.osgi.framework.BundleEvent
-
- All Implemented Interfaces:
java.io.Serializable
public class BundleEvent extends java.util.EventObjectAn event from the Framework describing a bundle lifecycle change.BundleEventobjects are delivered toSynchronousBundleListeners andBundleListeners 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.
- See Also:
BundleListener,SynchronousBundleListener, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intINSTALLEDThe bundle has been installed.static intLAZY_ACTIVATIONThe bundle will be lazily activated.static intRESOLVEDThe bundle has been resolved.static intSTARTEDThe bundle has been started.static intSTARTINGThe bundle is about to be activated.static intSTOPPEDThe bundle has been stopped.static intSTOPPINGThe bundle is about to deactivated.static intUNINSTALLEDThe bundle has been uninstalled.static intUNRESOLVEDThe bundle has been unresolved.static intUPDATEDThe bundle has been updated.
-
Constructor Summary
Constructors Constructor Description BundleEvent(int type, Bundle bundle)Creates a bundle event of the specified type.BundleEvent(int type, Bundle bundle, Bundle origin)Creates a bundle event of the specified type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BundlegetBundle()Returns the bundle which had a lifecycle change.BundlegetOrigin()Returns the bundle that was the origin of the event.intgetType()Returns the type of lifecyle event.
-
-
-
Field Detail
-
INSTALLED
public static final int INSTALLED
The bundle has been installed.
-
STARTED
public static final int STARTED
The bundle has been started.The bundle's
BundleActivator startmethod has been executed if the bundle has a bundle activator class.- See Also:
Bundle.start(), Constant Field Values
-
STOPPED
public static final int STOPPED
The bundle has been stopped.The bundle's
BundleActivator stopmethod has been executed if the bundle has a bundle activator class.- See Also:
Bundle.stop(), Constant Field Values
-
UPDATED
public static final int UPDATED
The bundle has been updated.- See Also:
Bundle.update(), Constant Field Values
-
UNINSTALLED
public static final int UNINSTALLED
The bundle has been uninstalled.- See Also:
Bundle.uninstall(), Constant Field Values
-
RESOLVED
public static final int RESOLVED
The bundle has been resolved.- Since:
- 1.3
- See Also:
Bundle.RESOLVED, Constant Field Values
-
UNRESOLVED
public static final int UNRESOLVED
The bundle has been unresolved.- Since:
- 1.3
- See Also:
Bundle.INSTALLED, Constant Field Values
-
STARTING
public static final int STARTING
The bundle is about to be activated.The bundle's
BundleActivator startmethod is about to be called if the bundle has a bundle activator class. This event is only delivered toSynchronousBundleListeners. It is not delivered toBundleListeners.- Since:
- 1.3
- See Also:
Bundle.start(), Constant Field Values
-
STOPPING
public static final int STOPPING
The bundle is about to deactivated.The bundle's
BundleActivator stopmethod is about to be called if the bundle has a bundle activator class. This event is only delivered toSynchronousBundleListeners. It is not delivered toBundleListeners.- Since:
- 1.3
- See Also:
Bundle.stop(), Constant Field Values
-
LAZY_ACTIVATION
public static final int LAZY_ACTIVATION
The bundle will be lazily activated.The bundle has a
lazy activation policyand is waiting to be activated. It is now in theSTARTINGstate and has a validBundleContext. This event is only delivered toSynchronousBundleListeners. It is not delivered toBundleListeners.- Since:
- 1.4
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BundleEvent
public BundleEvent(int type, Bundle bundle, Bundle origin)Creates a bundle event of the specified type.- Parameters:
type- The event type.bundle- The bundle which had a lifecycle change.origin- The bundle which is the origin of the event. For the event typeINSTALLED, this is the bundle whose context was used to install the bundle. Otherwise it is the bundle itself.- Since:
- 1.6
-
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. This bundle is used as the origin of the event.
-
-
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.
-
-