public class ServiceEvent extends EventObject
Service
,
ServiceListener
Modifier and Type | Field | Description |
---|---|---|
static int |
SERVICE_STARTED |
This event indicates that a service has started.
|
static int |
SERVICE_STARTING |
This event indicates that a service is starting.
|
static int |
SERVICE_STOPPED |
This event indicates that a service has stopped.
|
static int |
SERVICE_STOPPING |
This event indicates that a service is stopping.
|
source
Constructor | Description |
---|---|
ServiceEvent(Service service,
int nId) |
Constructs a new ServiceEvent.
|
Modifier and Type | Method | Description |
---|---|---|
void |
dispatch(EventListener[] aListeners) |
Dispatch this event to the specified array of listeners.
|
void |
dispatch(Listeners listeners) |
Dispatch this event to the specified listeners collection.
|
int |
getId() |
Return this event's ID.
|
Service |
getService() |
Return the Service that fired the event.
|
String |
toString() |
Returns a String representation of this ServiceEvent object.
|
getSource
public static final int SERVICE_STARTING
public static final int SERVICE_STARTED
public static final int SERVICE_STOPPING
public static final int SERVICE_STOPPED
public ServiceEvent(Service service, int nId)
service
- the Service that fired the eventnId
- this event's ID, one of the SERVICE_* enum valuespublic int getId()
public Service getService()
public String toString()
toString
in class EventObject
public void dispatch(Listeners listeners)
listeners
- the listeners collectionClassCastException
- if any of the targets is not
an instance of the ServiceListener interfacepublic void dispatch(EventListener[] aListeners)
aListeners
- the array of listenersClassCastException
- if any of the targets is not
an instance of ServiceListener interface