AdroitLogic UltraESB v1.7.0

org.adroitlogic.ultraesb.transport.jms
Class JMSTransportListener

java.lang.Object
  extended by org.adroitlogic.ultraesb.core.config.AbstractConfigurationElement
      extended by org.adroitlogic.ultraesb.transport.base.AbstractTransportListener
          extended by org.adroitlogic.ultraesb.transport.jms.JMSTransportListener
All Implemented Interfaces:
ConfigurationElement, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationContextAware

public class JMSTransportListener
extends org.adroitlogic.ultraesb.transport.base.AbstractTransportListener

The JMS Transport listener

This is a transport listener which uses Spring JMS to fetch messages from a JMS destination into the ESB

See relevant Spring documentation from DefaultMessageListenerContainer

See Also:
for transport headers set by this transport

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.adroitlogic.ultraesb.api.ConfigurationElement
ConfigurationElement.State
 
Field Summary
 
Fields inherited from class org.adroitlogic.ultraesb.transport.base.AbstractTransportListener
logger, metrics, properties, transportName
 
Fields inherited from class org.adroitlogic.ultraesb.core.config.AbstractConfigurationElement
config, ctx, debugOn, derivedName, id, outdated, state
 
Constructor Summary
JMSTransportListener()
          Default constructor - JMS 1.1
JMSTransportListener(boolean jms102)
          Create JMS listener for JMS 1.0.2b API
 
Method Summary
 void setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping)
          Set whether to accept received messages while the listener container is in the process of stopping.
 void setCacheLevel(int cacheLevel)
          Set cache level as a number (See setCacheLevelName)
 void setCacheLevelName(java.lang.String constantName)
          The cache level for JMS resources: none, connection, session, consumer or auto.
 void setConcurrentConsumers(int concurrentConsumers)
          The number of concurrent sessions/consumers to start for each listener.
 void setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
          Set the ConnectionFactory to use for obtaining JMS Connections
 void setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver destinationResolver)
          Set the DestinationResolver that is to be used to resolve Destination references for this accessor.
 void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
          Set the JMS ExceptionListener to notify in case of a JMSException thrown by the registered message listener or the invocation infrastructure.
 void setIdleTaskExecutionLimit(int idleTaskExecutionLimit)
          Specify the limit for idle executions of a receive task, not having received any message within its execution.
 void setMaxConcurrentConsumers(int maxConcurrentConsumers)
          The maximum concurrent consumers per listener
 void setMaxMessagesPerTask(int maxMessagesPerTask)
          Specify the maximum number of messages to process in one task.
 void setMessageSelector(java.lang.String messageSelector)
          Set a message selector to select messages to pick up
 void setPubSubDomain(boolean pubSubDomain)
          Set if Pub-Sub (Topic) or Point-to-Point (Queue)
 void setPubSubNoLocal(boolean pubSubNoLocal)
          Set whether to inhibit the delivery of messages published by its own connection.
 void setReceiveTimeout(long receiveTimeout)
          Set the timeout to use for receive calls, in milliseconds.
 void setRecoveryInterval(long recoveryInterval)
          Specify the interval between recovery attempts, in milliseconds.
 void setSessionAcknowledgeMode(int sessionAcknowledgeMode)
          Set the JMS acknowledgement mode that is used when creating a JMS Session to send a message.
 void setSessionAcknowledgeModeName(java.lang.String constantName)
          Set the JMS acknowledgement mode by the name of the corresponding constant in the JMS Session interface
 void setSessionTransacted(boolean sessionTransacted)
          Set the transaction mode that is used when creating a JMS Session
 void setSubscriptionDurable(boolean subscriptionDurable)
          Set whether to make the subscription durable.
 void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
          Set the Spring PlatformTransactionManager to use
 void setTransactionTimeout(int transactionTimeout)
          Specify the transaction timeout to use for transactional wrapping, in seconds.
 
Methods inherited from class org.adroitlogic.ultraesb.transport.base.AbstractTransportListener
getAvgSizeReceived, getAvgSizeSent, getBytesReceived, getBytesSent, getDetails, getFaultsReceiving, getFaultsSending, getLastResetTime, getMaxSizeReceived, getMaxSizeSent, getMessagesReceived, getMessagesSent, getMetricsWindow, getMinSizeReceived, getMinSizeSent, getReceiveErrorCodeTable, getSendErrorCodeTable, getTimeoutsReceiving, getTimeoutsSending, init, resetStatistics, setProperties, toBasicView, toDetailedView, toDetailedViewExt
 
Methods inherited from class org.adroitlogic.ultraesb.core.config.AbstractConfigurationElement
equals, getAppCtx, getDerivedName, getId, getState, hashCode, isDebugOn, isStarted, maintenanceShutdown, markAsOutdated, pause, resume, setApplicationContext, setBeanName, setConfig, setDebugOn, setDerivedName, setId, setState, start, stop, throwIllegalStateException, undeploy
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMSTransportListener

public JMSTransportListener(boolean jms102)
Create JMS listener for JMS 1.0.2b API

Parameters:
jms102 - whether jms api 1.0.2b is used

JMSTransportListener

public JMSTransportListener()
Default constructor - JMS 1.1

Method Detail

setTransactionManager

public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
Set the Spring PlatformTransactionManager to use

Parameters:
transactionManager - the Spring PlatformTransactionManager

