public void cloneAgent(AID id, Location where, String newName) throws Throwable {
// Do as if it was a remote call from the main to allow
// security checks to take place if needed
jade.core.mobility.AgentMobilitySlice target = (jade.core.mobility.AgentMobilitySlice) getProxyToLocalSlice(jade.core.mobility.AgentMobilitySlice.NAME);
// FIXME: set Principal and Credentials
target.copyAgent(id, where, newName);
}
private SliceProxy getProxyToLocalSlice(String serviceName) throws Throwable {
Service svc = myServiceFinder.findService(serviceName);
return (SliceProxy) myIMTPManager.createSliceProxy(serviceName, svc.getHorizontalInterface(), myIMTPManager.getLocalNode());