org.apache.uima.adapter.jms.activemq

## Class UimaDefaultMessageListenerContainer

- java.lang.Object
- - org.springframework.jms.support.JmsAccessor
  - - org.springframework.jms.support.destination.JmsDestinationAccessor
    - - org.springframework.jms.listener.AbstractJmsListeningContainer
      - - org.springframework.jms.listener.AbstractMessageListenerContainer
        - - org.springframework.jms.listener.AbstractPollingMessageListenerContainer
          - - org.springframework.jms.listener.DefaultMessageListenerContainer
            - - org.apache.uima.adapter.jms.activemq.UimaDefaultMessageListenerContainer

- All Implemented Interfaces:
    javax.jms.ExceptionListener, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, org.springframework.jms.listener.MessageListenerContainer

      public class UimaDefaultMessageListenerContainer
      extends org.springframework.jms.listener.DefaultMessageListenerContainer
      implements javax.jms.ExceptionListener

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer

      `org.springframework.jms.listener.AbstractJmsListeningContainer.SharedConnectionNotInitializedException`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CM_PROCESS_SELECTOR_SUFFIX`
    `static String` | `GETMETA_SELECTOR_SUFFIX`
    `static int` | `HIGH_PRIORITY`
    `static String` | `PROCESS_SELECTOR_SUFFIX`
    `static boolean` | `terminating`

    - ### Fields inherited from class org.springframework.jms.listener.DefaultMessageListenerContainer

      `CACHE_AUTO, CACHE_CONNECTION, CACHE_CONSUMER, CACHE_NONE, CACHE_SESSION, DEFAULT_RECOVERY_INTERVAL, DEFAULT_THREAD_NAME_PREFIX`

    - ### Fields inherited from class org.springframework.jms.listener.AbstractPollingMessageListenerContainer

      `DEFAULT_RECEIVE_TIMEOUT`

    - ### Fields inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer

      `lifecycleMonitor, sharedConnectionMonitor`

    - ### Fields inherited from class org.springframework.jms.support.destination.JmsDestinationAccessor

      `RECEIVE_TIMEOUT_INDEFINITE_WAIT, RECEIVE_TIMEOUT_NO_WAIT`

    - ### Fields inherited from class org.springframework.jms.support.JmsAccessor

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UimaDefaultMessageListenerContainer()`
    `UimaDefaultMessageListenerContainer(boolean freeCasQueueListener)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterPropertiesSet()`
    `void` | `afterPropertiesSet(boolean propagate)` Called by Spring and some Uima AS components when all properties have been set.
    `void` | `closeConnection()` Closes shares connection to a broker
    `void` | `delegateStop()`
    `void` | `destroy()`
    `void` | `destroy(boolean stopImmediate)` Spins a shutdown thread and stops Sprint and ActiveMQ threads.
    `void` | `doDestroy()` Delegate shutdown to the super class
    `protected void` | `doInvokeListener(org.springframework.jms.listener.SessionAwareMessageListener l, javax.jms.Session s, javax.jms.Message m)` Callback called by Spring when it receives a messages.
    `String` | `getBrokerUrl()`
    `String` | `getDestinationName()`
    `org.apache.uima.aae.controller.Endpoint` | `getEndpoint()`
    `String` | `getEndpointName()`
    `javax.jms.Destination` | `getListenerEndpoint()`
    `org.springframework.core.task.TaskExecutor` | `getTaskExecutor()`
    `protected void` | `handleListenerException(Throwable t)`
    `protected void` | `handleListenerSetupFailure(Throwable t, boolean alreadyHandled)` This method is called by Spring when a listener fails
    `void` | `initializeContainer()`
    `boolean` | `isFreeCasQueueListener()`
    `boolean` | `isGetMetaListener()`
    `void` | `onException(javax.jms.JMSException arg0)`
    `protected void` | `recoverAfterListenerSetupFailure()`
    `protected void` | `refreshConnectionUntilSuccessful()` Overriden Spring's method that tries to recover from lost connection.
    `void` | `setConcurrentConsumers(int concurrentConsumers)` Intercept Spring call to increment number of consumer threads.
    `void` | `setConnectionFactory(javax.jms.ConnectionFactory aConnectionFactory)`
    `void` | `setController(org.apache.uima.aae.controller.AnalysisEngineController aController)`
    `void` | `setDestination(javax.jms.Destination aDestination)`
    `void` | `setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver resolver)`
    `void` | `setMessageListener(Object messageListener)` Intercept Spring call to inject application Pojo listener.
    `void` | `setMessageSelector(String messageSelector)` Called by Spring
    `protected void` | `setModifiedTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)`
    `void` | `setTargetedListener()`
    `void` | `setTargetEndpoint(org.apache.uima.aae.controller.Endpoint anEndpoint)`
    `void` | `setTaskExecutor(org.springframework.core.task.TaskExecutor aTaskExecutor)` Called by Spring to inject TaskExecutor
    `void` | `setTerminating()`
    `void` | `shutdownTaskExecutor(ThreadPoolExecutor tpe, boolean stopImmediate)`
    `void` | `stop()`

    - ### Methods inherited from class org.springframework.jms.listener.DefaultMessageListenerContainer

      `applyBackOffTime, createDefaultTaskExecutor, doInitialize, doRescheduleTask, doShutdown, establishSharedConnection, getActiveConsumerCount, getCacheLevel, getConcurrentConsumers, getIdleConsumerLimit, getIdleTaskExecutionLimit, getMaxConcurrentConsumers, getMaxMessagesPerTask, getScheduledConsumerCount, initialize, isRecovering, isRegisteredWithDestination, messageReceived, noMessageReceived, refreshDestination, scheduleNewInvokerIfAppropriate, setBackOff, setCacheLevel, setCacheLevelName, setConcurrency, setIdleConsumerLimit, setIdleTaskExecutionLimit, setMaxConcurrentConsumers, setMaxMessagesPerTask, setRecoveryInterval, setTaskExecutor, sharedConnectionEnabled, start, startSharedConnection, stop, stopSharedConnection`

    - ### Methods inherited from class org.springframework.jms.listener.AbstractPollingMessageListenerContainer

      `createListenerConsumer, doReceiveAndExecute, getConnection, getReceiveTimeout, getSession, getTransactionManager, isSessionLocallyTransacted, receiveAndExecute, receiveMessage, setReceiveTimeout, setSessionTransacted, setTransactionManager, setTransactionName, setTransactionTimeout, shouldCommitAfterNoMessageReceived`

    - ### Methods inherited from class org.springframework.jms.listener.AbstractMessageListenerContainer

      `checkMessageListener, commitIfNecessary, createConsumer, doExecuteListener, doInvokeListener, executeListener, getDefaultSubscriptionName, getDestination, getDestinationDescription, getDurableSubscriptionName, getErrorHandler, getExceptionListener, getMessageConverter, getMessageListener, getMessageSelector, getSubscriptionName, invokeErrorHandler, invokeExceptionListener, invokeListener, isAcceptMessagesWhileStopping, isExposeListenerSession, isPubSubNoLocal, isReplyPubSubDomain, isSubscriptionDurable, isSubscriptionShared, rollbackIfNecessary, rollbackOnExceptionIfNecessary, setAcceptMessagesWhileStopping, setDestinationName, setDurableSubscriptionName, setErrorHandler, setExceptionListener, setExposeListenerSession, setMessageConverter, setPubSubNoLocal, setReplyPubSubDomain, setSubscriptionDurable, setSubscriptionName, setSubscriptionShared, setupMessageListener, validateConfiguration`

    - ### Methods inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer

      `createSharedConnection, doStart, doStop, getBeanName, getClientId, getPausedTaskCount, getPhase, getSharedConnection, isActive, isAutoStartup, isRunning, logRejectedTask, prepareSharedConnection, refreshSharedConnection, rescheduleTaskIfNecessary, resumePausedTasks, runningAllowed, setAutoStartup, setBeanName, setClientId, setPhase, shutdown`

    - ### Methods inherited from class org.springframework.jms.support.destination.JmsDestinationAccessor

      `getDestinationResolver, isPubSubDomain, receiveFromConsumer, resolveDestinationName, setPubSubDomain`

    - ### Methods inherited from class org.springframework.jms.support.JmsAccessor

      `convertJmsAccessException, createConnection, createSession, getConnectionFactory, getSessionAcknowledgeMode, isClientAcknowledge, isSessionTransacted, setSessionAcknowledgeMode, setSessionAcknowledgeModeName`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.springframework.jms.listener.MessageListenerContainer

      `getDestinationResolver, isPubSubDomain`

    - ### Methods inherited from interface org.springframework.context.SmartLifecycle

      `isAutoStartup`

    - ### Methods inherited from interface org.springframework.context.Lifecycle

      `isRunning`

    - ### Methods inherited from interface org.springframework.context.Phased

      `getPhase`

- - ### Field Detail

    - #### PROCESS_SELECTOR_SUFFIX

          public static final String PROCESS_SELECTOR_SUFFIX

      See Also:
        Constant Field Values

    - #### CM_PROCESS_SELECTOR_SUFFIX

          public static final String CM_PROCESS_SELECTOR_SUFFIX

      See Also:
        Constant Field Values

    - #### GETMETA_SELECTOR_SUFFIX

          public static final String GETMETA_SELECTOR_SUFFIX

      See Also:
        Constant Field Values

    - #### HIGH_PRIORITY

          public static final int HIGH_PRIORITY

      See Also:
        Constant Field Values

    - #### terminating

          public static volatile boolean terminating

  - ### Constructor Detail

    - #### UimaDefaultMessageListenerContainer

          public UimaDefaultMessageListenerContainer()

    - #### UimaDefaultMessageListenerContainer

          public UimaDefaultMessageListenerContainer(boolean freeCasQueueListener)

  - ### Method Detail

    - #### setTargetedListener

          public void setTargetedListener()

    - #### refreshConnectionUntilSuccessful

          protected void refreshConnectionUntilSuccessful()

      Overriden Spring's method that tries to recover from lost connection. We dont want to recover when the service is stopping.
      Overrides:
        `refreshConnectionUntilSuccessful` in class `org.springframework.jms.listener.DefaultMessageListenerContainer`

    - #### recoverAfterListenerSetupFailure

          protected void recoverAfterListenerSetupFailure()

      Overrides:
        `recoverAfterListenerSetupFailure` in class `org.springframework.jms.listener.DefaultMessageListenerContainer`

    - #### setTerminating

          public void setTerminating()

    - #### setController

          public void setController(org.apache.uima.aae.controller.AnalysisEngineController aController)

    - #### handleListenerSetupFailure

          protected void handleListenerSetupFailure(Throwable t,
                                                    boolean alreadyHandled)

      This method is called by Spring when a listener fails
      Overrides:
        `handleListenerSetupFailure` in class `org.springframework.jms.listener.DefaultMessageListenerContainer`

    - #### getEndpoint

          public org.apache.uima.aae.controller.Endpoint getEndpoint()

    - #### handleListenerException

          protected void handleListenerException(Throwable t)

      Overrides:
        `handleListenerException` in class `org.springframework.jms.listener.AbstractMessageListenerContainer`

    - #### isGetMetaListener

          public boolean isGetMetaListener()

    - #### initializeContainer

          public void initializeContainer()

    - #### setConcurrentConsumers

          public void setConcurrentConsumers(int concurrentConsumers)

      Intercept Spring call to increment number of consumer threads. If the value > 1, don't propagate to Spring. A new listener will be injected and it will use provided number of consumer threads.
      Overrides:
        `setConcurrentConsumers` in class `org.springframework.jms.listener.DefaultMessageListenerContainer`

    - #### setMessageListener

          public void setMessageListener(Object messageListener)

      Intercept Spring call to inject application Pojo listener. Don't propagate the listener up to Spring just yet. If more than one consumer thread is used, a different listener will be injected.
      Overrides:
        `setMessageListener` in class `org.springframework.jms.listener.AbstractMessageListenerContainer`

    - #### afterPropertiesSet

          public void afterPropertiesSet()

      Specified by:
        `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`
      Overrides:
        `afterPropertiesSet` in class `org.springframework.jms.listener.AbstractJmsListeningContainer`

    - #### afterPropertiesSet

          public void afterPropertiesSet(boolean propagate)

      Called by Spring and some Uima AS components when all properties have been set. This method spins a thread in which the listener is initialized.

    - #### getDestinationName

          public String getDestinationName()

      Overrides:
        `getDestinationName` in class `org.springframework.jms.listener.AbstractMessageListenerContainer`

    - #### getEndpointName

          public String getEndpointName()

    - #### getBrokerUrl

          public String getBrokerUrl()

    - #### setConnectionFactory

          public void setConnectionFactory(javax.jms.ConnectionFactory aConnectionFactory)

      Overrides:
        `setConnectionFactory` in class `org.springframework.jms.support.JmsAccessor`

    - #### setDestinationResolver

          public void setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver resolver)

      Overrides:
        `setDestinationResolver` in class `org.springframework.jms.support.destination.JmsDestinationAccessor`

    - #### closeConnection

          public void closeConnection()
                               throws Exception

      Closes shares connection to a broker
      Throws:
        `Exception`

    - #### setDestination

          public void setDestination(javax.jms.Destination aDestination)

      Overrides:
        `setDestination` in class `org.springframework.jms.listener.AbstractMessageListenerContainer`

    - #### getListenerEndpoint

          public javax.jms.Destination getListenerEndpoint()

    - #### onException

          public void onException(javax.jms.JMSException arg0)

      Specified by:
        `onException` in interface `javax.jms.ExceptionListener`

    - #### setTargetEndpoint

          public void setTargetEndpoint(org.apache.uima.aae.controller.Endpoint anEndpoint)

    - #### isFreeCasQueueListener

          public boolean isFreeCasQueueListener()

    - #### setModifiedTaskExecutor

          protected void setModifiedTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)

    - #### doDestroy

          public void doDestroy()

      Delegate shutdown to the super class

    - #### setMessageSelector

          public void setMessageSelector(String messageSelector)

      Called by Spring
      Overrides:
        `setMessageSelector` in class `org.springframework.jms.listener.AbstractMessageListenerContainer`

    - #### doInvokeListener

          protected void doInvokeListener(org.springframework.jms.listener.SessionAwareMessageListener l,
                                          javax.jms.Session s,
                                          javax.jms.Message m)

      Callback called by Spring when it receives a messages. Its purpose is to assign high priority for targeted messages.
      Overrides:
        `doInvokeListener` in class `org.springframework.jms.listener.AbstractMessageListenerContainer`

    - #### shutdownTaskExecutor

          public void shutdownTaskExecutor(ThreadPoolExecutor tpe,
                                           boolean stopImmediate)
                                    throws InterruptedException

      Throws:
        `InterruptedException`

    - #### destroy

          public void destroy()

      Specified by:
        `destroy` in interface `org.springframework.beans.factory.DisposableBean`
      Overrides:
        `destroy` in class `org.springframework.jms.listener.AbstractJmsListeningContainer`

    - #### destroy

          public void destroy(boolean stopImmediate)

      Spins a shutdown thread and stops Sprint and ActiveMQ threads.

    - #### setTaskExecutor

          public void setTaskExecutor(org.springframework.core.task.TaskExecutor aTaskExecutor)

      Called by Spring to inject TaskExecutor

    - #### getTaskExecutor

          public org.springframework.core.task.TaskExecutor getTaskExecutor()

    - #### delegateStop

          public void delegateStop()

    - #### stop

          public void stop()
                    throws org.springframework.jms.JmsException

      Specified by:
        `stop` in interface `org.springframework.context.Lifecycle`
      Overrides:
        `stop` in class `org.springframework.jms.listener.AbstractJmsListeningContainer`
      Throws:
        `org.springframework.jms.JmsException`

Copyright © 2006–2018 The Apache Software Foundation. All rights reserved.