Interface IAgent

    • Method Detail

      • init

        void init​(Properties props)
           throws AgentException
        Initializes the agent with a set of properties.

        Those properties will be advertised by the implementors.

        Parameters:
        props - The properties used to initialize this agent.
        Throws:
        AgentException - if the call fails.
      • getProperties

        Properties getProperties()
        Returns the properties with which this agent has been initialized, or null if this method is called before the initialization.
        Returns:
        the properties with which this agent has been initialized.
      • getStatus

        IAgent.State getStatus()
        Returns the current state of this agent.
        Returns:
        The current state of this agent.
      • start

        void start()
            throws AgentException
        Starts the agent. The agent starts performing its operations.

        An exception will be thrown if it has been paused or started before.

        Starting the agent after it has been stopped is not supported. This kind of lifecycle operation should be done using pause() and resume().

        Throws:
        AgentException - if the call fails.
      • pause

        void pause()
            throws AgentException
        Pauses the agent. The agent stops its operations and does not perform work anymore. The agent can be resumed in order to perform work again.

        An exception will be thrown if the pause does not follow a start() or if the agent has already been stopped or paused.

        Throws:
        AgentException - if the call fails.
      • resume

        void resume()
             throws AgentException
        Resumes the agent. The agent resumes its operations and performs work again.

        An exception will be thrown if the resume does not follow a pause() or if the agent has already been stopped.

        Throws:
        AgentException - if the call fails.
      • stop

        void stop()
           throws AgentException
        Definitely stops the agent. This operation is equivalent to a shutdown operation of the agent, and it cannot be restarted.

        To pause and later resume the agent use the appropriate pause() and resume() APIs.

        An exception will be thrown if the agent is already stopped.

        Throws:
        AgentException - if the call fails.