|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.transport.AbstractConnector
org.mule.transport.jms.JmsConnector
public class JmsConnector
JmsConnector
is a JMS 1.0.2b compliant connector that can be used
by a Mule endpoint. The connector supports all JMS functionality including topics
and queues, durable subscribers, acknowledgement modes and local transactions.
Field Summary | |
---|---|
static java.lang.String |
JMS
|
java.lang.String |
password
|
static int |
REDELIVERY_FAIL_ON_FIRST
Indicates that Mule should throw an exception on any redelivery attempt. |
static int |
REDELIVERY_IGNORE
|
java.lang.String |
username
|
Fields inherited from interface org.mule.api.transport.Connector |
---|
INT_VALUE_NOT_SET |
Fields inherited from interface org.mule.api.lifecycle.Disposable |
---|
PHASE_NAME |
Constructor Summary | |
---|---|
JmsConnector(MuleContext context)
|
Method Summary | |
---|---|
void |
close(javax.jms.MessageConsumer consumer)
Closes the MessageConsumer |
void |
close(javax.jms.MessageProducer producer)
Closes the MessageProducer |
void |
close(javax.jms.Session session)
Closes the MuleSession |
void |
close(javax.jms.TemporaryQueue tempQueue)
Closes the TemporaryQueue |
void |
close(javax.jms.TemporaryTopic tempTopic)
Closes the TemporaryTopic |
void |
closeQuietly(javax.jms.MessageConsumer consumer)
Closes the MessageConsumer without throwing an exception (an error message is logged instead). |
void |
closeQuietly(javax.jms.MessageProducer producer)
Closes the MessageProducer without throwing an exception (an error message is logged instead). |
void |
closeQuietly(javax.jms.Session session)
Closes the MuleSession without throwing an exception (an error message is logged instead). |
void |
closeQuietly(javax.jms.TemporaryQueue tempQueue)
Closes the TemporaryQueue without throwing an exception (an error message is logged instead). |
void |
closeQuietly(javax.jms.TemporaryTopic tempTopic)
Closes the TemporaryTopic without throwing an exception (an error message is logged instead). |
void |
closeSessionIfNoTransactionActive(javax.jms.Session session)
Closes a session if there is no active transaction in the current thread, otherwise the session will continue active until there is a direct call to close it. |
protected javax.jms.Connection |
createConnection()
|
protected javax.jms.ConnectionFactory |
createConnectionFactory()
|
protected JmsSupport |
createJmsSupport()
A factory method to create various JmsSupport class versions. |
protected void |
doConnect()
Template method where any connections should be made for the connector |
protected void |
doDisconnect()
Template method where any connected resources used by the connector should be disconnected |
protected void |
doDispose()
Template method to perform any work when destroying the connectoe |
protected void |
doInitialise()
|
protected void |
doStart()
Template method to perform any work when starting the connectoe |
protected void |
doStop()
Template method to perform any work when stopping the connectoe |
int |
getAcknowledgementMode()
|
java.lang.String |
getClientId()
|
javax.jms.Connection |
getConnection()
|
javax.jms.ConnectionFactory |
getConnectionFactory()
|
java.lang.String |
getConnectionFactoryJndiName()
|
java.util.Map |
getConnectionFactoryProperties()
|
protected javax.jms.ConnectionFactory |
getDefaultConnectionFactory()
Override this method to provide a default ConnectionFactory for a vendor-specific JMS Connector. |
JmsSupport |
getJmsSupport()
|
javax.naming.Context |
getJndiContext()
|
java.lang.String |
getJndiInitialFactory()
|
java.util.Map |
getJndiProviderProperties()
|
java.lang.String |
getJndiProviderUrl()
|
int |
getMaxRedelivery()
|
int |
getNumberOfConsumers()
A synonym for AbstractConnector.numberOfConcurrentTransactedReceivers . |
java.lang.String |
getPassword()
|
java.lang.String |
getProtocol()
|
protected java.lang.Object |
getReceiverKey(FlowConstruct flowConstruct,
InboundEndpoint endpoint)
The method determines the key used to store the receiver against. |
RedeliveryHandlerFactory |
getRedeliveryHandlerFactory()
|
ReplyToHandler |
getReplyToHandler(ImmutableEndpoint endpoint)
Getter for property 'replyToHandler'. |
java.lang.Boolean |
getSameRMOverrideValue()
|
javax.jms.Session |
getSession(boolean transacted,
boolean topic)
|
javax.jms.Session |
getSession(ImmutableEndpoint endpoint)
|
javax.jms.Session |
getSessionFromTransaction()
|
java.lang.String |
getSpecification()
|
JmsTopicResolver |
getTopicResolver()
Getter for property 'topicResolver'. |
java.lang.String |
getUsername()
|
protected void |
initJndiContext()
|
boolean |
isCacheJmsSessions()
|
boolean |
isDisableTemporaryReplyToDestinations()
|
boolean |
isDurable()
|
boolean |
isEagerConsumer()
Getter for property 'eagerConsumer'. |
boolean |
isEmbeddedMode()
|
boolean |
isForceJndiDestinations()
|
boolean |
isHonorQosHeaders()
Gets the value of honorQosHeaders property. |
boolean |
isJndiDestinations()
|
boolean |
isNoLocal()
|
boolean |
isPersistentDelivery()
|
boolean |
isResponseEnabled()
|
boolean |
isReturnOriginalMessageAsReply()
|
protected java.lang.Object |
lookupFromJndi(java.lang.String jndiName)
|
void |
onException(javax.jms.JMSException jmsException)
|
javax.jms.Message |
preProcessMessage(javax.jms.Message message,
javax.jms.Session session)
This method may be overridden in order to apply pre-processing to the message as soon as it arrives. |
void |
setAcknowledgementMode(int acknowledgementMode)
|
void |
setCacheJmsSessions(boolean cacheJmsSessions)
|
void |
setClientId(java.lang.String clientId)
|
protected void |
setConnection(javax.jms.Connection connection)
|
void |
setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
|
void |
setConnectionFactoryJndiName(java.lang.String connectionFactoryJndiName)
|
void |
setConnectionFactoryProperties(java.util.Map connectionFactoryProperties)
|
void |
setDisableTemporaryReplyToDestinations(boolean disableTemporaryReplyToDestinations)
|
void |
setDurable(boolean durable)
|
void |
setEagerConsumer(boolean eagerConsumer)
A value of true will create a consumer on
connect, in contrast to lazy instantiation in the poll loop. |
void |
setEmbeddedMode(boolean embeddedMode)
|
void |
setForceJndiDestinations(boolean forceJndiDestinations)
|
void |
setHonorQosHeaders(boolean honorQosHeaders)
Sets the honorQosHeaders property, which determines whether
JmsMessageDispatcher should honor incoming message's QoS headers
(JMSPriority, JMSDeliveryMode). |
void |
setJmsSupport(JmsSupport jmsSupport)
|
void |
setJndiContext(javax.naming.Context jndiContext)
|
void |
setJndiDestinations(boolean jndiDestinations)
|
void |
setJndiInitialFactory(java.lang.String jndiInitialFactory)
|
void |
setJndiProviderProperties(java.util.Map jndiProviderProperties)
|
void |
setJndiProviderUrl(java.lang.String jndiProviderUrl)
|
void |
setMaxRedelivery(int maxRedelivery)
|
void |
setNoLocal(boolean noLocal)
|
void |
setNumberOfConsumers(int count)
A synonym for AbstractConnector.numberOfConcurrentTransactedReceivers . |
void |
setPassword(java.lang.String password)
|
void |
setPersistentDelivery(boolean persistentDelivery)
|
void |
setRedeliveryHandlerFactory(RedeliveryHandlerFactory redeliveryHandlerFactory)
|
void |
setReturnOriginalMessageAsReply(boolean returnOriginalMessageAsReply)
|
void |
setSameRMOverrideValue(java.lang.Boolean sameRMOverrideValue)
|
void |
setSpecification(java.lang.String specification)
|
void |
setTopicResolver(JmsTopicResolver topicResolver)
Setter for property 'topicResolver'. |
void |
setUsername(java.lang.String username)
|
boolean |
supportsProperty(java.lang.String property)
This method may be overridden in case a certain JMS implementation does not support all the standard JMS properties. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String JMS
public static final int REDELIVERY_FAIL_ON_FIRST
public static final int REDELIVERY_IGNORE
public java.lang.String username
public java.lang.String password
Constructor Detail |
---|
public JmsConnector(MuleContext context)
Method Detail |
---|
public java.lang.String getProtocol()
getProtocol
in interface Connector
protected void doInitialise() throws InitialisationException
doInitialise
in class AbstractConnector
InitialisationException
protected JmsSupport createJmsSupport()
JmsSupport
protected javax.jms.ConnectionFactory createConnectionFactory() throws InitialisationException, javax.naming.NamingException
InitialisationException
javax.naming.NamingException
protected javax.jms.ConnectionFactory getDefaultConnectionFactory() throws java.lang.Exception
java.lang.Exception
protected void doDispose()
AbstractConnector
doDispose
in class AbstractConnector
protected void initJndiContext() throws javax.naming.NamingException, InitialisationException
javax.naming.NamingException
InitialisationException
protected java.lang.Object lookupFromJndi(java.lang.String jndiName) throws javax.naming.NamingException
javax.naming.NamingException
protected javax.jms.Connection createConnection() throws javax.naming.NamingException, javax.jms.JMSException, InitialisationException
javax.naming.NamingException
javax.jms.JMSException
InitialisationException
public void onException(javax.jms.JMSException jmsException)
onException
in interface javax.jms.ExceptionListener
protected void doConnect() throws java.lang.Exception
AbstractConnector
doConnect
in class AbstractConnector
java.lang.Exception
protected void doDisconnect() throws java.lang.Exception
AbstractConnector
doDisconnect
in class AbstractConnector
java.lang.Exception
protected java.lang.Object getReceiverKey(FlowConstruct flowConstruct, InboundEndpoint endpoint)
AbstractConnector
getReceiverKey
in class AbstractConnector
flowConstruct
- the service for which the endpoint is being registeredendpoint
- the endpoint being registered for the service
public javax.jms.Session getSessionFromTransaction()
public javax.jms.Session getSession(ImmutableEndpoint endpoint) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Session getSession(boolean transacted, boolean topic) throws javax.jms.JMSException
javax.jms.JMSException
protected void doStart() throws MuleException
AbstractConnector
doStart
in class AbstractConnector
MuleException
- if the method failspublic void closeSessionIfNoTransactionActive(javax.jms.Session session)
session
- the session that ill be closed if there is an active transaction.protected void doStop() throws MuleException
AbstractConnector
doStop
in class AbstractConnector
MuleException
- if the method failspublic ReplyToHandler getReplyToHandler(ImmutableEndpoint endpoint)
AbstractConnector
getReplyToHandler
in class AbstractConnector
public boolean supportsProperty(java.lang.String property)
public javax.jms.Message preProcessMessage(javax.jms.Message message, javax.jms.Session session) throws java.lang.Exception
message
- - the incoming messagesession
- - the JMS session
java.lang.Exception
public void close(javax.jms.MessageProducer producer) throws javax.jms.JMSException
producer
-
javax.jms.JMSException
public void closeQuietly(javax.jms.MessageProducer producer)
producer
- public void close(javax.jms.MessageConsumer consumer) throws javax.jms.JMSException
consumer
-
javax.jms.JMSException
public void closeQuietly(javax.jms.MessageConsumer consumer)
consumer
- public void close(javax.jms.Session session) throws javax.jms.JMSException
session
-
javax.jms.JMSException
public void closeQuietly(javax.jms.Session session)
session
- public void close(javax.jms.TemporaryQueue tempQueue) throws javax.jms.JMSException
tempQueue
-
javax.jms.JMSException
public void closeQuietly(javax.jms.TemporaryQueue tempQueue)
tempQueue
- public void close(javax.jms.TemporaryTopic tempTopic) throws javax.jms.JMSException
tempTopic
-
javax.jms.JMSException
public void closeQuietly(javax.jms.TemporaryTopic tempTopic)
tempTopic
- public javax.jms.Connection getConnection()
protected void setConnection(javax.jms.Connection connection)
public int getAcknowledgementMode()
public void setAcknowledgementMode(int acknowledgementMode)
acknowledgementMode
- The acknowledgementMode to set.public boolean isDurable()
public void setDurable(boolean durable)
durable
- The durable to set.public boolean isNoLocal()
public void setNoLocal(boolean noLocal)
noLocal
- The noLocal to set.public boolean isPersistentDelivery()
public void setPersistentDelivery(boolean persistentDelivery)
persistentDelivery
- The persistentDelivery to set.public JmsSupport getJmsSupport()
public void setJmsSupport(JmsSupport jmsSupport)
public java.lang.String getSpecification()
public void setSpecification(java.lang.String specification)
public java.lang.String getUsername()
public void setUsername(java.lang.String username)
public java.lang.String getPassword()
public void setPassword(java.lang.String password)
public java.lang.String getClientId()
public void setClientId(java.lang.String clientId)
public int getMaxRedelivery()
public void setMaxRedelivery(int maxRedelivery)
public boolean isResponseEnabled()
isResponseEnabled
in interface Connector
isResponseEnabled
in class AbstractConnector
public JmsTopicResolver getTopicResolver()
public void setTopicResolver(JmsTopicResolver topicResolver)
topicResolver
- Value to set for property 'topicResolver'.public boolean isEagerConsumer()
true
.
eagerConsumer
public void setEagerConsumer(boolean eagerConsumer)
true
will create a consumer on
connect, in contrast to lazy instantiation in the poll loop.
This setting very much depends on the JMS vendor.
Affects transactional receivers, typical symptoms are:
eagerConsumer
- Value to set for property 'eagerConsumer'.eagerConsumer
,
XaTransactedJmsMessageReceiver
public boolean isCacheJmsSessions()
public void setCacheJmsSessions(boolean cacheJmsSessions)
public javax.jms.ConnectionFactory getConnectionFactory()
public void setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
public RedeliveryHandlerFactory getRedeliveryHandlerFactory()
public void setRedeliveryHandlerFactory(RedeliveryHandlerFactory redeliveryHandlerFactory)
public void setHonorQosHeaders(boolean honorQosHeaders)
honorQosHeaders
property, which determines whether
JmsMessageDispatcher
should honor incoming message's QoS headers
(JMSPriority, JMSDeliveryMode).
honorQosHeaders
- true
if JmsMessageDispatcher
should honor incoming message's QoS headers; otherwise
false
Default is false
, meaning that
connector settings will override message headers.public boolean isHonorQosHeaders()
honorQosHeaders
property.
true
if JmsMessageDispatcher
should
honor incoming message's QoS headers; otherwise false
Default is false
, meaning that connector settings will
override message headers.public javax.naming.Context getJndiContext()
public void setJndiContext(javax.naming.Context jndiContext)
public java.lang.String getJndiInitialFactory()
public void setJndiInitialFactory(java.lang.String jndiInitialFactory)
public java.lang.String getJndiProviderUrl()
public void setJndiProviderUrl(java.lang.String jndiProviderUrl)
public java.util.Map getJndiProviderProperties()
public void setJndiProviderProperties(java.util.Map jndiProviderProperties)
public java.lang.String getConnectionFactoryJndiName()
public void setConnectionFactoryJndiName(java.lang.String connectionFactoryJndiName)
public boolean isJndiDestinations()
public void setJndiDestinations(boolean jndiDestinations)
public boolean isForceJndiDestinations()
public void setForceJndiDestinations(boolean forceJndiDestinations)
public boolean isDisableTemporaryReplyToDestinations()
public void setDisableTemporaryReplyToDestinations(boolean disableTemporaryReplyToDestinations)
public boolean isReturnOriginalMessageAsReply()
public void setReturnOriginalMessageAsReply(boolean returnOriginalMessageAsReply)
public java.util.Map getConnectionFactoryProperties()
public void setConnectionFactoryProperties(java.util.Map connectionFactoryProperties)
connectionFactoryProperties
- properties to be set on the underlying
ConnectionFactory.public void setNumberOfConsumers(int count)
AbstractConnector.numberOfConcurrentTransactedReceivers
. Note that
it affects both transactional and non-transactional scenarios.
count
- number of consumerspublic int getNumberOfConsumers()
AbstractConnector.numberOfConcurrentTransactedReceivers
.
public boolean isEmbeddedMode()
public void setEmbeddedMode(boolean embeddedMode)
public java.lang.Boolean getSameRMOverrideValue()
public void setSameRMOverrideValue(java.lang.Boolean sameRMOverrideValue)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |