org.osgi.framework

Class FrameworkEvent

public class FrameworkEvent extends EventObject

A general event from the Framework.

FrameworkEvent objects are delivered to FrameworkListeners when a general event occurs within the OSGi environment. A type code is used to identify the event type for future extendability.

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

Version: $Revision: 1.15 $

See Also: FrameworkListener

UNKNOWN:

Field Summary
static intERROR
An error has occurred.
static intINFO
An informational event has occurred.
static intPACKAGES_REFRESHED
A PackageAdmin.refreshPackage operation has completed.
static intSTARTED
The Framework has started.
static intSTARTLEVEL_CHANGED
A StartLevel.setStartLevel operation has completed.
static intWARNING
A warning has occurred.
Constructor Summary
FrameworkEvent(int type, Object source)
Creates a Framework event.
FrameworkEvent(int type, Bundle bundle, Throwable throwable)
Creates a Framework event regarding the specified bundle.
Method Summary
BundlegetBundle()
Returns the bundle associated with the event.
ThrowablegetThrowable()
Returns the exception related to this event.
intgetType()
Returns the type of framework event.

Field Detail

ERROR

public static final int ERROR
An error has occurred.

There was an error associated with a bundle.

The value of ERROR is 0x00000002.

INFO

public static final int INFO
An informational event has occurred.

There was an informational event associated with a bundle.

The value of INFO is 0x00000020.

Since: 1.3

PACKAGES_REFRESHED

public static final int PACKAGES_REFRESHED
A PackageAdmin.refreshPackage operation has completed.

This event is fired when the Framework has completed the refresh packages operation initiated by a call to the PackageAdmin.refreshPackages method.

The value of PACKAGES_REFRESHED is 0x00000004.

Since: 1.2

See Also: "PackageAdmin.refreshPackages"

STARTED

public static final int STARTED
The Framework has started.

This event is fired when the Framework has started after all installed bundles that are marked to be started have been started and the Framework has reached the intitial start level.

The value of STARTED is 0x00000001.

See Also: "StartLevel"

STARTLEVEL_CHANGED

public static final int STARTLEVEL_CHANGED
A StartLevel.setStartLevel operation has completed.

This event is fired when the Framework has completed changing the active start level initiated by a call to the StartLevel.setStartLevel method.

The value of STARTLEVEL_CHANGED is 0x00000008.

Since: 1.2

See Also: "StartLevel"

WARNING

public static final int WARNING
A warning has occurred.

There was a warning associated with a bundle.

The value of WARNING is 0x00000010.

Since: 1.3

Constructor Detail

FrameworkEvent

public FrameworkEvent(int type, Object source)

Deprecated: As of 1.2. This constructor is deprecated in favor of using the other constructor with the System Bundle as the event source.

Creates a Framework event.

Parameters: type The event type. source The event source object. This may not be null.

FrameworkEvent

public FrameworkEvent(int type, Bundle bundle, Throwable throwable)
Creates a Framework event regarding the specified bundle.

Parameters: type The event type. bundle The event source. throwable The related exception. This argument may be null if there is no related exception.

Method Detail

getBundle

public Bundle getBundle()
Returns the bundle associated with the event. This bundle is also the source of the event.

Returns: The bundle associated with the event.

getThrowable

public Throwable getThrowable()
Returns the exception related to this event.

Returns: The related exception or null if none.

getType

public int getType()
Returns the type of framework event.

The type values are:

Returns: The type of state change.