public class ServiceEvent extends java.util.EventObject
ServiceEvent objects are delivered to
AllServiceListeners 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.
|Modifier and Type||Field and Description|
The properties of a registered service have been modified.
The properties of a registered service have been modified and the new properties no longer match the listener's filter.
This service has been registered.
This service is in the process of being unregistered.
|Constructor and Description|
Creates a new service event object.
|Modifier and Type||Method and Description|
Returns a reference to the service that had a change occur in its lifecycle.
Returns the type of event.
public static final int REGISTERED
This event is synchronously delivered after the service has been registered with the Framework.
public static final int MODIFIED
This event is synchronously delivered after the service properties have been modified.
public static final int UNREGISTERING
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.
public static final int MODIFIED_ENDMATCH
This event is synchronously delivered after the service
properties have been modified. This event is only delivered to listeners
which were added with a non-
null filter where the filter matched
the service properties prior to the modification but the filter does not
match the modified service properties.
public ServiceEvent(int type, ServiceReference<?> reference)
type- The event type.
ServiceReferenceobject to the service that had a lifecycle change.
public ServiceReference<?> getServiceReference()
This reference is the source of the event.
Copyright © OSGi Alliance (2000, 2020). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0