WebLogic Integration


com.bea.wlai.client
Class EventContext

java.lang.Object
  |
  +--com.bea.wlai.client.EventContext

public class EventContext
extends java.lang.Object
implements java.io.Serializable

A frame of reference for generating/receiving events. This class is used by ApplicationView to manage the event delivery mechanics in methods such as postEvent, addEventListener, etc.

Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
ApplicationView, Serialized Form

Constructor Summary
protected EventContext()
          Constructor for use by Java serialization framework.
  EventContext(java.lang.String sourceKey, java.lang.String sourceType, javax.naming.Context context, java.lang.String jmsTopicName)
          Get an EventContext object using the given JNDI context, and attached to the JMS topic given by jmsTopicName.
  EventContext(java.lang.String sourceKey, java.lang.String sourceType, javax.naming.Context context, javax.jms.Topic jmsTopic)
          Get an EventContext object using the given JNDI context, and attached to the given JMS topic.
  EventContext(java.lang.String sourceKey, java.lang.String sourceType, java.util.Hashtable env, java.lang.String jmsTopicName)
          Get an EventContext object using an initial JNDI context obtained using the properties set in env, and attached to the JMS topic given by jmsTopicName.
  EventContext(java.lang.String sourceKey, java.lang.String sourceType, java.util.Hashtable env, java.lang.String jmsTopicName, boolean connect)
          Get an EventContext object using an initial JNDI context obtained using the properties set in env, and attached to the JMS topic given by jmsTopicName.
 
Method Summary
 void addListener(java.lang.String eventTypeName, EventListener eventListener)
          Register a listener for all events of type eventTypeName.
 void addListener(java.lang.String eventTypeName, EventListener eventListener, java.lang.String subscriberName)
          Register a listener for all events of type eventTypeName.
protected  void checkClosed()
           
 void close()
          Close JMS resources.
 boolean containsListener(java.lang.String eventTypeName, EventListener listener)
          Has this EventContext already had EventListener given by listener register interest in events of type eventTypeName.
protected  void finalize()
          Cleans up this EventContext instance when the garbage collector determines this object is no longer needed.
 javax.naming.Context getContext()
          Get the JNDI context being used.
 javax.jms.Topic getJMSTopic()
          Get the JMS topic being used.
 java.lang.String getSourceKey()
           
 java.lang.String getSourceType()
           
protected  void initialize()
          Initialize JMS.
 void postEvent(java.lang.String eventType, IEvent event)
          Post an event with the given type and represented by the given event to this EventContext.
 void reinitialize()
          Reinitialize JMS resources using stored environment properties, and JMS topic name.
 boolean removeListener(java.lang.String eventTypeName, EventListener listener)
          Remove this listener from the list of listeners on events of type eventTypeName.
protected  void setContext(javax.naming.Context context)
          Set the JNDI context to use.
protected  void setJMSTopic(javax.jms.Topic topic)
          Set the JMS topic to use.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventContext

protected EventContext()
Constructor for use by Java serialization framework.

EventContext

public EventContext(java.lang.String sourceKey,
                    java.lang.String sourceType,
                    java.util.Hashtable env,
                    java.lang.String jmsTopicName)
             throws javax.naming.NamingException,
                    EventContextException
Get an EventContext object using an initial JNDI context obtained using the properties set in env, and attached to the JMS topic given by jmsTopicName.

EventContext

public EventContext(java.lang.String sourceKey,
                    java.lang.String sourceType,
                    java.util.Hashtable env,
                    java.lang.String jmsTopicName,
                    boolean connect)
             throws javax.naming.NamingException,
                    EventContextException
Get an EventContext object using an initial JNDI context obtained using the properties set in env, and attached to the JMS topic given by jmsTopicName. If connect is false, the actual initialization of the JMS layer is deferred.

EventContext

public EventContext(java.lang.String sourceKey,
                    java.lang.String sourceType,
                    javax.naming.Context context,
                    java.lang.String jmsTopicName)
             throws javax.naming.NamingException,
                    EventContextException
Get an EventContext object using the given JNDI context, and attached to the JMS topic given by jmsTopicName.

EventContext

public EventContext(java.lang.String sourceKey,
                    java.lang.String sourceType,
                    javax.naming.Context context,
                    javax.jms.Topic jmsTopic)
             throws javax.naming.NamingException,
                    EventContextException
Get an EventContext object using the given JNDI context, and attached to the given JMS topic.
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Cleans up this EventContext instance when the garbage collector determines this object is no longer needed.

Overrides:
finalize in class java.lang.Object

getSourceKey

public java.lang.String getSourceKey()


getSourceType

public java.lang.String getSourceType()


initialize

protected void initialize()
                   throws javax.naming.NamingException,
                          EventContextException
Initialize JMS.


close

public void close()
Close JMS resources.


checkClosed

protected void checkClosed()
                    throws EventContextException


postEvent

public void postEvent(java.lang.String eventType,
                      IEvent event)
               throws DocumentException,
                      EventContextException
Post an event with the given type and represented by the given event to this EventContext.


addListener

public void addListener(java.lang.String eventTypeName,
                        EventListener eventListener)
                 throws EventContextException
Register a listener for all events of type eventTypeName. Passing eventTypeName=null means you want to be notified about all event types.


addListener

public void addListener(java.lang.String eventTypeName,
                        EventListener eventListener,
                        java.lang.String subscriberName)
                 throws EventContextException
Register a listener for all events of type eventTypeName. Passing eventTypeName=null means you want to be notified about all event types. If subscriberName is specified, the Listener will utilize a Durable Subscriber. If subscriberName is null or empty, a non-Durable Subscriber will be used.

Parameters:
eventTypeName -  
eventListener -  
subscriberName - unique name for a durable subscriber
Throws:
EventContextException -  

containsListener

public boolean containsListener(java.lang.String eventTypeName,
                                EventListener listener)
Has this EventContext already had EventListener given by listener register interest in events of type eventTypeName.


removeListener

public boolean removeListener(java.lang.String eventTypeName,
                              EventListener listener)
Remove this listener from the list of listeners on events of type eventTypeName.


setJMSTopic

protected void setJMSTopic(javax.jms.Topic topic)
Set the JMS topic to use.


setContext

protected void setContext(javax.naming.Context context)
Set the JNDI context to use.


getContext

public javax.naming.Context getContext()
Get the JNDI context being used.


getJMSTopic

public javax.jms.Topic getJMSTopic()
Get the JMS topic being used.


reinitialize

public void reinitialize()
                  throws javax.naming.NamingException,
                         EventContextException
Reinitialize JMS resources using stored environment properties, and JMS topic name.


WebLogic Integration

WebLogic Integration (WLI)