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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
| <jsp:useBean id="oldsnooper" class="MainAgent" scope="application">
<%@ page import="jade.Boot"%>
<%@ page language="java" import="java.sql.*"%>
<%@ 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.core.Runtime" %>
<%@ page import="jade.core.AID" %>
<%@ page import="jade.core.Agent" %>
<%@ page import="jade.lang.acl.ACLMessage" %>
<%@ page import="jade.wrapper.ContainerController" %>
<%@ page import="jade.core.behaviours.OneShotBehaviour" %>
<%
/*
try
{//instancier le noyeau de la plateforme par l'administrateur
Runtime A = Runtime.instance();
ProfileImpl P = new ProfileImpl(false);
AgentContainer conteneur =A.createAgentContainer(P);
AgentController Agent=null;
MainAgent snoop= new MainAgent();
conteneur.acceptNewAgent("Main Agent",snoop);
snoop.fonctionn("tessssssst");
System.out.println("Jade Inited()");
System.out.println("Start");
}
catch (Exception any)
{
any.printStackTrace();
}
*/
try
{//instancier le noyeau de la plateforme par l'administrateur
Runtime A = Runtime.instance();
ProfileImpl P = new ProfileImpl(false);
AgentContainer conteneur =A.createAgentContainer(P);
AgentController Agent=null;
Agent = conteneur.createNewAgent("agentt", "MainAgent", null);
Agent.start();
MainAgent snoop= new MainAgent();
conteneur.acceptNewAgent("Main Agent",snoop);
snoop.fonctionn("bonjour");
System.out.println("Jade Inited()");
System.out.println("Start");
}
catch (Exception any)
{
any.printStackTrace();
}
%>
</jsp:useBean>
<html>
<head>
<title>Authentification ADMINISTRATEUR</title>
</head>
<body>
marwa
It works !!
</body>
</html> |
Partager