public void sendMessageToAgentsWithExtraProperties ( String [ ] agent_name , String msgtype , Object message_content , ArrayList < Object > properties , Connector connector ) { HashMap < String , Object > hm = new HashMap < String , Object > ( ) ; hm . put ( "performative" , msgtype ) ; hm . put ( SFipa . CONTENT , message_content ) ; for ( Object property : properties ) { // Logger logger = Logger.getLogger("JadexMessenger"); // logger.info("Sending message with extra property: "+property.get(0)+", with value "+property.get(1)); hm . put ( ( String ) ( ( Tuple ) property ) . get ( 0 ) , ( ( Tuple ) property ) . get ( 1 ) ) ; } IComponentIdentifier [ ] ici = new IComponentIdentifier [ agent_name . length ] ; for ( int i = 0 ; i < agent_name . length ; i ++ ) { ici [ i ] = ( IComponentIdentifier ) connector . getAgentID ( agent_name [ i ] ) ; } ( ( IMessageService ) connector . getMessageService ( ) ) . deliverMessage ( hm , "fipa" , ici ) ; }
This method works as the one above adding some properties to the message