public void createAgent(String agentName, String path,
            String containerName, Object[] arguments) {

        ContainerController containerController = this.platformContainers
                .get(containerName);
        if (containerController == null) {
            this.createContainer(containerName);
            containerController = this.platformContainers.get(containerName);
        }
        if (arguments == null) {
            logger.finest("No arguments for agent " + agentName
                    + " in container " + containerName);
            Object reference = new Object();
            arguments = new Object[1];
            arguments[0] = reference;
        }
        try {
            logger.fine("Creating agent " + agentName + " in container "
                    + containerName);
            AgentController agentController = containerController
                    .createNewAgent(agentName, path, arguments);
            this.createdAgents.put(agentName, agentController);
            agentController.start();
            logger.fine("Agent " + agentName
                    + " created and started in Container " + containerName);
            try {
                Thread.sleep(MILLIS_TO_WAIT_FOR_AGENT_STARTING);
            } catch (InterruptedException e) {
                logger.warning("It was not possible to wait for agent starting... Maybe, the agent is not completely started yet.");
            }
        } catch (StaleProxyException e) {
            logger.warning("Exception creating or starting agent " + agentName
                    + " in container " + containerName + "... Exception:" + e);
        } catch (Exception e) {
            logger.warning("Exception creating or starting agent " + agentName
                    + " in container " + containerName + "... Exception:" + e);
        }
    }
public void createAgent ( String agentName , String path , String containerName , Object [ ] arguments ) { ContainerController containerController = this . platformContainers . get ( containerName ) ; if ( containerController == null ) { this . createContainer ( containerName ) ; containerController = this . platformContainers . get ( containerName ) ; } if ( arguments == null ) { logger . finest ( "No arguments for agent " + agentName + " in container " + containerName ) ; Object reference = new Object ( ) ; arguments = new Object [ 1 ] ; arguments [ 0 ] = reference ; } try { logger . fine ( "Creating agent " + agentName + " in container " + containerName ) ; AgentController agentController = containerController . createNewAgent ( agentName , path , arguments ) ; this . createdAgents . put ( agentName , agentController ) ; agentController . start ( ) ; logger . fine ( "Agent " + agentName + " created and started in Container " + containerName ) ; try { Thread . sleep ( MILLIS_TO_WAIT_FOR_AGENT_STARTING ) ; } catch ( InterruptedException e ) { logger . warning ( "It was not possible to wait for agent starting... Maybe, the agent is not completely started yet." ) ; } } catch ( StaleProxyException e ) { logger . warning ( "Exception creating or starting agent " + agentName + " in container " + containerName + "... Exception:" + e ) ; } catch ( Exception e ) { logger . warning ( "Exception creating or starting agent " + agentName + " in container " + containerName + "... Exception:" + e ) ; } }
@param agentName
@param path
@param containerName
@param arguments