Package org.apache.axis2.transport.jms
Class ServiceTaskManager
- java.lang.Object
-
- org.apache.axis2.transport.jms.ServiceTaskManager
-
public class ServiceTaskManager extends Object
Each service will have one ServiceTaskManager instance that will create, manage and also destroy idle tasks created for it, for message receipt. This will also allow individual tasks to cache the Connection, Session or Consumer as necessary, considering the transactionality required and user preference. This also acts as the ExceptionListener for all JMS connections made on behalf of the service. Since the ExceptionListener is notified by a JMS provider on a "serious" error, we simply try to re-connect. Thus a connection failure for a single task, will re-initialize the state afresh for the service, by discarding all connections.
-
-
Constructor Summary
Constructors Constructor Description ServiceTaskManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addJmsProperties(Map<String,String> jmsProperties)
int
getActiveTaskCount()
int
getCacheLevel()
int
getConcurrentConsumers()
javax.jms.ConnectionFactory
getConnectionFactory()
String
getConnFactoryJNDIName()
int
getConsumerCount()
Get the number of existing JMS message consumers.Context
getContext()
String
getDestinationJNDIName()
int
getDestinationType()
String
getDurableSubscriberName()
int
getIdleTaskExecutionLimit()
int
getInitialReconnectDuration()
Hashtable<String,String>
getJmsProperties()
int
getMaxConcurrentConsumers()
int
getMaxMessagesPerTask()
long
getMaxReconnectDuration()
String
getMessageSelector()
List<org.apache.axis2.transport.jms.ServiceTaskManager.MessageListenerTask>
getPollingTasks()
int
getReceiveTimeout()
double
getReconnectionProgressionFactor()
String
getServiceName()
int
getSessionAckMode()
int
getTransactionality()
String
getUserTransactionJNDIName()
boolean
isCacheUserTransaction()
boolean
isJmsSpec11()
boolean
isPubSubNoLocal()
boolean
isSessionTransacted()
boolean
isSubscriptionDurable()
void
pause()
Temporarily suspend receipt and processing of messages.void
removeJmsProperties(String key)
void
resume()
Resume receipt and processing of messages of paused tasksvoid
setCacheLevel(int cacheLevel)
void
setCacheUserTransaction(Boolean cacheUserTransaction)
void
setConcurrentConsumers(int concurrentConsumers)
void
setConnFactoryJNDIName(String connFactoryJNDIName)
void
setDestinationJNDIName(String destinationJNDIName)
void
setDestinationType(int destinationType)
void
setDurableSubscriberName(String durableSubscriberName)
void
setIdleTaskExecutionLimit(int idleTaskExecutionLimit)
void
setInitialReconnectDuration(int initialReconnectDuration)
void
setJmsMessageReceiver(JMSMessageReceiver jmsMessageReceiver)
void
setJmsSpec11(boolean jmsSpec11)
void
setMaxConcurrentConsumers(int maxConcurrentConsumers)
void
setMaxMessagesPerTask(int maxMessagesPerTask)
void
setMaxReconnectDuration(long maxReconnectDuration)
void
setMessageSelector(String messageSelector)
void
setPubSubNoLocal(Boolean pubSubNoLocal)
void
setReceiveTimeout(int receiveTimeout)
void
setReconnectionProgressionFactor(double reconnectionProgressionFactor)
void
setServiceName(String serviceName)
void
setServiceTaskManagerState(int serviceTaskManagerState)
void
setSessionAckMode(int sessionAckMode)
void
setSessionTransacted(Boolean sessionTransacted)
void
setSubscriptionDurable(Boolean subscriptionDurable)
void
setTransactionality(int transactionality)
void
setUserTransactionJNDIName(String userTransactionJNDIName)
void
setWorkerPool(WorkerPool workerPool)
void
start()
Start or re-start the Task Manager by shutting down any existing worker tasks and re-creating them.void
stop()
Shutdown the tasks and release any shared resources
-
-
-
Method Detail
-
start
public void start()
Start or re-start the Task Manager by shutting down any existing worker tasks and re-creating them. However, if this is STM is PAUSED, a start request is ignored. This applies for any connection failures during paused state as well, which then will not try to auto recover
-
stop
public void stop()
Shutdown the tasks and release any shared resources
-
pause
public void pause()
Temporarily suspend receipt and processing of messages. Accomplished by stopping the connection / or connections used by the poller tasks
-
resume
public void resume()
Resume receipt and processing of messages of paused tasks
-
getServiceName
public String getServiceName()
-
setServiceName
public void setServiceName(String serviceName)
-
getConnFactoryJNDIName
public String getConnFactoryJNDIName()
-
setConnFactoryJNDIName
public void setConnFactoryJNDIName(String connFactoryJNDIName)
-
getDestinationJNDIName
public String getDestinationJNDIName()
-
setDestinationJNDIName
public void setDestinationJNDIName(String destinationJNDIName)
-
getDestinationType
public int getDestinationType()
-
setDestinationType
public void setDestinationType(int destinationType)
-
getMessageSelector
public String getMessageSelector()
-
setMessageSelector
public void setMessageSelector(String messageSelector)
-
getTransactionality
public int getTransactionality()
-
setTransactionality
public void setTransactionality(int transactionality)
-
isSessionTransacted
public boolean isSessionTransacted()
-
setSessionTransacted
public void setSessionTransacted(Boolean sessionTransacted)
-
getSessionAckMode
public int getSessionAckMode()
-
setSessionAckMode
public void setSessionAckMode(int sessionAckMode)
-
isSubscriptionDurable
public boolean isSubscriptionDurable()
-
setSubscriptionDurable
public void setSubscriptionDurable(Boolean subscriptionDurable)
-
getDurableSubscriberName
public String getDurableSubscriberName()
-
setDurableSubscriberName
public void setDurableSubscriberName(String durableSubscriberName)
-
isPubSubNoLocal
public boolean isPubSubNoLocal()
-
setPubSubNoLocal
public void setPubSubNoLocal(Boolean pubSubNoLocal)
-
getConcurrentConsumers
public int getConcurrentConsumers()
-
setConcurrentConsumers
public void setConcurrentConsumers(int concurrentConsumers)
-
getMaxConcurrentConsumers
public int getMaxConcurrentConsumers()
-
setMaxConcurrentConsumers
public void setMaxConcurrentConsumers(int maxConcurrentConsumers)
-
getIdleTaskExecutionLimit
public int getIdleTaskExecutionLimit()
-
setIdleTaskExecutionLimit
public void setIdleTaskExecutionLimit(int idleTaskExecutionLimit)
-
getReceiveTimeout
public int getReceiveTimeout()
-
setReceiveTimeout
public void setReceiveTimeout(int receiveTimeout)
-
getCacheLevel
public int getCacheLevel()
-
setCacheLevel
public void setCacheLevel(int cacheLevel)
-
getInitialReconnectDuration
public int getInitialReconnectDuration()
-
setInitialReconnectDuration
public void setInitialReconnectDuration(int initialReconnectDuration)
-
getReconnectionProgressionFactor
public double getReconnectionProgressionFactor()
-
setReconnectionProgressionFactor
public void setReconnectionProgressionFactor(double reconnectionProgressionFactor)
-
getMaxReconnectDuration
public long getMaxReconnectDuration()
-
setMaxReconnectDuration
public void setMaxReconnectDuration(long maxReconnectDuration)
-
getMaxMessagesPerTask
public int getMaxMessagesPerTask()
-
setMaxMessagesPerTask
public void setMaxMessagesPerTask(int maxMessagesPerTask)
-
getUserTransactionJNDIName
public String getUserTransactionJNDIName()
-
setUserTransactionJNDIName
public void setUserTransactionJNDIName(String userTransactionJNDIName)
-
isCacheUserTransaction
public boolean isCacheUserTransaction()
-
setCacheUserTransaction
public void setCacheUserTransaction(Boolean cacheUserTransaction)
-
isJmsSpec11
public boolean isJmsSpec11()
-
setJmsSpec11
public void setJmsSpec11(boolean jmsSpec11)
-
removeJmsProperties
public void removeJmsProperties(String key)
-
getContext
public Context getContext()
-
getConnectionFactory
public javax.jms.ConnectionFactory getConnectionFactory()
-
getPollingTasks
public List<org.apache.axis2.transport.jms.ServiceTaskManager.MessageListenerTask> getPollingTasks()
-
setJmsMessageReceiver
public void setJmsMessageReceiver(JMSMessageReceiver jmsMessageReceiver)
-
setWorkerPool
public void setWorkerPool(WorkerPool workerPool)
-
getActiveTaskCount
public int getActiveTaskCount()
-
getConsumerCount
public int getConsumerCount()
Get the number of existing JMS message consumers.- Returns:
- the number of consumers
-
setServiceTaskManagerState
public void setServiceTaskManagerState(int serviceTaskManagerState)
-
-