public class BundleEvent
extends java.util.EventObject
BundleEvent
objects are delivered to
SynchronousBundleListener
s and BundleListener
s 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.
BundleListener
,
SynchronousBundleListener
,
Serialized FormModifier and Type | Field and Description |
---|---|
private Bundle |
bundle
Bundle that had a change occur in its lifecycle.
|
static int |
INSTALLED
The bundle has been installed.
|
static int |
LAZY_ACTIVATION
The bundle will be lazily activated.
|
private Bundle |
origin
Bundle that was the origin of the event.
|
static int |
RESOLVED
The bundle has been resolved.
|
(package private) static long |
serialVersionUID |
static int |
STARTED
The bundle has been started.
|
static int |
STARTING
The bundle is about to be activated.
|
static int |
STOPPED
The bundle has been stopped.
|
static int |
STOPPING
The bundle is about to deactivated.
|
private int |
type
Type of bundle lifecycle change.
|
static int |
UNINSTALLED
The bundle has been uninstalled.
|
static int |
UNRESOLVED
The bundle has been unresolved.
|
static int |
UPDATED
The bundle has been updated.
|
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
Bundle |
getBundle()
Returns the bundle which had a lifecycle change.
|
Bundle |
getOrigin()
Returns the bundle that was the origin of the event.
|
int |
getType()
Returns the type of lifecyle event.
|
static final long serialVersionUID
private final Bundle bundle
private final int type
public static final int INSTALLED
public static final int STARTED
The bundle's BundleActivator
start
method has been executed if the bundle has a bundle activator
class.
Bundle.start()
,
Constant Field Valuespublic static final int STOPPED
The bundle's BundleActivator
stop
method has been executed if the bundle has a bundle activator
class.
Bundle.stop()
,
Constant Field Valuespublic static final int UPDATED
Bundle.update()
,
Constant Field Valuespublic static final int UNINSTALLED
Bundle.uninstall()
,
Constant Field Valuespublic static final int RESOLVED
Bundle.RESOLVED
,
Constant Field Valuespublic static final int UNRESOLVED
Bundle.INSTALLED
,
Constant Field Valuespublic static final int STARTING
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 BundleListener
s.
Bundle.start()
,
Constant Field Valuespublic static final int STOPPING
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 BundleListener
s.
Bundle.stop()
,
Constant Field Valuespublic static final int LAZY_ACTIVATION
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 SynchronousBundleListener
s. It is not delivered to
BundleListener
s.
private final Bundle origin
public BundleEvent(int type, Bundle bundle, Bundle origin)
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
type INSTALLED
, this is the bundle whose context was used
to install the bundle. Otherwise it is the bundle itself.public BundleEvent(int type, Bundle bundle)
type
- The event type.bundle
- The bundle which had a lifecycle change. This bundle is
used as the origin of the event.public Bundle getBundle()
public int getType()