|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openeai.OpenEaiObject
org.openeai.jms.producer.MessageProducer
org.openeai.jms.producer.PubSubProducer
public class PubSubProducer
The PubSubProducer produces messages to a JMS Topic.
PointToPointProducer,
PubSubConsumer| Nested Class Summary | |
|---|---|
protected class |
PubSubProducer.MonitorProducer
This Thread will sleep for 30 seconds and then wake up and check the status of the producer by attempting to create/delete a TemporaryTopic. |
protected class |
PubSubProducer.ProducerShutdownHook
This Thread will be started when the producer receives a shutdown signal from the os. |
| Field Summary |
|---|
| Fields inherited from class org.openeai.jms.producer.MessageProducer |
|---|
COMMAND_NAME, m_messages, MESSAGE_ID, MESSAGE_NAME, NON_PERSISTENT_DELIVERY, PERSISTENT_DELIVERY, STARTED, STOPPED, STOPPING |
| Fields inherited from class org.openeai.OpenEaiObject |
|---|
logger |
| Constructor Summary | |
|---|---|
PubSubProducer()
|
|
PubSubProducer(ProducerConfig pConfig)
As AppConfig reads through an application's deployment document, it will build a ProducerConfig Java object and pass that object to this constructor. |
|
| Method Summary | |
|---|---|
void |
commit()
Commit any transactions pending on this publisher and on its LoggingProducer. |
void |
createSync(ActionableEnterpriseObject theObject)
Create Sync message production. |
javax.jms.TextMessage |
createTextMessage()
Convenience method that allows calling applications to use this producer to create a JMS TextMessage that is used during message production. |
void |
deleteSync(java.lang.String deleteAction,
ActionableEnterpriseObject theObject)
Delete Sync message production. |
PubSubProducer |
getLoggingProducer()
Returns the Logging Producer associated to this producer which is simply another PubSubProducer that may be configured in the deployment document to publish messages published by this producer to a second "logging" destination. |
javax.jms.Topic |
getTopic()
Returns the Producers's Topic object. |
javax.jms.TopicConnection |
getTopicConnection()
Returns the Producers's TopicConnection object. |
javax.jms.TopicConnectionFactory |
getTopicConnectionFactory()
Returns the Producers's TopicConnectionFactory object. |
javax.jms.TopicPublisher |
getTopicPublisher()
Returns the Producers's TopicPublisher object. |
javax.jms.TopicSession |
getTopicSession()
Returns the Producers's TopicSession object. |
protected void |
init(java.util.Properties props)
Invokes MessageProducer.init(Properties). |
boolean |
publishMessage(ActionableEnterpriseObject theObject,
org.jdom.Document doc)
Publishes the message passed in to the Topic the producer is connected to. |
boolean |
publishMessage(javax.jms.Message aMessage)
Publishes the message passed in to the Topic the producer is connected to. |
void |
rollback()
Rollback any transactions pending on this publisher and on its LoggingProducer. |
void |
setLoggingProducer(PubSubProducer producer)
Sets the Logging Producer associated to this producer which is simply another PubSubProducer that may be configured in the deployment document to publish messages published by this producer to a second "logging" destination. |
void |
setTopic(javax.jms.Topic topic)
Sets the Producers's Topic object. |
void |
setTopicConnection(javax.jms.TopicConnection topicConnection)
Sets the Producers's TopicConnection object. |
void |
setTopicConnectionFactory(javax.jms.TopicConnectionFactory tcf)
Sets the Producers's TopicConnectionFactory object. |
void |
setTopicPublisher(javax.jms.TopicPublisher topicPublisher)
Sets the Producers's TopicPublisher object. |
void |
setTopicSession(javax.jms.TopicSession session)
Sets the Producers's TopicSession object. |
boolean |
start()
|
void |
startMonitor()
This method starts the Producer's "Monitor Thread". |
boolean |
startPublisher()
Starts the producer making it ready to publish messages to the Topic that it connects to. |
void |
stop()
|
void |
stopMonitor()
This method stops the Producer's "Monitor Thread" so it won't attempt to restart the producer. |
void |
stopPublisher()
Attempts to cleanly shutdown the Producer. |
void |
updateSync(ActionableEnterpriseObject theObject)
Update Sync message production. |
| Methods inherited from class org.openeai.OpenEaiObject |
|---|
getAppName, getDebug, getFromAddr, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setAppName, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.openeai.transport.SyncService |
|---|
getProducerId, incrementMessageSequence, setProducerId |
| Constructor Detail |
|---|
public PubSubProducer()
public PubSubProducer(ProducerConfig pConfig)
throws java.io.IOException,
javax.jms.JMSException
pConfig - org.openeai.config.ProducerConfig
java.io.IOException
javax.jms.JMSExceptionProducerConfig,
PointToPointProducer| Method Detail |
|---|
public final javax.jms.TopicConnectionFactory getTopicConnectionFactory()
See the JMS Specification to learn more about JMS objects.
public final void setTopicConnectionFactory(javax.jms.TopicConnectionFactory tcf)
See the JMS Specification to learn more about JMS objects.
tcf - javax.jms.TopicConnectionFactorypublic final javax.jms.Topic getTopic()
See the JMS Specification to learn more about JMS objects.
public final void setTopic(javax.jms.Topic topic)
See the JMS Specification to learn more about JMS objects.
topic - javax.jms.Topicpublic final javax.jms.TopicConnection getTopicConnection()
See the JMS Specification to learn more about JMS objects.
public final void setTopicConnection(javax.jms.TopicConnection topicConnection)
See the JMS Specification to learn more about JMS objects.
topicConnection - javax.jms.TopicConnectionpublic final javax.jms.TopicSession getTopicSession()
See the JMS Specification to learn more about JMS objects.
public final void setTopicSession(javax.jms.TopicSession session)
See the JMS Specification to learn more about JMS objects.
session - javax.jms.TopicSessionpublic final javax.jms.TopicPublisher getTopicPublisher()
See the JMS Specification to learn more about JMS objects.
public final void setTopicPublisher(javax.jms.TopicPublisher topicPublisher)
See the JMS Specification to learn more about JMS objects.
public final void setLoggingProducer(PubSubProducer producer)
producer - PubSubProducer the "logging producer"ProducerConfigpublic final PubSubProducer getLoggingProducer()
ProducerConfigpublic void stopMonitor()
When the producer is started it starts a Thread that monitors the Producer's connection to the broker. If that connection is broken for some reason, that "Monitor Thread" will attempt to restart the producer. This continues indefinitely until the producer is able to re-connect to the broker.
This method allows an application to in effect stop that monitor thread so they can shut the producer down without it restarting itself.
public void startMonitor()
public final void stop()
stop in class MessageProducerpublic final void stopPublisher()
PubSubProducer.MonitorProducer
public final void commit()
throws javax.jms.JMSException
javax.jms.JMSException
public final void rollback()
throws javax.jms.JMSException
javax.jms.JMSException
public final boolean start()
throws javax.jms.JMSException
start in class MessageProducerjavax.jms.JMSException
public final boolean startPublisher()
throws javax.jms.JMSException
javax.jms.JMSExceptionPointToPointProducer.startProducer()public final javax.jms.TextMessage createTextMessage()
public final boolean publishMessage(javax.jms.Message aMessage)
throws javax.jms.JMSException
If the "logging producer" is started, the message will also be published to the Topic it is connected to.
aMessage - javax.jms.Message the message to produce
javax.jms.JMSException - if errors occur.
public boolean publishMessage(ActionableEnterpriseObject theObject,
org.jdom.Document doc)
throws TransportException
If the "logging producer" is started, the message will also be published to the Topic it is connected to.
publishMessage in interface SyncServicetheObject - the ActionableEnterpriseObject on which the action is being performeddoc - the XML document that has been built from the contents of theObject
TransportExceptom - if errors occur.
TransportException
public void createSync(ActionableEnterpriseObject theObject)
throws TransportException
SyncService
createSync in interface SyncServiceTransportException
public void updateSync(ActionableEnterpriseObject theObject)
throws TransportException
SyncService
updateSync in interface SyncServiceTransportException
public void deleteSync(java.lang.String deleteAction,
ActionableEnterpriseObject theObject)
throws TransportException
SyncService
deleteSync in interface SyncServicedeleteAction - String delete action ('purge' or 'delete')
TransportException
protected void init(java.util.Properties props)
throws java.io.IOException
init in class MessageProducerprops - Properties
java.io.IOExceptionMessageProducer.init(Properties)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||