? ApplicationServiceEvent
java.lang.Object
java.util.EventObject
org.osgi.framework.ServiceEvent
org.osgi.application.ApplicationServiceEvent
- ????????:
Serializable
public class ApplicationServiceEvent
extends org.osgi.framework.ServiceEvent
An event from the Framework describing a service lifecycle change.
ApplicationServiceEvent
objects are delivered to a
ApplicationServiceListener
objects when a change occurs in this
service's lifecycle. The delivery of an ApplicationServiceEvent
is
always triggered by a ServiceEvent
.
ApplicationServiceEvent
extends the content of ServiceEvent
with the service object the event is referring to as applications has no
means to find the corresponding service object for a
ServiceReference
. A type code is used to identify
the event type for future extendability. The available type codes are defined
in ServiceEvent
.
OSGi Alliance reserves the right to extend the set of types.
- ????:
-
ServiceEvent
ApplicationServiceListener
- ?????
-
????
??????? org.osgi.framework.ServiceEvent
MODIFIED, MODIFIED_ENDMATCH, REGISTERED, UNREGISTERING
??????? java.util.EventObject
source
-
?????
????????ApplicationServiceEvent
(int type, org.osgi.framework.ServiceReference reference, Object serviceObject) Creates a new application service event object. -
????
??????????This method returns the service object of this service bound to the listener application instance.??????? org.osgi.framework.ServiceEvent
getServiceReference, getType
??????? java.util.EventObject
getSource, toString
-
???????
-
ApplicationServiceEvent
public ApplicationServiceEvent(int type, org.osgi.framework.ServiceReference reference, Object serviceObject) Creates a new application service event object.- ??:
type
- The event type. Available type codes are defines inServiceEvent
reference
- AServiceReference
object to the service that had a lifecycle change. This reference will be used as thesource
in theEventObject
base class, therefore, it must not be null.serviceObject
- The service object bound to this application instance. It can benull
if this application is not bound to this service yet.- ??:
IllegalArgumentException
- if the specifiedreference
is null.
-
-
??????
-
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.locateService
orlocateServices
methods. If the application is not bound to the service yet, this method returnsnull
.- ??:
- the service object bound to the listener application or
null
if it isn't bound to this service yet.
-