类 ServiceEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.osgi.framework.ServiceEvent
-
- 所有已实现的接口:
java.io.Serializable
public class ServiceEvent extends java.util.EventObjectAn event from the Framework describing a service lifecycle change.ServiceEventobjects are delivered toServiceListeners andAllServiceListeners 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.
- 作者:
- $Id: b27a941cb68e6416825b1b717090a2eb098733f3 $
- 另请参阅:
ServiceListener,AllServiceListener, 序列化表格
-
-
字段概要
字段 修饰符和类型 字段 说明 static intMODIFIEDThe properties of a registered service have been modified.static intMODIFIED_ENDMATCHThe properties of a registered service have been modified and the new properties no longer match the listener's filter.static intREGISTEREDThis service has been registered.static intUNREGISTERINGThis service is in the process of being unregistered.
-
构造器概要
构造器 构造器 说明 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.intgetType()Returns the type of event.
-
-
-
字段详细资料
-
REGISTERED
public static final int REGISTERED
This service has been registered.This event is synchronously delivered after the service has been registered with the Framework.
-
MODIFIED
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.
-
UNREGISTERING
public static final int UNREGISTERING
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.
-
MODIFIED_ENDMATCH
public static final int MODIFIED_ENDMATCH
The properties of a registered service have been modified and the new properties no longer match the listener's filter.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-
nullfilter where the filter matched the service properties prior to the modification but the filter does not match the modified service properties.- 从以下版本开始:
- 1.5
- 另请参阅:
ServiceRegistration.setProperties(Dictionary), 常量字段值
-
-
构造器详细资料
-
ServiceEvent
public ServiceEvent(int type, ServiceReference<?> reference)Creates a new service event object.- 参数:
type- The event type.reference- AServiceReferenceobject to the service that had a lifecycle change.
-
-
方法详细资料
-
getServiceReference
public ServiceReference<?> getServiceReference()
Returns a reference to the service that had a change occur in its lifecycle.This reference is the source of the event.
- 返回:
- Reference to the service that had a lifecycle change.
-
getType
public int getType()
Returns the type of event. The event type values are:- 返回:
- Type of service lifecycle change.
-
-