Class AcquisitionTopic

    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        define serialVersionUID for interoperability
        See Also:
        Constant Field Values
      • logger

        private static final Logger logger
      • DEBUG

        private static final boolean DEBUG
      • acquisitionModule

        private transient AcquisitionModule acquisitionModule
        The acquisition module.
      • properties

        private Properties properties
        Stores the last set of properties defined.
      • lastMessageId

        private String lastMessageId
        Stores the id of the last message received to avoid duplicates.
      • msgCount

        private long msgCount
        The number of produced messages.
      • diff_max

        private long diff_max
        The threshold of messages send by the handler in the engine
      • diff_min

        private long diff_min
      • pause

        private boolean pause
      • acquisitionClassName

        private String acquisitionClassName
        The acquisition class name.
      • acquisitionNotNb

        private transient long acquisitionNotNb
    • Constructor Detail

      • AcquisitionTopic

        public AcquisitionTopic()
    • Method Detail

      • getDiffMax

        public final long getDiffMax()
        Returns the maximum number of acquired messages waiting to be handled by the destination. When the number of messages waiting to be handled is greater the acquisition handler is temporarily stopped.

        A value lesser or equal to 0 disables the mechanism.

        Returns:
        the maximum number of acquired messages waiting to be handled by the destination.
      • getDiffMin

        public final long getDiffMin()
        Returns the minimum threshold of acquired messages waiting to be handled by the destination for restarting the acquisition handler.
        Returns:
        the minimum threshold of acquired messages waiting to be handled by the destination.
      • initialize

        public void initialize​(boolean firstTime)
        Description copied from class: Topic
        Initializes the destination.
        Overrides:
        initialize in class Topic
        Parameters:
        firstTime - true when first called by the factory
      • getAcquiredMsgCount

        public final long getAcquiredMsgCount()
        Returns the number of messages acquired by the acquisition handler. Be careful this counter is reseted at each time the server starts.
        Returns:
        the number of messages acquired by the acquisition handler.
      • react

        public void react​(AgentId from,
                          Notification not)
                   throws Exception
        Description copied from class: Topic
        Distributes the received notifications to the appropriate reactions.
        Overrides:
        react in class Topic
        Parameters:
        from - agent sending notification
        not - notification to react to
        Throws:
        Exception - unspecialized exception
      • agentFinalize

        public void agentFinalize​(boolean lastTime)
        Description copied from class: Destination
        Finalizes the agent before it is garbaged.
        Overrides:
        agentFinalize in class Destination
        Parameters:
        lastTime - true if the destination is deleted
      • startHandler

        protected Properties startHandler​(Properties prop)
                                   throws Exception
        Start the handler.
        Parameters:
        prop - properties for start if needed
        Returns:
        properties for the reply.
        Throws:
        Exception
      • stopHandler

        protected Properties stopHandler​(Properties prop)
                                  throws Exception
        Stop the handler.
        Parameters:
        prop - properties for stop if needed
        Returns:
        properties for the reply.
        Throws:
        Exception
      • acquisitionNot

        private void acquisitionNot​(AgentId from,
                                    AcquisitionNot not)
        This method process messages from the acquisition module. The method addClientMessages of base implementation is used to handle incoming messages.
        Parameters:
        not -
      • getExpiration

        public long getExpiration()
        Description copied from interface: AcquisitionMBean
        Returns the expiration value for produced messages.
        Specified by:
        getExpiration in interface AcquisitionMBean
        Returns:
        the expiration value for produced messages.
      • getPriority

        public int getPriority()
        Description copied from interface: AcquisitionMBean
        Returns the priority of produced messages.
        Specified by:
        getPriority in interface AcquisitionMBean
        Returns:
        the priority of produced messages.
      • isMessagePersistent

        public boolean isMessagePersistent()
        Description copied from interface: AcquisitionMBean
        Returns true if the messages produced are persistent.
        Specified by:
        isMessagePersistent in interface AcquisitionMBean
        Returns:
        true if the messages produced are persistent.
      • setExpiration

        public void setExpiration​(long expiration)
        Description copied from interface: AcquisitionMBean
        Sets the expiration value for produced messages.
        Specified by:
        setExpiration in interface AcquisitionMBean
        Parameters:
        expiration - the expiration to set.
      • setMessagePersistent

        public void setMessagePersistent​(boolean isPersistent)
        Description copied from interface: AcquisitionMBean
        Sets the DeliveryMode value for the produced messages. If the parameter is true the messages produced are persistent.
        Specified by:
        setMessagePersistent in interface AcquisitionMBean
        Parameters:
        isPersistent - if true the messages produced are persistent.
      • setPriority

        public void setPriority​(int priority)
        Description copied from interface: AcquisitionMBean
        Sets the priority of produced messages.
        Specified by:
        setPriority in interface AcquisitionMBean
        Parameters:
        priority - the priority to set.
      • close

        private void close()