# Uses of Class
madkit.kernel.Message

Packages that use Message
Package
Description
madkit.kernel
Provides classes that are fundamental to the design of MaDKit applications.
madkit.message
Contains subclasses of `Message` which could be easily reused.
madkit.message.hook
Contains message classes useful for monitoring MaDKit kernel events.

- ## Uses of Message in madkit.kernel

  Methods in madkit.kernel that return Message
  Modifier and Type
  Method
  Description
  `protected Message`
  Message.`clone()`
  Returns a shadow copy of the message.
  `Message`
  AbstractAgent.`getLastReceivedMessage()`
  Gets the last received message.
  `Message`
  AbstractAgent.`getLastReceivedMessage(MessageFilter filter)`
  Gets the last received message according to a filter.
  `Message`
  AbstractAgent.`getReplyTo(Message originalMessage)`
  Gets the next message which is a reply to the originalMessage.
  `Message`
  AbstractAgent.`nextMessage()`
  Retrieves and removes the oldest received message contained in the mailbox.
  `Message`
  AbstractAgent.`nextMessage(MessageFilter filter)`
  Retrieves and removes the first oldest message of the mailbox that matches the filter.
  `Message`
  AbstractAgent.`purgeMailbox()`
  Purges the mailbox and returns the most recent received message at that time.
  `Message`
  Agent.`sendMessageAndWaitForReply(String community, String group, String role, Message messageToSend)`
  Sends a message to an agent having this position in the organization and waits indefinitely for an answer to it.
  `Message`
  Agent.`sendMessageAndWaitForReply(String community, String group, String role, Message messageToSend, int timeOutMilliSeconds)`
  Sends a message to an agent having this position in the organization and waits for an answer to it.
  `Message`
  Agent.`sendMessageAndWaitForReply(AgentAddress receiver, Message messageToSend)`
  Sends a message and waits indefinitely for an answer to it.
  `Message`
  Agent.`sendMessageAndWaitForReply(AgentAddress receiver, Message messageToSend, int timeOutMilliSeconds)`
  Sends a message and waits for an answer to it.
  `Message`
  Agent.`sendMessageWithRoleAndWaitForReply(String community, String group, String role, Message messageToSend, String senderRole)`
  Sends a message to an agent having this position in the organization and waits indefinitely for an answer to it.
  `Message`
  Agent.`sendMessageWithRoleAndWaitForReply(String community, String group, String role, Message messageToSend, String senderRole, Integer timeOutMilliSeconds)`
  Sends a message to an agent having this position in the organization and waits for an answer to it.
  `Message`
  Agent.`sendMessageWithRoleAndWaitForReply(AgentAddress receiver, Message messageToSend, String senderRole)`
  Sends a message and waits for an answer to it.
  `Message`
  Agent.`sendMessageWithRoleAndWaitForReply(AgentAddress receiver, Message messageToSend, String senderRole, Integer timeOutMilliSeconds)`
  Sends a message and waits for an answer to it.
  `Message`
  Agent.`sendReplyAndWaitForReply(Message messageToReplyTo, Message reply)`
  Sends a reply message and waits indefinitely for an answer to it.
  `Message`
  Agent.`sendReplyAndWaitForReply(Message messageToReplyTo, Message reply, int timeOutMilliSeconds)`
  Sends a reply message and waits for an answer to it.
  `Message`
  Agent.`sendReplyWithRoleAndWaitForReply(Message messageToReplyTo, Message reply, String senderRole)`
  Sends a reply message and waits indefinitely for an answer to it.
  `Message`
  Agent.`sendReplyWithRoleAndWaitForReply(Message messageToReplyTo, Message reply, String senderRole, Integer timeOutMilliSeconds)`
  Sends a reply message and waits for an answer to it.
  `Message`
  Agent.`waitAnswer(Message query)`
  Retrieves and removes the next message that is a reply to the query message, waiting for ever if necessary until a matching reply becomes available.
  `Message`
  Agent.`waitAnswer(Message query, Integer timeOutMilliSeconds)`
  Retrieves and removes the next message that is a reply to the query message, waiting for ever if necessary until a matching reply becomes available.
  `Message`
  Agent.`waitNextMessage()`
  This method is the blocking version of nextMessage().
  `Message`
  Agent.`waitNextMessage(long timeOutMilliseconds)`
  This method gets the next message of the mailbox or waits for a new incoming message considering a certain delay.
  `Message`
  Agent.`waitNextMessage(Integer timeOutMilliseconds, MessageFilter filter)`
  This method gets the next message of the mailbox or waits for a new incoming acceptable message up to a certain delay.
  `Message`
  Agent.`waitNextMessage(MessageFilter filter)`
  Retrieves and removes the next message that complies with the filter, waiting for ever if necessary until a matching message becomes available.
  Methods in madkit.kernel that return types with arguments of type Message
  Modifier and Type
  Method
  Description
  `List<Message>`
  Agent.`broadcastMessageWithRoleAndWaitForReplies(String community, String group, String role, Message message, String senderRole, Integer timeOutMilliSeconds)`
  Broadcasts a message and wait for answers considering a timeout duration.
  `List<Message>`
  AbstractAgent.`nextMessages(MessageFilter filter)`
  Retrieves and removes all the messages of the mailbox that match the filter, in the order they were received.
  Methods in madkit.kernel with parameters of type Message
  Modifier and Type
  Method
  Description
  `AbstractAgent.ReturnCode`
  AbstractAgent.`broadcastMessage(String community, String group, String role, Message message)`
  Broadcasts a message to every agent having a role in a group in a community, but not to the sender.
  `AbstractAgent.ReturnCode`
  AbstractAgent.`broadcastMessageWithRole(String community, String group, String role, Message messageToSend, String senderRole)`
  Broadcasts a message to every agent having a role in a group in a community using a specific role for the sender.
  `List<Message>`
  Agent.`broadcastMessageWithRoleAndWaitForReplies(String community, String group, String role, Message message, String senderRole, Integer timeOutMilliSeconds)`
  Broadcasts a message and wait for answers considering a timeout duration.
  `protected void`
  Scheduler.`checkMail(Message m)`
  Changes my state according to a `SchedulingMessage` and sends a reply to the sender as acknowledgment.
  `Message`
  AbstractAgent.`getReplyTo(Message originalMessage)`
  Gets the next message which is a reply to the originalMessage.
  `void`
  AbstractAgent.`receiveMessage(Message m)`
  This method offers a convenient way for regular object to send messages to Agents, especially threaded agents.
  `AbstractAgent.ReturnCode`
  AbstractAgent.`sendMessage(String community, String group, String role, Message message)`
  Sends a message to an agent having this position in the organization, specifying explicitly the role used to send it.
  `AbstractAgent.ReturnCode`
  AbstractAgent.`sendMessage(AgentAddress receiver, Message messageToSend)`
  Sends a message to an agent using an agent address.
  `Message`
  Agent.`sendMessageAndWaitForReply(String community, String group, String role, Message messageToSend)`
  Sends a message to an agent having this position in the organization and waits indefinitely for an answer to it.
  `Message`
  Agent.`sendMessageAndWaitForReply(String community, String group, String role, Message messageToSend, int timeOutMilliSeconds)`
  Sends a message to an agent having this position in the organization and waits for an answer to it.
  `Message`
  Agent.`sendMessageAndWaitForReply(AgentAddress receiver, Message messageToSend)`
  Sends a message and waits indefinitely for an answer to it.
  `Message`
  Agent.`sendMessageAndWaitForReply(AgentAddress receiver, Message messageToSend, int timeOutMilliSeconds)`
  Sends a message and waits for an answer to it.
  `AbstractAgent.ReturnCode`
  AbstractAgent.`sendMessageWithRole(String community, String group, String role, Message message, String senderRole)`
  Sends a message to an agent having this position in the organization.
  `AbstractAgent.ReturnCode`
  AbstractAgent.`sendMessageWithRole(AgentAddress receiver, Message message, String senderRole)`
  Sends a message, using an agent address, specifying explicitly the role used to send it.
  `Message`
  Agent.`sendMessageWithRoleAndWaitForReply(String community, String group, String role, Message messageToSend, String senderRole)`
  Sends a message to an agent having this position in the organization and waits indefinitely for an answer to it.
  `Message`
  Agent.`sendMessageWithRoleAndWaitForReply(String community, String group, String role, Message messageToSend, String senderRole, Integer timeOutMilliSeconds)`
  Sends a message to an agent having this position in the organization and waits for an answer to it.
  `Message`
  Agent.`sendMessageWithRoleAndWaitForReply(AgentAddress receiver, Message messageToSend, String senderRole)`
  Sends a message and waits for an answer to it.
  `Message`
  Agent.`sendMessageWithRoleAndWaitForReply(AgentAddress receiver, Message messageToSend, String senderRole, Integer timeOutMilliSeconds)`
  Sends a message and waits for an answer to it.
  `AbstractAgent.ReturnCode`
  AbstractAgent.`sendReply(Message messageToReplyTo, Message reply)`
  Sends a message by replying to a previously received message.
  `Message`
  Agent.`sendReplyAndWaitForReply(Message messageToReplyTo, Message reply)`
  Sends a reply message and waits indefinitely for an answer to it.
  `Message`
  Agent.`sendReplyAndWaitForReply(Message messageToReplyTo, Message reply, int timeOutMilliSeconds)`
  Sends a reply message and waits for an answer to it.
  `AbstractAgent.ReturnCode`
  AbstractAgent.`sendReplyWithRole(Message messageToReplyTo, Message reply, String senderRole)`
  Sends a message by replying to a previously received message.
  `Message`
  Agent.`sendReplyWithRoleAndWaitForReply(Message messageToReplyTo, Message reply, String senderRole)`
  Sends a reply message and waits indefinitely for an answer to it.
  `Message`
  Agent.`sendReplyWithRoleAndWaitForReply(Message messageToReplyTo, Message reply, String senderRole, Integer timeOutMilliSeconds)`
  Sends a reply message and waits for an answer to it.
  `Message`
  Agent.`waitAnswer(Message query)`
  Retrieves and removes the next message that is a reply to the query message, waiting for ever if necessary until a matching reply becomes available.
  `Message`
  Agent.`waitAnswer(Message query, Integer timeOutMilliSeconds)`
  Retrieves and removes the next message that is a reply to the query message, waiting for ever if necessary until a matching reply becomes available.

