Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 24c94a61 authored by Jérôme Pierson's avatar Jérôme Pierson
Browse files

No commit message

No commit message
parent a0a16a50
No related branches found
No related tags found
No related merge requests found
/*
* $Id: AlignmentService.java 335 2006-10-05 10:02:02Z euzenat $
* $Id: JadeFIPAAServProfile.java 335 2006-10-05 10:02:02Z euzenat $
*
* Copyright (C) Orange R&D, 2006
* Copyright (C) INRIA Rhne-Alpes, 2006
......@@ -33,51 +33,63 @@ import org.semanticweb.owl.align.Parameters;
import jade.core.Runtime;
import jade.core.Profile;
import jade.core.ProfileImpl;
import jade.util.Logger;
import jade.util.leap.Properties;
// JE: find them
//JE: find them
import jade.wrapper.*;
public class JadeFIPAAServProfile implements AlignmentServiceProfile {
public void init( Parameters params, AServProtocolManager manager ) throws AServException {
int port = 8888;
int debug = 0;
if ( params.getParameter( "jade" ) != null )
port = Integer.parseInt( (String)params.getParameter( "jade" ) );
if ( params.getParameter( "debug" ) != null )
debug = ((Integer)params.getParameter( "debug" )).intValue() - 1;
/**
private AgentContainer mc;
private AgentController algagentcontroller;
private Logger myLogger = Logger.getMyLogger(getClass().getName());
public void init( Parameters params, AServProtocolManager manager ) throws AServException {
int port = 8888;
int debug = 0;
if ( params.getParameter( "jade" ) != null )
port = Integer.parseInt( (String)params.getParameter( "jade" ) );
if ( params.getParameter( "debug" ) != null )
debug = ((Integer)params.getParameter( "debug" )).intValue() - 1;
/**
Properties props = new Properties();
**/
try {
// Get a hold on JADE runtime
Runtime rt = Runtime.instance();
**/
try {
// Get a hold on JADE runtime
Runtime rt = Runtime.instance();
// Exit the JVM when there are no more containers around
rt.setCloseVM(true);
// Exit the JVM when there are no more containers around
rt.setCloseVM(true);
/** Profile with no MTP( Message Transfer Protocol
/** Profile with no MTP( Message Transfer Protocol
props.setProperty("nomtp", "true");
Profile pMain = new ProfileImpl(props);
**/
// create a default Profile
Profile pMain = new ProfileImpl(null, port, null);
if ( debug > 0 )
System.out.println("Launching a whole in-process platform..."+pMain);
AgentContainer mc = rt.createMainContainer(pMain);
AgentController custom = mc.createNewAgent("JadeFIPAAServiceAgent", JadeFIPAAServiceAgent.class.getName(), null);
custom.start();
}
catch(Exception e) {
throw new AServException ( "Cannot launch Jade Server" , e );
**/
// create a default Profile
Profile pMain = new ProfileImpl(null, port, null);
if ( debug > 0 )
System.out.println("Launching a whole in-process platform..."+pMain);
mc = rt.createMainContainer(pMain);
algagentcontroller = mc.createNewAgent("JadeFIPAAServiceAgent", JadeFIPAAServiceAgent.class.getName(), null);
algagentcontroller.start();
}
catch(Exception e) {
throw new AServException ( "Cannot launch Jade Server" , e );
}
}
}
public void close(){
}
public void close(){
try{
algagentcontroller.kill();
mc.kill();
myLogger.log(Logger.INFO, "Agent Alignement close");
}
catch (ControllerException e){myLogger.log(Logger.WARNING, "Error killing the alignment agent."); }
}
}
/*
* $Id: JadeFIPAAServiceAgent.java 335 2006-10-05 10:02:02Z euzenat $
*
* Copyright (C) Orange R&D, 2006
* Copyright (C) INRIA Rhne-Alpes, 2006
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package fr.inrialpes.exmo.align.service.jade;
import jade.core.Agent;
......@@ -51,7 +73,8 @@ public class JadeFIPAAServiceAgent extends Agent {
protected void takeDown() {
myLogger.log(Logger.INFO, "Bye bye!!!");
myLogger.log(Logger.INFO, "Agent Alignement Service close");
this.doDelete();
}
private void registerWithDF() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment