Class AdaptrisPollingConsumer

    • Constructor Detail

      • AdaptrisPollingConsumer

        public AdaptrisPollingConsumer()
    • Method Detail

      • stop

        public void stop()
        Description copied from interface: ComponentLifecycle
        Stop the component

        A stopped component is not expected to be ready to process messages. In the case of AdaptrisMessageConsumer, calling stop will pause message delivery. Throwing a RuntimeException may cause unintended consequences

        See Also:
        ComponentLifecycle.stop()
      • close

        public void close()
        Description copied from interface: ComponentLifecycle
        Closes the component.

        A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException may cause unintended consequences

        See Also:
        ComponentLifecycle.close()
      • continueProcessingMessages

        public final boolean continueProcessingMessages​(int currentCount)
        Whether or not to continue processing messages.

        Concrete sub-classes should call this after processing each message before they start processing the next one.

        Returns:
        true if it's ok to carry on.
        See Also:
        setReacquireLockBetweenMessages(Boolean), setMaxMessagesPerPoll(Integer)
      • releaseLock

        protected void releaseLock()
      • processMessages

        protected abstract int processMessages()

        Implemented by protocol-specific sub-classes.

      • setReacquireLockBetweenMessages

        public void setReacquireLockBetweenMessages​(java.lang.Boolean b)

        Specify whether concrete sub-classes should attempt to reacquire the lock in between processing messages. Releasing then attemtping to reqcquire the log gives other threads an opportunity to obtain the lock. This is significant in high volume environments, particularly where messages are not processed in discreet batches e.g. JmsPollingConsumer.

        Parameters:
        b - the lock flag
      • getReacquireLockBetweenMessages

        public java.lang.Boolean getReacquireLockBetweenMessages()

        Get the reacquire lock flag.

        Returns:
        true if the lock should be reacquired between messages
        See Also:
        setReacquireLockBetweenMessages(Boolean)
      • getMaxMessagesPerPoll

        public java.lang.Integer getMaxMessagesPerPoll()
      • setMaxMessagesPerPoll

        public void setMaxMessagesPerPoll​(java.lang.Integer max)
        Set the maximum number of messages that should be processed in any one poll trigger.

        It can be arbitrarily useful to limit the number of messages processed per poll. For instance, you are using QuartzCronPoller and you need to ensure a time period when no activity occurs. In the event that a large number of documents are ready to process just before the no-activity-time; then without a maximum the adapter will continue processing until all documents are handled.

        Parameters:
        max - the max messages per poll, default is infinite if not specified.
      • getPoller

        public Poller getPoller()
      • setPoller

        public void setPoller​(Poller s)
        Set the Poller to use.
        Parameters:
        s - the poller