bdi4jade.message

## Class BDIAgentMsgReceiver

- java.lang.Object
- - jade.core.behaviours.Behaviour
  - - jade.core.behaviours.SimpleBehaviour
    - - jade.proto.states.MsgReceiver
      - - bdi4jade.message.BDIAgentMsgReceiver

- All Implemented Interfaces:
    java.io.Serializable

      public class BDIAgentMsgReceiver
      extends jade.proto.states.MsgReceiver

  This class extends the `MsgReceiver` behavior from the JADE platform and is responsible for receiving agent messages and creating `MessageGoal` so that a BDI agent can process it. Message goals are creates solely if there is an agent plan of any capability that is able to process the message.
  Author:
    Ingrid Nunes
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `BDIAgentMsgReceiver.BDIAgentMatchExpression` This class implements the `MessageTemplate.MatchExpression` interface from JADE and is responsible for verifying if there is at least one agent capability with a plan that is able to process a given message.

    - ### Nested classes/interfaces inherited from class jade.core.behaviours.Behaviour

      `jade.core.behaviours.Behaviour.RunnableChangedEvent`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.Object` | `MSG_KEY`

    - ### Fields inherited from class jade.proto.states.MsgReceiver

      `deadline, INFINITE, INTERRUPTED, receivedMsgKey, template, TIMEOUT_EXPIRED`

    - ### Fields inherited from class jade.core.behaviours.Behaviour

      `myAgent, myEvent, NOTIFY_DOWN, NOTIFY_UP, parent, STATE_BLOCKED, STATE_READY, STATE_RUNNING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BDIAgentMsgReceiver(BDIAgent agent)` Initializes this message receiver, which is associated with a BDI agent.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `done()` Returns always false, as this behavior is responsible for message processing while a BDI agent is alive.
    `protected void` | `handleMessage(jade.lang.acl.ACLMessage msg)` Creates a `MessageGoal` for the received message, when handling the message.

    - ### Methods inherited from class jade.proto.states.MsgReceiver

      `action, interrupt, onEnd, reset, setDeadline, setReceivedKey, setTemplate`

    - ### Methods inherited from class jade.core.behaviours.SimpleBehaviour

      `reset`

    - ### Methods inherited from class jade.core.behaviours.Behaviour

      `actionWrapper, block, block, getAgent, getBehaviourName, getDataStore, getExecutionState, getParent, getRestartCounter, handle, handleBlockEvent, handleRestartEvent, isRunnable, onStart, restart, root, setAgent, setBehaviourName, setDataStore, setExecutionState`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### MSG_KEY

          public static final java.lang.Object MSG_KEY

  - ### Constructor Detail

    - #### BDIAgentMsgReceiver

          public BDIAgentMsgReceiver(BDIAgent agent)

      Initializes this message receiver, which is associated with a BDI agent.
      Parameters:
        `agent` - the BDI agent that this behavior is associated with.

  - ### Method Detail

    - #### done

          public boolean done()

      Returns always false, as this behavior is responsible for message processing while a BDI agent is alive.
      Overrides:
        `done` in class `jade.proto.states.MsgReceiver`
      See Also:
        `MsgReceiver.done()`

    - #### handleMessage

          protected void handleMessage(jade.lang.acl.ACLMessage msg)

      Creates a `MessageGoal` for the received message, when handling the message.
      Overrides:
        `handleMessage` in class `jade.proto.states.MsgReceiver`
      See Also:
        `MsgReceiver.handleMessage(jade.lang.acl.ACLMessage)`