Skip navigation links

Oracle Communications Services Gatekeeper Java API Reference
6.0

E55513-02


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


public interface EventChannel

Utility service used to generate and receive events in a 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 on the event channel.
 void unregisterEventListener(EventChannelListener listener)
          Unregister 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 until 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 on the event channel. The listener will receive all events of the requested type.
Parameters:
listener - The listener.
eventType - The type of the event. Event type string are global within WLNG.

unregisterEventListener

public void unregisterEventListener(EventChannelListener listener)
Unregister an event listener. It is the responsibility of a 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
6.0

E55513-02


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