daoexamples.moviedemo
Class MessagePublisher
java.lang.Object
daoexamples.moviedemo.MessagePublisher
- class MessagePublisher
- extends java.lang.Object
publishes messages to a JMS Topic
You can learn more about the Java Message Service at
http://java.sun.com/products/jms/
This class assumes that transactions are externally
demaracated using JTA
Instances of this class are not thread-safe.
- Author:
- Sean C. Sullivan
Field Summary |
private boolean |
bIsClosed
|
private static org.apache.commons.logging.Log |
log
|
private javax.jms.TopicPublisher |
publisher
|
private javax.jms.TopicConnection |
tconn
|
private javax.jms.Topic |
top
|
private static java.lang.String |
TOPIC_CF_JNDI_NAME
|
private static java.lang.String |
TOPIC_JNDI_NAME
|
private javax.jms.TopicSession |
tsess
|
Constructor Summary |
MessagePublisher()
Before calling this constructor, you must have
a JTA UserTransaction |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static final org.apache.commons.logging.Log log
TOPIC_CF_JNDI_NAME
private static final java.lang.String TOPIC_CF_JNDI_NAME
- See Also:
- Constant Field Values
TOPIC_JNDI_NAME
private static final java.lang.String TOPIC_JNDI_NAME
- See Also:
- Constant Field Values
tconn
private javax.jms.TopicConnection tconn
tsess
private javax.jms.TopicSession tsess
publisher
private javax.jms.TopicPublisher publisher
top
private javax.jms.Topic top
bIsClosed
private boolean bIsClosed
MessagePublisher
public MessagePublisher()
- Before calling this constructor, you must have
a JTA UserTransaction
- Throws:
DAORuntimeException
getInitialContext
private static javax.naming.InitialContext getInitialContext()
- Throws:
DAORuntimeException
getTopic
private static javax.jms.Topic getTopic()
- Throws:
DAORuntimeException
getTopicConnection
private static javax.jms.TopicConnection getTopicConnection()
- Throws:
DAORuntimeException
getTopicConnectionFactory
private static javax.jms.TopicConnectionFactory getTopicConnectionFactory()
- Throws:
DAORuntimeException
publishTextMessage
public void publishTextMessage(java.lang.String strText)
- Parameters:
strText
- must be non-null
- Throws:
DAORuntimeException
isClosed
public boolean isClosed()
- Returns:
- true if this object is closed
- See Also:
close()
close
public void close()
- See Also:
isClosed()
Copyright © 2003-2004 daoexamples.sourceforge.net. All Rights Reserved.