setCacheLevel

public void setCacheLevel(int cacheLevel)
Set cache level as a number (See setCacheLevelName)

Parameters:
cacheLevel - 0 - CACHE_NONE, 1 - CACHE_CONNECTION, 2 - CACHE_SESSION, 3 - CACHE_CONSUMER, 4 - CACHE_AUTO

setCacheLevelName

public void setCacheLevelName(java.lang.String constantName)
                       throws java.lang.IllegalArgumentException
The cache level for JMS resources: none, connection, session, consumer or auto. By default (auto), the cache level will effectively be "consumer", unless an external transaction manager has been specified - in which case the effective default will be none (assuming J2EE-style transaction management where the given ConnectionFactory is an XA-aware pool).

Parameters:
constantName - one of CACHE_NONE, CACHE_CONNECTION, CACHE_SESSION, CACHE_CONSUMER or CACHE_AUTO
Throws:
java.lang.IllegalArgumentException - on an illegal cache key

setConcurrentConsumers

public void setConcurrentConsumers(int concurrentConsumers)
The number of concurrent sessions/consumers to start for each listener. Default is 1; keep concurrency limited to 1 in case of a topic listener or if queue ordering is important; consider raising it for general queues.

Parameters:
concurrentConsumers - number of concurrent sessions/consumers to start for each listener task

setMaxConcurrentConsumers

public void setMaxConcurrentConsumers(int maxConcurrentConsumers)
The maximum concurrent consumers per listener

Parameters:
maxConcurrentConsumers - maximum concurrent consumers

setMaxMessagesPerTask

public void setMaxMessagesPerTask(int maxMessagesPerTask)
Specify the maximum number of messages to process in one task. Default is (-1) unlimited

Parameters:
maxMessagesPerTask - maximum number of messages per task

setIdleTaskExecutionLimit

public void setIdleTaskExecutionLimit(int idleTaskExecutionLimit)
Specify the limit for idle executions of a receive task, not having received any message within its execution.

Parameters:
idleTaskExecutionLimit - the limit for idle execution of a receive task

setRecoveryInterval

public void setRecoveryInterval(long recoveryInterval)
Specify the interval between recovery attempts, in milliseconds.

Parameters:
recoveryInterval - the interval between recovery attempts

setMessageSelector

public void setMessageSelector(java.lang.String messageSelector)
Set a message selector to select messages to pick up

Parameters:
messageSelector - the selector to be used

setPubSubDomain

public void setPubSubDomain(boolean pubSubDomain)
Set if Pub-Sub (Topic) or Point-to-Point (Queue)

Parameters:
pubSubDomain - whether topic or queue

setPubSubNoLocal

public void setPubSubNoLocal(boolean pubSubNoLocal)
Set whether to inhibit the delivery of messages published by its own connection.

Parameters:
pubSubNoLocal - whether the pub-sup for messages published by its own connection

setSubscriptionDurable

public void setSubscriptionDurable(boolean subscriptionDurable)
Set whether to make the subscription durable. The durable subscription name to be used can be specified through the "durableSubscriptionName" property.

Parameters:
subscriptionDurable - whether the subscriptions are durable

setReceiveTimeout

public void setReceiveTimeout(long receiveTimeout)
Set the timeout to use for receive calls, in milliseconds.

Parameters:
receiveTimeout - the receiving timeout

setSessionTransacted

public void setSessionTransacted(boolean sessionTransacted)
Set the transaction mode that is used when creating a JMS Session

Parameters:
sessionTransacted - whether the transactions are enabled

setSessionAcknowledgeMode

public void setSessionAcknowledgeMode(int sessionAcknowledgeMode)
Set the JMS acknowledgement mode that is used when creating a JMS Session to send a message.

Parameters:
sessionAcknowledgeMode - the JMS acknowledgement mode

setSessionAcknowledgeModeName

public void setSessionAcknowledgeModeName(java.lang.String constantName)
Set the JMS acknowledgement mode by the name of the corresponding constant in the JMS Session interface

e.g. "CLIENT_ACKNOWLEDGE".

Parameters:
constantName - the acknowledgement mode name

setTransactionTimeout

public void setTransactionTimeout(int transactionTimeout)
Specify the transaction timeout to use for transactional wrapping, in seconds. Default is none, using the transaction manager's default timeout.

Parameters:
transactionTimeout - the transaction timeout in seconds

setAcceptMessagesWhileStopping

public void setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping)
Set whether to accept received messages while the listener container is in the process of stopping.

Parameters:
acceptMessagesWhileStopping - whether to accept messages while stopping

setConnectionFactory

public void setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
Set the ConnectionFactory to use for obtaining JMS Connections

Parameters:
connectionFactory - the connection factory implementation providing JMS connections

setDestinationResolver

public void setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver destinationResolver)
Set the DestinationResolver that is to be used to resolve Destination references for this accessor. The default resolver is a DynamicDestinationResolver. Specify a JndiDestinationResolver for resolving destination names as JNDI locations.

Parameters:
destinationResolver - the resolver for resolving JMS destinations

setExceptionListener

public void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
Set the JMS ExceptionListener to notify in case of a JMSException thrown by the registered message listener or the invocation infrastructure.

Parameters:
exceptionListener - the listener to notify for errors

Copyright (c) 2010-2012 AdroitLogic Private Ltd. All rights reserved.