Interface MessageConsumer

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void delete()
      Deletes the component, removes all persistent data.
      float getAverageLoad1()
      Returns the load averages for the last minute.
      float getAverageLoad15()
      Returns the load averages for the past 15 minutes.
      float getAverageLoad5()
      Returns the load averages for the past 5 minutes.
      String getDomainName()
      Returns the corresponding domain's name.
      String getName()
      Returns this MessageConsumer's name.
      MessageQueue getQueue()
      Get this consumer's MessageQueue.
      void insert​(Message msg)
      Insert a message in the MessageQueue.
      boolean isRunning()
      Tests if the component is alive.
      void post​(Message msg)
      Adds a message in "ready to deliver" list.
      void postAndValidate​(Message msg)
      Posts a message and validates it at the same time.
      void restore()
      Restores logical clock information from persistent storage.
      void save()
      Saves logical clock information to persistent storage.
      void start()
      Causes this component to begin execution.
      void stop()
      Forces the component to stop executing.
      void validate()
      Validates all messages pushed in queue during transaction session.
    • Method Detail

      • getName

        String getName()
        Returns this MessageConsumer's name.
        Returns:
        this MessageConsumer's name.
      • getDomainName

        String getDomainName()
        Returns the corresponding domain's name.
        Returns:
        this domain's name.
      • insert

        void insert​(Message msg)
        Insert a message in the MessageQueue. This method is used during initialization to restore the component state from persistent storage.
        Parameters:
        msg - the message
      • save

        void save()
           throws IOException
        Saves logical clock information to persistent storage.
        Throws:
        IOException - an error occurs.
      • restore

        void restore()
              throws Exception
        Restores logical clock information from persistent storage.
        Throws:
        Exception - an error occurs.
      • post

        void post​(Message msg)
           throws Exception
        Adds a message in "ready to deliver" list. This method allocates a new time stamp to the message ; be Careful, changing the stamp imply the filename change too.
        Parameters:
        msg - the message to deliver.
        Throws:
        Exception - an error occurs.
      • postAndValidate

        void postAndValidate​(Message msg)
                      throws Exception
        Posts a message and validates it at the same time.
        Parameters:
        msg - the message to deliver.
        Throws:
        Exception - an error occurs.
      • validate

        void validate()
        Validates all messages pushed in queue during transaction session.
      • start

        void start()
            throws Exception
        Causes this component to begin execution.
        Throws:
        Exception - an error occurs.
        See Also:
        stop()
      • stop

        void stop()
        Forces the component to stop executing.
        See Also:
        start()
      • delete

        void delete()
             throws IllegalStateException
        Deletes the component, removes all persistent data. The component may have been previously stopped, and removed from MessageConsumer list. This operation use Transaction calls, you may use commit to validate it.
        Throws:
        IllegalStateException - an error occurs.
        See Also:
        Transaction
      • getQueue

        MessageQueue getQueue()
        Get this consumer's MessageQueue. Use in administration and debug tasks, should be replaced by a common attribute.
        Returns:
        this MessageConsumer's queue.
      • isRunning

        boolean isRunning()
        Tests if the component is alive. A MessageConsumer is alive if it has been started and has not yet stopped.
        Returns:
        true if this MessageConsumer is alive; false otherwise.
      • getAverageLoad1

        float getAverageLoad1()
        Returns the load averages for the last minute.
        Returns:
        the load averages for the last minute.
      • getAverageLoad5

        float getAverageLoad5()
        Returns the load averages for the past 5 minutes.
        Returns:
        the load averages for the past 5 minutes.
      • getAverageLoad15

        float getAverageLoad15()
        Returns the load averages for the past 15 minutes.
        Returns:
        the load averages for the past 15 minutes.