Class XAJmsConsumerImpl

    • Field Detail

      • consumer

        protected transient javax.jms.MessageConsumer consumer
      • session

        protected transient javax.jms.XASession session
      • executor

        protected transient java.util.concurrent.ScheduledExecutorService executor
      • pollerTask

        protected transient java.util.concurrent.ScheduledFuture<?> pollerTask
      • currentTxId

        protected transient java.lang.String currentTxId
      • consumeLock

        protected static final java.util.concurrent.locks.ReentrantLock consumeLock
    • Constructor Detail

      • XAJmsConsumerImpl

        public XAJmsConsumerImpl()

        Creates a new instance. Default session type is client acknowledge, default JMS message type is text.

    • Method Detail

      • createConsumer

        protected abstract javax.jms.MessageConsumer createConsumer()
                                                             throws javax.jms.JMSException,
                                                                    CoreException
        Throws:
        javax.jms.JMSException
        CoreException
      • startProcessing

        protected void startProcessing()
      • processXAMessages

        protected void processXAMessages()
      • handleXAException

        protected void handleXAException​(java.lang.Exception exception)
      • rollbackIfRequired

        protected boolean rollbackIfRequired()
        If the current transaction has been marked rollback only, lets do that.
      • handleException

        protected void handleException​(java.lang.Exception ex)
      • beginTransaction

        protected void beginTransaction()
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • commitTransaction

        protected boolean commitTransaction​(int messageNumber)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • commitTransaction

        protected boolean commitTransaction()
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • rollbackTransaction

        protected void rollbackTransaction​(boolean expected)
      • globalLock

        protected boolean globalLock()
      • getMessagesInCurrentTransaction

        public int getMessagesInCurrentTransaction()
      • setMessagesInCurrentTransaction

        public void setMessagesInCurrentTransaction​(int messagesInCurrentTransaction)
      • setOnMessageHandler

        protected void setOnMessageHandler​(XAOnMessageHandler onMessageHandler)
      • getConsumer

        public javax.jms.MessageConsumer getConsumer()
      • setConsumer

        public void setConsumer​(javax.jms.MessageConsumer consumer)
      • withEndpoint

        public <T extends XAJmsConsumerImpl> T withEndpoint​(java.lang.String s)
      • messageSelector

        protected java.lang.String messageSelector()
      • endpoint

        protected java.lang.String endpoint()
      • getMaxBatch

        @NotNull
        public @javax.validation.constraints.NotNull int getMaxBatch()
      • setMaxBatch

        public void setMaxBatch​(@NotNull
                                @javax.validation.constraints.NotNull int maxBatch)
      • getMessageTranslator

        @NotNull
        @NonNull
        public @NotNull @NonNull MessageTypeTranslator getMessageTranslator()
      • setMessageTranslator

        public void setMessageTranslator​(@NotNull @NonNull
                                         @NotNull @NonNull MessageTypeTranslator messageTranslator)
      • getCorrelationIdSource

        @NotNull
        public @NotNull CorrelationIdSource getCorrelationIdSource()
      • setCorrelationIdSource

        public void setCorrelationIdSource​(@NotNull
                                           @NotNull CorrelationIdSource correlationIdSource)
      • getReceiveWait

        @NotNull
        public @NotNull TimeInterval getReceiveWait()
      • setReceiveWait

        public void setReceiveWait​(@NotNull
                                   @NotNull TimeInterval receiveWait)
      • getMaxTransactionTime

        @NotNull
        public @NotNull TimeInterval getMaxTransactionTime()
      • setMaxTransactionTime

        public void setMaxTransactionTime​(@NotNull
                                          @NotNull TimeInterval maxTransactionTime)
      • getXaResourceName

        @NotNull
        @NonNull
        public @NotNull @NonNull java.lang.String getXaResourceName()
        Name to enlist a resource to the transaction manager. Must be globally unique. A UUID is used if left empty.
      • setXaResourceName

        public void setXaResourceName​(@NotNull @NonNull
                                      @NotNull @NonNull java.lang.String xaResourceName)
        Name to enlist a resource to the transaction manager. Must be globally unique. A UUID is used if left empty.
      • setTransactionManager

        public void setTransactionManager​(TransactionManager transactionManager)
      • getXaExceptionHandler

        @NotNull
        public @NotNull com.adaptris.xa.jms.exception.XAExceptionHandler getXaExceptionHandler()
      • setXaExceptionHandler

        public void setXaExceptionHandler​(@NotNull
                                          @NotNull com.adaptris.xa.jms.exception.XAExceptionHandler xaExceptionHandler)
      • getRecreateConsumerOnError

        public java.lang.Boolean getRecreateConsumerOnError()
      • setRecreateConsumerOnError

        public void setRecreateConsumerOnError​(java.lang.Boolean recreateConsumerOnError)
      • getGlobalLock

        public java.lang.Boolean getGlobalLock()
      • setGlobalLock

        public void setGlobalLock​(java.lang.Boolean globalLock)
      • getEndpoint

        public java.lang.String getEndpoint()
        The RFC6167 format topic/queue.
      • setEndpoint

        public void setEndpoint​(java.lang.String endpoint)
        The RFC6167 format topic/queue.
      • getMessageSelector

        public java.lang.String getMessageSelector()
        The message selector to use when matching messages to consume
      • setMessageSelector

        public void setMessageSelector​(java.lang.String messageSelector)
        The message selector to use when matching messages to consume