Class 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 Detail

      • ServiceTaskManager

        public ServiceTaskManager()
    • 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)
      • addJmsProperties

        public void addJmsProperties​(Map<String,​String> jmsProperties)
      • 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)