public class JMSProducer extends JMSClient
Modifier and Type | Field and Description |
---|---|
protected java.util.List |
messageBuffer |
protected javax.jms.MessageProducer |
producer
The MessageProducer instance which will be used to wrote messages to the Destination.
|
conFactoryName, conn, destinationHandle, destinationName, destinationType, env, isExternalSession, JMS_LOGGER, jmsLogger, NO_TX, providerPassword, providerUserName, QUEUE, session, SESSION_TX, TOPIC, txMode, valid
Constructor and Description |
---|
JMSProducer(java.lang.String destinationName,
javax.jms.Session session,
java.util.Properties env) |
JMSProducer(java.lang.String destinationName,
java.lang.String conFactoryName,
int txMode,
java.util.Properties env) |
JMSProducer(java.lang.String destinationName,
java.lang.String conFactoryName,
int txMode,
java.util.Properties env,
java.lang.String providerUserName,
java.lang.String providerPassword) |
Modifier and Type | Method and Description |
---|---|
void |
addMessage(JMSData data) |
void |
close()
Releses all resources that is cached by the client like JMS Session and
Connection.
|
protected void |
createClient()
Internal method to create the MessageConsumer from the JMS Session.
|
JMSClient |
createClientInSession()
Creates another JMSClient of the same type in this clients Session.
|
JMSClient |
createClientInSession(java.lang.String destinationName,
java.util.Properties env)
Creates another JMSClient of the same type in this clients Session.
|
JMSConsumer |
createJMSConsumerInSession(java.lang.String selector)
Create a JMSConsumer in the same session as this JMSProducer.
|
void |
sendMessage(boolean autocommit) |
void |
sendMessage(JMSData data,
boolean autocommit)
Write a message to the Destination.
|
void |
sendMessage(java.util.List listData,
boolean autocommit)
Write a List of messages to the Destination.
|
commitTx, createConnection, createSession, getDestinationName, getEnvironment, getProviderPassword, getProviderUserName, getSession, invalidate, isValid, rollbackTx, setDestination
protected javax.jms.MessageProducer producer
protected java.util.List messageBuffer
public JMSProducer(java.lang.String destinationName, java.lang.String conFactoryName, int txMode, java.util.Properties env, java.lang.String providerUserName, java.lang.String providerPassword) throws MXException
destinationName
- the JNDI name of the Destination.conFactoryName
- the JNDI name of the ConnectionFactory.txMode
- The transaction mode for the JMS client Session.env
- The env properties to get an InitialContext.providerUserName
- The provider connection user.providerPassword
- The provider connection password.MXException
public JMSProducer(java.lang.String destinationName, java.lang.String conFactoryName, int txMode, java.util.Properties env) throws MXException
destinationName
- the JNDI name of the Destination.conFactoryName
- the JNDI name of the ConnectionFactory.txMode
- The transaction mode for the JMS client Session.env
- The env properties to get an InitialContext.MXException
public JMSProducer(java.lang.String destinationName, javax.jms.Session session, java.util.Properties env) throws MXException
destinationName
- the JNDI name of the Destination.session
- the JMS session from which the client should be created.env
- The env properties to get an InitialContext.MXException
protected void createClient() throws MXException
JMSClient
MXException
public void addMessage(JMSData data)
data
- public void sendMessage(boolean autocommit) throws MXException
autocommit
- MXException
public void sendMessage(java.util.List listData, boolean autocommit) throws MXException
listData
- the list of JMSData objects each representing one jms Message.autocommit
- If set to true will commit the transaction if invoked in the context
of a JMS Session transaction.MXException
public void sendMessage(JMSData data, boolean autocommit) throws MXException
data
- the JMSData object representing a jms message.autocommit
- If set to true will commit the transaction if invoked in the context
of a JMS Session transaction.MXException
public void close()
JMSClient
public JMSClient createClientInSession() throws MXException
JMSClient
createClientInSession
in class JMSClient
MXException
public JMSClient createClientInSession(java.lang.String destinationName, java.util.Properties env) throws MXException
JMSClient
createClientInSession
in class JMSClient
MXException
public JMSConsumer createJMSConsumerInSession(java.lang.String selector) throws MXException
selector
- the message selector for the consumer.MXException