public class ApplicationServiceEvent extends ServiceEvent
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.
MODIFIED, MODIFIED_ENDMATCH, REGISTERED, UNREGISTERING
source
Constructor and Description |
---|
ApplicationServiceEvent(int type,
ServiceReference reference,
Object serviceObject)
Creates a new application service event object.
|
Modifier and Type | Method and Description |
---|---|
Object |
getServiceObject()
This method returns the service object of this service bound to the
listener application instance.
|
getServiceReference, getType
getSource, toString
public ApplicationServiceEvent(int type, ServiceReference reference, Object serviceObject)
type
- The event type. Available type codes are defines in
ServiceEvent
reference
- A ServiceReference
object to the service that
had a lifecycle change. This reference will be used as the
source
in the EventObject
base class,
therefore, it must not be null.serviceObject
- The service object bound to this application
instance. It can be null
if this application is not bound
to this service yet.IllegalArgumentException
- if the specified reference
is
null.public Object getServiceObject()
ApplicationContext.locateService
or
locateServices
methods. If the application is not bound to the
service yet, this method returns null
.null
if it isn't bound to this service yet.Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0