OSGi™ Service Platform
Release 4

org.osgi.framework
Class BundleEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byorg.osgi.framework.BundleEvent
All Implemented Interfaces:
java.io.Serializable

public class BundleEvent
extends java.util.EventObject

An event from the Framework describing a bundle lifecycle change.

BundleEvent objects are delivered to BundleListener objects 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:
Serialized Form

Field Summary
static int INSTALLED
          The bundle has been installed.
static int RESOLVED
          The bundle has been resolved.
static int STARTED
          The bundle has been started.
static int STARTING
          The bundle is about to start.
static int STOPPED
          The bundle has been stopped.
static int STOPPING
          The bundle is about to stop.
static int UNINSTALLED
          The bundle has been uninstalled.
static int UNRESOLVED
          The bundle has been unresolved.
static int UPDATED
          The bundle has been updated.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
BundleEvent(int type, Bundle bundle)
          Creates a bundle event of the specified type.
 
Method Summary
 Bundle getBundle()
          Returns the bundle which had a lifecycle change.
 int getType()
          Returns the type of lifecyle event.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTALLED

public static final int INSTALLED
The bundle has been installed.

The value of INSTALLED is 0x00000001.

See Also:
BundleContext.installBundle(String), Constant Field Values

STARTED

public static final int STARTED
The bundle has been started.

The value of STARTED is 0x00000002.

See Also:
Bundle.start(), Constant Field Values

STOPPED

public static final int STOPPED
The bundle has been stopped.

The value of STOPPED is 0x00000004.

See Also:
Bundle.stop(), Constant Field Values

UPDATED

public static final int UPDATED
The bundle has been updated.

The value of UPDATED is 0x00000008.

See Also:
Bundle.update(), Constant Field Values

UNINSTALLED

public static final int UNINSTALLED
The bundle has been uninstalled.

The value of UNINSTALLED is 0x00000010.

See Also:
Bundle.uninstall(), Constant Field Values

RESOLVED

public static final int RESOLVED
The bundle has been resolved.

The value of RESOLVED is 0x00000020.

Since:
1.3
See Also:
Bundle.RESOLVED, Constant Field Values

UNRESOLVED

public static final int UNRESOLVED
The bundle has been unresolved.

The value of UNRESOLVED is 0x00000040.

Since:
1.3
See Also:
Bundle.INSTALLED, Constant Field Values

STARTING

public static final int STARTING
The bundle is about to start.

The value of STARTING is 0x00000080.

Since:
1.3
See Also:
Bundle.start(), Constant Field Values

STOPPING

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

The value of STOPPING is 0x00000100.

Since:
1.3
See Also:
Bundle.stop(), Constant Field Values
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.

OSGi™ Service Platform
Release 4

Copyright © OSGi Alliance (2000, 2006). All Rights Reserved. Licensed under the OSGi Specification License, Version 1.0