Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


com.tangosol.util
Class ServiceEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.tangosol.util.ServiceEvent

All Implemented Interfaces:
java.io.Serializable

public class ServiceEvent
extends java.util.EventObject

An event which indicates that a Service state has changed:

A ServiceEvent object is sent as an argument to the ServiceListener interface methods.

Author:
jh 2007.11.12
See Also:
Service, ServiceListener

Field Summary
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.

 

Fields inherited from class java.util.EventObject
source

 

Constructor Summary
ServiceEvent(Service service, int nId)
          Constructs a new ServiceEvent.

 

Method Summary
 void dispatch(java.util.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.
 java.lang.String toString()
          Returns a String representation of this ServiceEvent object.

 

Methods inherited from class java.util.EventObject
getSource

 

Field Detail

SERVICE_STARTING

public static final int SERVICE_STARTING
This event indicates that a service is starting.
See Also:
Constant Field Values

SERVICE_STARTED

public static final int SERVICE_STARTED
This event indicates that a service has started.
See Also:
Constant Field Values

SERVICE_STOPPING

public static final int SERVICE_STOPPING
This event indicates that a service is stopping.
See Also:
Constant Field Values

SERVICE_STOPPED

public static final int SERVICE_STOPPED
This event indicates that a service has stopped.
See Also:
Constant Field Values

Constructor Detail

ServiceEvent

public ServiceEvent(Service service,
                    int nId)
Constructs a new ServiceEvent.
Parameters:
service - the Service that fired the event
nId - this event's ID, one of the SERVICE_* enum values

Method Detail

getId

public int getId()
Return this event's ID.
Returns:
the event ID, one of the SERVICE_* enum values

getService

public Service getService()
Return the Service that fired the event.
Returns:
the Service

toString

public java.lang.String toString()
Returns a String representation of this ServiceEvent object.
Overrides:
toString in class java.util.EventObject
Returns:
a String representation of this ServiceEvent object

dispatch

public void dispatch(Listeners listeners)
Dispatch this event to the specified listeners collection.
Parameters:
listeners - the listeners collection
Throws:
java.lang.ClassCastException - if any of the targets is not an instance of the ServiceListener interface

dispatch

public void dispatch(java.util.EventListener[] aListeners)
Dispatch this event to the specified array of listeners.
Parameters:
aListeners - the array of listeners
Throws:
java.lang.ClassCastException - if any of the targets is not an instance of ServiceListener interface

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.