public class ServiceEvent extends java.util.EventObject
java.lang.Object
|
+--java.util.EventObject
|
+--org.osgi.framework.ServiceEvent
All Implemented Interfaces: java.io.Serializable
Service life cycle change event. ServiceEvents are delivered to ServiceListeners when a change occurs in the service's life cycle. A type code is used to identify the event for future extendability.
OSGi reserves the right to extend the set of types in the future.
Member Summary | |
---|---|
Fields | |
public static final | MODIFIED |
The properties of a registered service have been modified. | |
public static final | REGISTERED |
A service has been registered. | |
public static final | UNREGISTERING |
A service is in the process of being unregistered. | |
Constructors | |
public | ServiceEvent(int, ServiceReference) |
Construct a service event. | |
Methods | |
public ServiceReference | getServiceReference() |
Retrieve a reference to the service who had a change occur in its life cycle. | |
public int | getType() |
Retrieve the type of this event. |
public static final int MODIFIED
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.
public static final int REGISTERED
A service has been registered. This event is synchronously delivered AFTER the service has been registered.
The value of REGISTERED is 0x00000001.
See Also: BundleContext.registerService(String[], Object, Dictionary)
public static final int UNREGISTERING
A 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 unregistering the service.
The value of UNREGISTERING is 0x00000004.
See Also: ServiceRegistration.unregister(), BundleContext.ungetService(ServiceReference)
public ServiceEvent(int type, ServiceReference reference)
Construct a service event.
Parameters:
reference— A ServiceReference to the service who had a change occur in its life cycle.
public ServiceReference getServiceReference()
Retrieve a reference to the service who had a change occur in its life cycle. This reference is the source of the event.
Returns: A reference to the service who had a change occur in its life cycle.
public int getType()
Retrieve the type of this event. The type values are REGISTERED, MODIFIED, UNREGISTERING.
18.191.176.194