- ## Uses of Message in madkit.message

  Subclasses of Message in madkit.message
  Modifier and Type
  Class
  Description
  `class`
  `ACLMessage`
  This class describes an ACL message.
  `class`
  `ActMessage`
  This class describes a generic speech act message.
  `class`
  `BooleanMessage`
  A message class that conveys a boolean value.
  `class`
  `EnumMessage<E extends Enum<E>>`
  This parameterizable class could be used to build a message tagged with an enumeration and conveying any java objects using an array of Object.
  `class`
  `GUIMessage`
  Message type that could be used to ask the gui manager to do something
  `class`
  `IntegerMessage`
  A message class that conveys an integer.
  `class`
  `KernelMessage`
  The brand new version of KernelMessage.
  `class`
  `KQMLMessage`
  This class describes a KQML message.
  `class`
  `MapMessage<K,V>`
  This class could be used to build message conveying `Map` objects between MaDKit agents.
  `class`
  `ObjectMessage<T>`
  This parameterizable class could be used to convey any Java Object between MaDKit agents.
  `class`
  `SchedulingMessage`
  This message class could be used to interact with a Scheduler agent.
  `class`
  `StringMessage`
  A message class that conveys a string.
  `class`
  `XMLMessage`
  A message that carries an XML document.
  Methods in madkit.message with parameters of type Message
  Modifier and Type
  Method
  Description
  `boolean`
  ConversationFilter.`accept(Message m)`
  `boolean`
  MessageFilter.`accept(Message m)`
  Tests if a specified message matches the requirement.
  `boolean`
  SenderRoleFilter.`accept(Message m)`
  Constructors in madkit.message with parameters of type Message
  Modifier
  Constructor
  Description
  ``
  `ConversationFilter(Message origin)`
  a new filter that acts according to the conversationID of a message.

