I am not sure what it is that you are trying to achieve. Who is the end reciepient of the ACLMessage that you are sending from the JADE agent? is it all the agents that reside in the targeted container?
Just to clarify, a container is essentially an address where agents can reside, it is not an entitiy in of itself that can post and recieve messages. Within the JADE framework, Agents feature an 'Inbox' for ACLMessages, basically a BlockingQueue Object that contains a list of recieved messages. the agent is able to observe its own list and treat them as its lifecycle proceeds. Containers do not feature this ability.
ACLMessages can be directed at specific agents by adding receipients and other details. An Agent that is recieving messages can listen for specific ACLMessages by utilizing a MessageTemplate
where you can specifically select messages from the agent's 'inbox' based on match criteria, for example :
Messagetemplate mt = MessageTemplate.MatchPerformative(ACLMessage.INFORM);
ACLMessage msg = myAgent.receive(mt);
will allow the the agent to take the next ACLMessage.INFORM message from its'inbox'.
for further abilities, I suggest you go through the jade API.
Also, for what i believe you are trying to achieve which is send a message to all agents within a container. You can query the AMS agent for a list of agents that is on the platform and then filter them by ContainerID
. here is some code to get you started:
AMSAgentDescription[] agents = null;
SearchConstraints sc = new SearchConstraints();
// if multiple searchs are done, isolate them based on the name of searching agent
sc.setSearchId(getAID().getName());
sc.setMaxResults(new Long(-1)); // long value of -1 means get all agents
agents = AMSService.search(this, new AMSAgentDescription(), sc); //Query AMS agent for available agents
This code will retrieve a list of the all the available agents on platform that are registered with the AMS agent. Good luck and post if you have any issues :)