Skip navigation links

Oracle Communications Services Gatekeeper Java API Reference
5.0

E21717-02


com.bea.wlcp.wlng.api.event_channel
Interface EventChannel


public interface EventChannel

This EventChannel utility service can be used to generate and recieve events in WLNG cluster. Events can be of any Serializable type.


Method Summary
 void deactivateAllListeners()
           
 void publishEvent(String eventType, Serializable event, boolean block)
          Publish the event to all the nodes in the cluster.
 void publishEventToOneNode(String eventType, Serializable event, boolean block)
          Publish the event to one node.
 void registerEventListener(EventChannelListener listener, String eventType)
          Register a new listener to event channel.
 void unregisterEventListener(EventChannelListener listener)
          Unregisters an event listener.

 

Method Detail

deactivateAllListeners

public void deactivateAllListeners()

publishEvent

public void publishEvent(String eventType,
                         Serializable event,
                         boolean block)
Publish the event to all the nodes in the cluster. Note: The event channel service may not be ready to publish events before the server is running. An IllegalStateException will be thrown if events are published before the service is ready.
Parameters:
eventType - The event type string
event - The event in the form of a Serializable
block - If true, the caller will be blocked till the event is processed by all the listeners of this event type. If false, the event will be guaranteed to be delivered but the caller will not wait for the listeners to process the event.
Throws:
IllegalStateException - if publishing event before the service is ready.

publishEventToOneNode

public void publishEventToOneNode(String eventType,
                                  Serializable event,
                                  boolean block)
Publish the event to one node. Each time an event is published the service will choose a different node to receive the event. If the callee is unreachable then we will retry on another node. Note: The event channel service may not be ready to publish events before the server is running. An IllegalStateException will be thrown if events are published before the service is ready.
Parameters:
eventType - The event type string
event - The event in the form of a Serializable
block - If true, the caller will be blocked till the event is processed by all the listeners of this event type. If false, the event will be guaranteed to be delivered but the caller will not wait for the listeners to process the event.
Throws:
IllegalStateException - if publishing event before the service is ready.

registerEventListener

public void registerEventListener(EventChannelListener listener,
                                  String eventType)
Register a new listener to event channel. The listener will recieve all events of the supplied type.
Parameters:
listener - The listener.
eventType - The type of the event. Event type string are global within WLNG.

unregisterEventListener

public void unregisterEventListener(EventChannelListener listener)
Unregisters an event listener. It is the responsibility of the user to call this method when no longer interested in events.
Parameters:
listener - The listener.

Skip navigation links

Oracle Communications Services Gatekeeper Java API Reference
5.0

E21717-02


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