- ## Uses of Message in madkit.message.hook

  Subclasses of Message in madkit.message.hook
  Modifier and Type
  Class
  Description
  `class`
  `AgentLifeEvent`
  A message which is sent to agents that have requested a hook on `HookMessage.AgentActionEvent.AGENT_STARTED` or `HookMessage.AgentActionEvent.AGENT_TERMINATED`
  `class`
  `CGREvent`
  Root class of messages which are sent to agents that have requested hooks to the kernel
  `class`
  `HookMessage`
  This message could be used to request a kernel's hook on agent actions so that the sender will be kept informed when an agent performed particular action.
  `class`
  `MessageEvent`
  A message which is sent to agents that have requested a hook on `HookMessage.AgentActionEvent.AGENT_STARTED` or `HookMessage.AgentActionEvent.AGENT_TERMINATED`
  `class`
  `OrganizationEvent`
  A message which is sent to agents that have requested a hook on `HookMessage.AgentActionEvent.CREATE_GROUP`, `HookMessage.AgentActionEvent.REQUEST_ROLE`, `HookMessage.AgentActionEvent.LEAVE_GROUP`, or `HookMessage.AgentActionEvent.LEAVE_ROLE`
  Methods in madkit.message.hook that return Message
  Modifier and Type
  Method
  Description
  `Message`
  MessageEvent.`getMessage()`
  Constructors in madkit.message.hook with parameters of type Message
  Modifier
  Constructor
  Description
  ``
  `MessageEvent(HookMessage.AgentActionEvent agentAction, Message m)`