1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
| <%@ page import="jade.core.*" %>
<%@ page import="javax.naming.InitialContext" %>
<%@ page import="jade.wrapper.AgentContainer" %>
<%@ page import="jade.core.Profile" %>
<%@ page import="jade.core.ProfileImpl" %>
<%@ page import="jade.wrapper.AgentController" %>
<%@ page import="jade.wrapper.*" %>
<%@ page import="jade.core.Profile.*"%>
<%@ page import="migre.agent_migration" %>
<%@ page import="migre.prof" %>
<%@ page import="jade.core.Runtime" %>
<%@ page import="jade.core.mobility.AgentMobilityService" %>
<%@ page import="jade.core.migration.InterPlatformMobilityService" %>
<%
System.out.println("test0");
try{
ProfileImpl p = new ProfileImpl(false);
p.setParameter(Profile.MAIN_PORT,"1099");
p.setParameter(Profile.MAIN_HOST, "localhost");
p.setParameter(Profile.PLATFORM_ID,"192.168.0.1");
p.setParameter(Profile.LOCAL_HOST,Profile.getDefaultNetworkName());
p.setParameter(Profile.SERVICES,"jade.core.mobility.AgentMobilityService;jade.core.event.NotificationService;jade.core.migration.InterPlatformMobilityService");
p.setParameter(Profile.MAIN, "false");
p.setParameter(Profile.MTPS,"jade.mtp.http.MessageTransportProtocol(http://"+Profile.getDefaultNetworkName()+":7778/acc);");
p.setParameter(Profile.CONTAINER_NAME,"container_secondaire");
Runtime rt = Runtime.instance();
ContainerController containerController = null;
try
{
containerController = rt.createAgentContainer(p);
}
catch (Exception ex)
{
System.out.println(ex.getMessage());
}
AgentController dummy = containerController.createNewAgent("inProcess","migre.agent_migration", null);
dummy.start();
System.out.println("agent_migration est lancé");
} catch (Exception any) {
any.printStackTrace();}
%>
<HTML>
<BODY>
It works !!!!
</BODY>
</HTML> |
Partager