|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.wlai.client.EventContext
public class EventContext
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.
ApplicationView
,
Serialized FormField Summary | |
---|---|
static int |
JMS_QUEUE
|
static int |
JMS_TOPIC
|
Constructor Summary | |
---|---|
EventContext(String sourceKey,
String sourceType,
Context context,
String jmsDestName,
int jmsDestType,
String jmsConnectionFactoryJNDIName)
Get an EventContext object using the given JNDI context. |
|
EventContext(String sourceKey,
String sourceType,
Context context,
String jmsDestName,
int jmsDestType,
String jmsConnectionFactoryJNDIName,
boolean bTransaction)
Get an EventContext object using the given JNDI context. |
|
EventContext(String sourceKey,
String sourceType,
Hashtable jndiEnv,
String jmsDestName,
int jmsDestType,
String jmsConnectionFactoryJNDIName)
Get an EventContext object using the given JNDI context. |
|
EventContext(String durableClientID,
String sourceKey,
String sourceType,
Context context,
String jmsDestName,
String jmsConnectionFactoryJNDIName)
Get an EventContext object using the given JNDI context. |
|
EventContext(String durableClientID,
String sourceKey,
String sourceType,
Hashtable jndiEnv,
String jmsDestName,
String jmsConnectionFactoryJNDIName)
Get an EventContext object using the given JNDI context. |
|
EventContext(Subject authUser,
String sourceKey,
String sourceType,
Context context,
String jmsDestName,
int jmsDestType,
String jmsConnectionFactoryJNDIName)
constructor for internal use |
Method Summary | |
---|---|
void |
addListener(String eventTypeName,
EventListener eventListener)
Register a listener for all events of type eventTypeName. |
void |
addListener(String eventTypeName,
EventListener eventListener,
String subscriberName)
Register a listener for all events of type eventTypeName. |
void |
close()
Close JMS resources. |
boolean |
containsListener(String eventTypeName,
EventListener listener)
Has this EventContext already had EventListener given by listener register interest in events of type eventTypeName. |
boolean |
equals(Object obj)
|
Context |
getContext()
Get the JNDI context being used. |
IEventDefinition |
getEventDefinition(String eventType)
Get IEventDefinition for the given event type. |
javax.jms.Queue |
getJMSQueue()
Deprecated. This method is no longer used due to internal refactoring. |
javax.jms.Topic |
getJMSTopic()
Deprecated. This method is no longer used due to internal refactoring. |
boolean |
getNamespaceEnforcementEnabled()
Get an indication of whether namespace enforcement is enabled (true) or disabled (false). |
String |
getSourceKey()
|
String |
getSourceType()
|
void |
postEvent(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(String eventTypeName,
EventListener listener)
Remove this listener from the list of listeners on events of type eventTypeName. |
void |
setNamespaceEnforcementEnabled(ApplicationView appView,
boolean newValue)
Enable/disable namespace enforcement for events coming from this context. |
String |
toString()
|
static void |
validateDurableClientID(String strDurableClientID)
Convenience method for validating if the argument is a valid durable client ID for an EventContext. |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int JMS_TOPIC
public static final int JMS_QUEUE
Constructor Detail |
---|
public EventContext(String sourceKey, String sourceType, Hashtable jndiEnv, String jmsDestName, int jmsDestType, String jmsConnectionFactoryJNDIName) throws NamingException, EventContextException
sourceKey
- - identifies the source of the events; cannot be nullsourceType
- - identifies the type of source; e.g. ApplicationView;
cannot be nulljndiEnv
- - contains properties needed to establish an initial JNDI
context to a J2EE application server.jmsDestName
- - the JNDI context for the JMS destination for eventsjmsConnectionFactoryJNDIName
- - The JNDI context for the JMS
connection factory that will be used to obtain Queue/Topic
connections.jmsDestType
- - destination type: JMS_TOPIC or JMS_QUEUE
NamingException
- if an error occurs trying to connect to the J2EE
application server using the supplied JNDI properties.
EventContextException
- if an error occurs while initializing the
members of this instance.public EventContext(String sourceKey, String sourceType, Context context, String jmsDestName, int jmsDestType, String jmsConnectionFactoryJNDIName) throws NamingException, EventContextException
sourceKey
- - identifies the source of the events; cannot be nullsourceType
- - identifies the type of source; e.g. ApplicationView;
cannot be nullcontext
- - a JNDI context to a J2EE application server.jmsDestName
- - the JNDI context for the JMS destination for eventsjmsDestType
- - destination type: JMS_TOPIC or JMS_QUEUE
NamingException
- if an error occurs trying to connect to the J2EE
application server using the supplied JNDI properties.
EventContextException
- if an error occurs while initializing the
members of this instance.public EventContext(Subject authUser, String sourceKey, String sourceType, Context context, String jmsDestName, int jmsDestType, String jmsConnectionFactoryJNDIName) throws NamingException, EventContextException
NamingException
EventContextException
public EventContext(String sourceKey, String sourceType, Context context, String jmsDestName, int jmsDestType, String jmsConnectionFactoryJNDIName, boolean bTransaction) throws NamingException, EventContextException
sourceKey
- - identifies the source of the events; cannot be nullsourceType
- - identifies the type of source; e.g. ApplicationView;
cannot be nullcontext
- - a JNDI context to a J2EE application server.jmsDestName
- - the JNDI context for the JMS destination for eventsjmsDestType
- - destination type: JMS_TOPIC or JMS_QUEUEbTransaction
- - not used
NamingException
- if an error occurs trying to connect to the J2EE
application server using the supplied JNDI properties.
EventContextException
- if an error occurs while initializing the
members of this instance.public EventContext(String durableClientID, String sourceKey, String sourceType, Hashtable jndiEnv, String jmsDestName, String jmsConnectionFactoryJNDIName) throws NamingException, EventContextException
durableClientID
- - an identifier of the client of this instance; this
ID is used to obtain durable subscriptions for this JMS topic. The ID must
be a valid Java identifier.sourceKey
- - identifies the source of the events; cannot be nullsourceType
- - identifies the type of source; e.g. ApplicationView;
cannot be nulljndiEnv
- - contains properties needed to establish an initial JNDI
context to a J2EE application server.jmsDestName
- - the JNDI context for the JMS topic for events
this parameter is currently not used by this implementation.
NamingException
- if an error occurs trying to connect to the J2EE
application server using the supplied JNDI properties.
EventContextException
- if an error occurs while initializing the
members of this instance.public EventContext(String durableClientID, String sourceKey, String sourceType, Context context, String jmsDestName, String jmsConnectionFactoryJNDIName) throws NamingException, EventContextException
durableClientID
- - an identifier of the client of this instance; this
ID is used to obtain durable subscriptions for this JMS topic. The ID must
be a valid Java identifier.sourceKey
- - identifies the source of the events; cannot be nullsourceType
- - identifies the type of source; e.g. ApplicationView;
cannot be nullcontext
- - contains properties needed to establish an initial JNDI
context to a J2EE application server.jmsDestName
- - the JNDI context for the JMS topic for events
this parameter is currently not used by this implementation.
NamingException
- if an error occurs trying to connect to the J2EE
application server using the supplied JNDI properties.
EventContextException
- if an error occurs while initializing the
members of this instance.Method Detail |
---|
public static final void validateDurableClientID(String strDurableClientID) throws IllegalArgumentException
IllegalArgumentException
- if the argument is not a valid durable
client ID.public String getSourceKey()
public String getSourceType()
public void close()
public void postEvent(String eventType, IEvent event) throws DocumentException, EventContextException
DocumentException
EventContextException
public void setNamespaceEnforcementEnabled(ApplicationView appView, boolean newValue)
public boolean getNamespaceEnforcementEnabled()
public IEventDefinition getEventDefinition(String eventType) throws ApplicationViewException, RemoteException
ApplicationViewException
- If the schema repository cannot be found;
the attempt to transport or manipulate the event type's schema
fails; the event type's schema text, as stored in the schema
repository, cannot be parsed; or there is a read error while
reading the event type's schema.
RemoteException
- If an RMI communication failure occurs.public void addListener(String eventTypeName, EventListener eventListener) throws EventContextException
EventContextException
public void addListener(String eventTypeName, EventListener eventListener, String subscriberName) throws EventContextException
eventTypeName
- eventListener
- subscriberName
- unique name for a durable subscriber
EventContextException
public boolean containsListener(String eventTypeName, EventListener listener)
public boolean removeListener(String eventTypeName, EventListener listener)
public Context getContext()
public javax.jms.Topic getJMSTopic()
public javax.jms.Queue getJMSQueue()
public void reinitialize() throws NamingException, EventContextException
NamingException
EventContextException
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |