org.osgi.framework.ServiceEvent Class Reference

List of all members.


Detailed Description

An event from the Framework describing a service lifecycle change.

ServiceEvent objects are delivered to a ServiceListener objects when a change occurs in this service'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.

Version:
Revision
1.14
See also:
ServiceListener

Definition at line 38 of file ServiceEvent.java.


Public Member Functions

 ServiceEvent (int type, ServiceReference reference)
 Creates a new service event object.
ServiceReference getServiceReference ()
 Returns a reference to the service that had a change occur in its lifecycle.
int getType ()
 Returns the type of event.

Static Public Attributes

static final int REGISTERED = 0x00000001
 This service has been registered.
static final int MODIFIED = 0x00000002
 The properties of a registered service have been modified.
static final int UNREGISTERING = 0x00000004
 This service is in the process of being unregistered.

Constructor & Destructor Documentation

org.osgi.framework.ServiceEvent.ServiceEvent ( int  type,
ServiceReference  reference 
)

Creates a new service event object.

Parameters:
type The event type.
reference A ServiceReference object to the service that had a lifecycle change.

Definition at line 104 of file ServiceEvent.java.


Member Function Documentation

ServiceReference org.osgi.framework.ServiceEvent.getServiceReference (  ) 

Returns a reference to the service that had a change occur in its lifecycle.

This reference is the source of the event.

Returns:
Reference to the service that had a lifecycle change.

Definition at line 118 of file ServiceEvent.java.

Referenced by org.knopflerfish.framework.Listeners.serviceChanged(), and org.openmobileis.bundle.osgi.synchro.BaseBundleLoaderActivator.start().

int org.osgi.framework.ServiceEvent.getType (  ) 

Returns the type of event.

The event type values are:

Returns:
Type of service lifecycle change.

Definition at line 133 of file ServiceEvent.java.

Referenced by org.osgi.util.tracker.ServiceTracker.Tracked.serviceChanged(), and org.openmobileis.bundle.osgi.synchro.BaseBundleLoaderActivator.start().


Member Data Documentation

final int org.osgi.framework.ServiceEvent.REGISTERED = 0x00000001 [static]

This service has been registered.

This event is synchronously delivered after the service has been registered with the Framework.

The value of REGISTERED is 0x00000001.

See also:
BundleContext.registerService(String[],Object,java.util.Dictionary)

Definition at line 61 of file ServiceEvent.java.

final int org.osgi.framework.ServiceEvent.MODIFIED = 0x00000002 [static]

The properties of a registered service have been modified.

This event is synchronously delivered after the service properties have been modified.

The value of MODIFIED is 0x00000002.

See also:
ServiceRegistration.setProperties

Definition at line 74 of file ServiceEvent.java.

final int org.osgi.framework.ServiceEvent.UNREGISTERING = 0x00000004 [static]

This service is in the process of being unregistered.

This event is synchronously delivered before the service has completed unregistering.

If a bundle is using a service that is UNREGISTERING, the bundle should release its use of the service when it receives this event. If the bundle does not release its use of the service when it receives this event, the Framework will automatically release the bundle's use of the service while completing the service unregistration operation.

The value of UNREGISTERING is 0x00000004.

See also:
ServiceRegistration.unregister

BundleContext.ungetService

Definition at line 95 of file ServiceEvent.java.


The documentation for this class was generated from the following file:
Generated on Mon Jan 11 21:19:24 2010 for OpenMobileIS by  doxygen 1.5.4