|
||||||||||
| 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.PointToPointProducer
public class PointToPointProducer
The PointToPointProducer produces messages to a Queue. If the method being called to produce the message is 'produceRequest' the Producer will use the QueueRequestor object to produce the message and wait for a response from the consuming application. If the method called is 'produceMessage' it will not wait for a response.
PubSubProducer,
PointToPointConsumer| Nested Class Summary | |
|---|---|
protected class |
PointToPointProducer.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 TemporaryQueue. |
protected class |
PointToPointProducer.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 | |
|---|---|
PointToPointProducer()
|
|
PointToPointProducer(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 | |
|---|---|
XmlEnterpriseObject |
create(ActionableEnterpriseObject theObject)
Create 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. |
XmlEnterpriseObject |
delete(java.lang.String deleteAction,
ActionableEnterpriseObject theObject)
Delete message production. |
java.util.List |
generate(XmlEnterpriseObject keyObject,
ActionableEnterpriseObject theObject)
Generate message production. |
javax.jms.Queue |
getQueue()
Returns the Producers's Queue object. |
javax.jms.QueueConnection |
getQueueConnection()
Returns the Producers's QueueConnection object. |
javax.jms.QueueConnectionFactory |
getQueueConnectionFactory()
Returns the Producers's QueueConnectionFactory object. |
QueueRequestor |
getQueueRequestor()
Returns the Producers's QueueRequestor object. |
javax.jms.QueueSender |
getQueueSender()
Returns the Producers's QueueSender object. |
javax.jms.QueueSession |
getQueueSession()
Returns the Producers's QueueSession object. |
int |
getRequestTimeoutInterval()
Returns the request timeout interval that will be used by this producer to determine when a timeout occurrs. |
protected void |
init(java.util.Properties props)
Invokes MessageProducer.init(Properties). |
void |
produceMessage(javax.jms.Message aMessage)
Deprecated. As of OpenEAI version 4.0 |
org.jdom.Document |
produceRequest(ActionableEnterpriseObject theObject,
org.jdom.Document doc)
Uses the pre-started QueueRequestor to send a request to a consumer and wait for a response. |
javax.jms.Message |
produceRequest(javax.jms.Message aMessage)
Uses the pre-started QueueRequestor to send a request to a consumer and wait for a response. |
java.util.List |
query(XmlEnterpriseObject keyObject,
ActionableEnterpriseObject theObject)
Query message production. |
void |
setQueue(javax.jms.Queue queue)
Sets the Producers's Queue object. |
void |
setQueueConnection(javax.jms.QueueConnection queueConnection)
Sets the Producers's QueueConnection object. |
void |
setQueueConnectionFactory(javax.jms.QueueConnectionFactory qcf)
Sets the Producers's QueueConnectionFactory object. |
void |
setQueueRequestor(QueueRequestor queueRequestor)
Sets the Producers's QueueRequestor object. |
void |
setQueueSender(javax.jms.QueueSender queueSender)
Sets the Producers's QueueSender object. |
void |
setQueueSession(javax.jms.QueueSession session)
Sets the Producers's QueueSession object. |
void |
setRequestTimeoutInterval(int timeout)
Sets the request timeout interval that will be used by this producer to determine when a timeout occurrs. |
boolean |
start()
|
void |
startMonitor()
This method starts the Producer's "Monitor Thread". |
boolean |
startProducer()
Starts the producer making it ready to produce messages to the Queue 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 |
stopProducer()
Attempts to cleanly shutdown the Producer. |
XmlEnterpriseObject |
update(ActionableEnterpriseObject theObject)
Update 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.RequestService |
|---|
getProducerId, incrementMessageSequence, setProducerId |
| Constructor Detail |
|---|
public PointToPointProducer()
public PointToPointProducer(ProducerConfig pConfig)
throws java.io.IOException,
javax.jms.JMSException
pConfig - org.openeai.config.ProducerConfig
java.io.IOException
javax.jms.JMSExceptionProducerConfig,
PubSubProducer| Method Detail |
|---|
protected void init(java.util.Properties props)
throws java.io.IOException
init in class MessageProducerprops - Properties
java.io.IOExceptionMessageProducer.init(Properties)public final int getRequestTimeoutInterval()
public final void setRequestTimeoutInterval(int timeout)
timeout - int timeout interval in milliseconds.public final javax.jms.QueueConnectionFactory getQueueConnectionFactory()
See the JMS Specification to learn more about JMS objects.
public final void setQueueConnectionFactory(javax.jms.QueueConnectionFactory qcf)
See the JMS Specification to learn more about JMS objects.
qcf - javax.jms.QueueConnectionFactorypublic final javax.jms.Queue getQueue()
See the JMS Specification to learn more about JMS objects.
public final void setQueue(javax.jms.Queue queue)
See the JMS Specification to learn more about JMS objects.
queue - javax.jms.Queuepublic final javax.jms.QueueConnection getQueueConnection()
See the JMS Specification to learn more about JMS objects.
public final void setQueueConnection(javax.jms.QueueConnection queueConnection)
See the JMS Specification to learn more about JMS objects.
queueConnection - javax.jms.QueueConnectionpublic final javax.jms.QueueSession getQueueSession()
See the JMS Specification to learn more about JMS objects.
public final void setQueueSession(javax.jms.QueueSession session)
See the JMS Specification to learn more about JMS objects.
session - javax.jms.QueueSessionpublic final javax.jms.QueueSender getQueueSender()
See the JMS Specification to learn more about JMS objects.
public final void setQueueSender(javax.jms.QueueSender queueSender)
See the JMS Specification to learn more about JMS objects.
queueSender - javax.jms.QueueSenderpublic final QueueRequestor getQueueRequestor()
See the JMS Specification to learn more about JMS objects.
QueueRequestorpublic final void setQueueRequestor(QueueRequestor queueRequestor)
See the JMS Specification to learn more about JMS objects.
queueRequestor - org.openeai.jms.producer.QueueRequestorQueueRequestorpublic 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 stopProducer()
PointToPointProducer.MonitorProducer
public final boolean start()
throws javax.jms.JMSException
start in class MessageProducerjavax.jms.JMSException
public boolean startProducer()
throws javax.jms.JMSException
javax.jms.JMSExceptionPubSubProducer.startPublisher(),
QueueRequestorpublic final javax.jms.TextMessage createTextMessage()
public XmlEnterpriseObject create(ActionableEnterpriseObject theObject)
throws TransportException
RequestService
create in interface RequestService
TransportException
public XmlEnterpriseObject update(ActionableEnterpriseObject theObject)
throws TransportException
RequestService
update in interface RequestService
TransportException
public XmlEnterpriseObject delete(java.lang.String deleteAction,
ActionableEnterpriseObject theObject)
throws TransportException
RequestService
delete in interface RequestServicedeleteAction - String the delete action ('delete' or 'purge')
TransportException
public java.util.List query(XmlEnterpriseObject keyObject,
ActionableEnterpriseObject theObject)
throws TransportException
RequestService
query in interface RequestServicekeyObject - XmlEnterpriseObject to use as retreival arguments in the Query.
The contents of this object are inserted into the Query document prior to
sending the query request. Under normal conditions, this object is
actually a LightweightPerson object since that's the most common query object used.
NOTE: This method should be over-ridden by lower level classes if the keyObject isn't a LightweightPerson.
TransportException
public java.util.List generate(XmlEnterpriseObject keyObject,
ActionableEnterpriseObject theObject)
throws TransportException
RequestService
generate in interface RequestServicekeyObject - XmlEnterpriseObject to use as generation "seed" data
(like an UnknownPerson for an InstitutionalIdentity-Generate-Request).
TransportException
public final void produceMessage(javax.jms.Message aMessage)
throws javax.jms.JMSException
aMessage - javax.jms.Message the message to produce
javax.jms.JMSException - if errors occur.
public final javax.jms.Message produceRequest(javax.jms.Message aMessage)
throws javax.jms.JMSException
aMessage - javax.jms.Message the message to send in the request
javax.jms.JMSException - if errors occur and the producer can't successfully restart itself
and re-send the message.
public final org.jdom.Document produceRequest(ActionableEnterpriseObject theObject,
org.jdom.Document doc)
throws TransportException
produceRequest in interface RequestServicetheObject - an ActionableEnterpriseObject that the action is being performed ondoc - the Document that was built from the content of the object
TransportException - if errors occur and the producer can't successfully restart itself
and re-send the message.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||