Package org.osgi.application
Class ApplicationServiceEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.osgi.framework.ServiceEvent
-
- org.osgi.application.ApplicationServiceEvent
-
- All Implemented Interfaces:
java.io.Serializable
public class ApplicationServiceEvent extends org.osgi.framework.ServiceEventAn event from the Framework describing a service lifecycle change.ApplicationServiceEventobjects are delivered to aApplicationServiceListenerobjects when a change occurs in this service's lifecycle. The delivery of anApplicationServiceEventis always triggered by aServiceEvent.ApplicationServiceEventextends the content ofServiceEventwith the service object the event is referring to as applications has no means to find the corresponding service object for aServiceReference. A type code is used to identify the event type for future extendability. The available type codes are defined inServiceEvent.OSGi Alliance reserves the right to extend the set of types.
- See Also:
ServiceEvent,ApplicationServiceListener, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ApplicationServiceEvent(int type, org.osgi.framework.ServiceReference reference, java.lang.Object serviceObject)Creates a new application service event object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetServiceObject()This method returns the service object of this service bound to the listener application instance.
-
-
-
Constructor Detail
-
ApplicationServiceEvent
public ApplicationServiceEvent(int type, org.osgi.framework.ServiceReference reference, java.lang.Object serviceObject)Creates a new application service event object.- Parameters:
type- The event type. Available type codes are defines inServiceEventreference- AServiceReferenceobject to the service that had a lifecycle change. This reference will be used as thesourcein theEventObjectbase class, therefore, it must not be null.serviceObject- The service object bound to this application instance. It can benullif this application is not bound to this service yet.- Throws:
java.lang.IllegalArgumentException- if the specifiedreferenceis null.
-
-
Method Detail
-
getServiceObject
public java.lang.Object getServiceObject()
This method returns the service object of this service bound to the listener application instance. A service object becomes bound to the application when it first obtains a service object reference to that service by calling theApplicationContext.locateServiceorlocateServicesmethods. If the application is not bound to the service yet, this method returnsnull.- Returns:
- the service object bound to the listener application or
nullif it isn't bound to this service yet.
-
-