org.apache.axis2.transport.jms
Class ServiceTaskManager

java.lang.Object
  extended by org.apache.axis2.transport.jms.ServiceTaskManager

public class ServiceTaskManager
extends java.lang.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
ServiceTaskManager()
           
 
Method Summary
 void addJmsProperties(java.util.Map<java.lang.String,java.lang.String> jmsProperties)
           
 int getActiveTaskCount()
           
 int getCacheLevel()
           
 int getConcurrentConsumers()
           
 javax.jms.ConnectionFactory getConnectionFactory()
           
 java.lang.String getConnFactoryJNDIName()
           
 javax.naming.Context getContext()
           
 java.lang.String getDestinationJNDIName()
           
 int getDestinationType()
           
 java.lang.String getDurableSubscriberName()
           
 int getIdleTaskExecutionLimit()
           
 int getInitialReconnectDuration()
           
 java.util.Hashtable<java.lang.String,java.lang.String> getJmsProperties()
           
 int getMaxConcurrentConsumers()
           
 int getMaxMessagesPerTask()
           
 long getMaxReconnectDuration()
           
 java.lang.String getMessageSelector()
           
 java.util.List<org.apache.axis2.transport.jms.ServiceTaskManager.MessageListenerTask> getPollingTasks()
           
 int getReceiveTimeout()
           
 double getReconnectionProgressionFactor()
           
 java.lang.String getServiceName()
           
 int getSessionAckMode()
           
 int getTransactionality()
           
 java.lang.String getUserTransactionJNDIName()
           
 boolean isCacheUserTransaction()
           
 boolean isJmsSpec11()
           
 boolean isPubSubNoLocal()
           
 boolean isSessionTransacted()
           
 boolean isSubscriptionDurable()
           
 void pause()
          Temporarily suspend receipt and processing of messages.
 void removeJmsProperties(java.lang.String key)
           
 void resume()
          Resume receipt and processing of messages of paused tasks
 void setCacheLevel(int cacheLevel)
           
 void setCacheUserTransaction(java.lang.Boolean cacheUserTransaction)
           
 void setConcurrentConsumers(int concurrentConsumers)
           
 void setConnFactoryJNDIName(java.lang.String connFactoryJNDIName)
           
 void setDestinationJNDIName(java.lang.String destinationJNDIName)
           
 void setDestinationType(int destinationType)
           
 void setDurableSubscriberName(java.lang.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(java.lang.String messageSelector)
           
 void setPubSubNoLocal(java.lang.Boolean pubSubNoLocal)
           
 void setReceiveTimeout(int receiveTimeout)
           
 void setReconnectionProgressionFactor(double reconnectionProgressionFactor)
           
 void setServiceName(java.lang.String serviceName)
           
 void setServiceTaskManagerState(int serviceTaskManagerState)
           
 void setSessionAckMode(int sessionAckMode)
           
 void setSessionTransacted(java.lang.Boolean sessionTransacted)
           
 void setSubscriptionDurable(java.lang.Boolean subscriptionDurable)
           
 void setTransactionality(int transactionality)
           
 void setUserTransactionJNDIName(java.lang.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 java.lang.String getServiceName()

setServiceName

public void setServiceName(java.lang.String serviceName)

getConnFactoryJNDIName

public java.lang.String getConnFactoryJNDIName()

setConnFactoryJNDIName

public void setConnFactoryJNDIName(java.lang.String connFactoryJNDIName)

getDestinationJNDIName

public java.lang.String getDestinationJNDIName()

setDestinationJNDIName

public void setDestinationJNDIName(java.lang.String destinationJNDIName)

getDestinationType

public int getDestinationType()

setDestinationType

public void setDestinationType(int destinationType)

getMessageSelector

public java.lang.String getMessageSelector()

setMessageSelector

public void setMessageSelector(java.lang.String messageSelector)

getTransactionality

public int getTransactionality()

setTransactionality

public void setTransactionality(int transactionality)

isSessionTransacted

public boolean isSessionTransacted()

setSessionTransacted

public void setSessionTransacted(java.lang.Boolean sessionTransacted)

getSessionAckMode

public int getSessionAckMode()

setSessionAckMode

public void setSessionAckMode(int sessionAckMode)

isSubscriptionDurable

public boolean isSubscriptionDurable()

setSubscriptionDurable

public void setSubscriptionDurable(java.lang.Boolean subscriptionDurable)

getDurableSubscriberName

public java.lang.String getDurableSubscriberName()

setDurableSubscriberName

public void setDurableSubscriberName(java.lang.String durableSubscriberName)

isPubSubNoLocal

public boolean isPubSubNoLocal()

setPubSubNoLocal

public void setPubSubNoLocal(java.lang.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 java.lang.String getUserTransactionJNDIName()

setUserTransactionJNDIName

public void setUserTransactionJNDIName(java.lang.String userTransactionJNDIName)

isCacheUserTransaction

public boolean isCacheUserTransaction()

setCacheUserTransaction

public void setCacheUserTransaction(java.lang.Boolean cacheUserTransaction)

isJmsSpec11

public boolean isJmsSpec11()

setJmsSpec11

public void setJmsSpec11(boolean jmsSpec11)

getJmsProperties

public java.util.Hashtable<java.lang.String,java.lang.String> getJmsProperties()

addJmsProperties

public void addJmsProperties(java.util.Map<java.lang.String,java.lang.String> jmsProperties)

removeJmsProperties

public void removeJmsProperties(java.lang.String key)

getContext

public javax.naming.Context getContext()

getConnectionFactory

public javax.jms.ConnectionFactory getConnectionFactory()

getPollingTasks

public java.util.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()

setServiceTaskManagerState

public void setServiceTaskManagerState(int serviceTaskManagerState)


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.