fr.dyade.aaa.agent
Class SCAdminHelper

java.lang.Object
  extended byfr.dyade.aaa.agent.SCAdminHelper

public class SCAdminHelper
extends java.lang.Object


Field Summary
protected  java.util.Hashtable ASP
          Hashtable that contain all Process of running AgentServer
protected  org.objectweb.util.monolog.api.Logger logmon
           
 
Constructor Summary
SCAdminHelper()
           
 
Method Summary
 void crashAgentServer(short sid, int port)
          Stops violently an agent server from its id.
 void crashAgentServer(short sid, java.lang.String host, int port)
          Stops violently an agent server from its id.
 void destroyAgentServer(short sid)
          Kill an agent server and remove it from the ASP table.
 int exitValue(short sid)
          Ask for the exit value of an agent server.
 int joinAgentServer(short sid)
          Causes the current thread to wait, if necessary, until the process running this agent server has terminated.
 void killAgentServer(short sid)
          Kills this agent server process.
 java.lang.String startAgentServer(short sid)
          Starts an agent server from its id.
 java.lang.String startAgentServer(short sid, java.io.File dir, java.lang.String[] jvmarg)
          Starts an agent server from its id.
 java.lang.String startAgentServer(short sid, java.io.File dir, java.lang.String[] jvmarg, java.lang.String[] servarg)
           
 java.lang.String startAgentServer(short sid, java.io.File dir, java.lang.String[] jvmarg, java.lang.String className, java.lang.String[] servarg)
          Starts an agent server from its id.
 java.lang.String startAgentServer(short sid, java.lang.String[] jvmarg)
          Starts an agent server from its id.
 void stopAgentServer(short sid, int port)
          Stops cleanly an agent server from its id.
 void stopAgentServer(short sid, java.lang.String host, int port)
          Stops cleanly an agent server from its id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASP

protected java.util.Hashtable ASP
Hashtable that contain all Process of running AgentServer


logmon

protected org.objectweb.util.monolog.api.Logger logmon
Constructor Detail

SCAdminHelper

public SCAdminHelper()
Method Detail

startAgentServer

public java.lang.String startAgentServer(short sid)
                                  throws java.lang.Exception
Starts an agent server from its id.

Parameters:
sid - id of agent server to start
Throws:
java.lang.Exception

startAgentServer

public java.lang.String startAgentServer(short sid,
                                         java.lang.String[] jvmarg)
                                  throws java.lang.Exception
Starts an agent server from its id.

Parameters:
sid - id of agent server to start
jvmarg - arguments to pass to the created java program
Throws:
java.lang.Exception

startAgentServer

public java.lang.String startAgentServer(short sid,
                                         java.io.File dir,
                                         java.lang.String[] jvmarg)
                                  throws java.lang.Exception
Starts an agent server from its id.

Parameters:
sid - id of agent server to start
dir - new working directory for the created agent server, current working directory if null
jvmarg - arguments to pass to the created java program
Throws:
java.lang.Exception

startAgentServer

public java.lang.String startAgentServer(short sid,
                                         java.io.File dir,
                                         java.lang.String[] jvmarg,
                                         java.lang.String[] servarg)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

startAgentServer

public java.lang.String startAgentServer(short sid,
                                         java.io.File dir,
                                         java.lang.String[] jvmarg,
                                         java.lang.String className,
                                         java.lang.String[] servarg)
                                  throws java.lang.Exception
Starts an agent server from its id.

Parameters:
sid - id of agent server to start
dir - new working directory for the created agent server, current working directory if null
jvmarg - arguments to pass to the created java program
className - the name of the main class
servarg - additional arguments to pass to the created java program
Throws:
java.lang.Exception

killAgentServer

public void killAgentServer(short sid)
                     throws java.lang.Exception
Kills this agent server process.

Parameters:
sid - id of agent server to stop
Throws:
java.lang.Exception

joinAgentServer

public int joinAgentServer(short sid)
                    throws java.lang.Exception
Causes the current thread to wait, if necessary, until the process running this agent server has terminated.

Parameters:
sid - id of agent server to stop
Returns:
the exit value of the agent server.
Throws:
UnknownServerException - if the agent server is unknown.
java.lang.Exception

exitValue

public int exitValue(short sid)
              throws java.lang.IllegalThreadStateException,
                     UnknownServerException
Ask for the exit value of an agent server.

Parameters:
sid - id of agent server to stop
Returns:
the exit value of the agent server.
Throws:
java.lang.IllegalThreadStateException - if the agent server is still running.
UnknownServerException - if the agent server is unknown.

destroyAgentServer

public void destroyAgentServer(short sid)
                        throws java.lang.Exception
Kill an agent server and remove it from the ASP table.

Parameters:
sid - id of agent server to stop
Throws:
java.lang.Exception

stopAgentServer

public void stopAgentServer(short sid,
                            int port)
                     throws java.lang.Exception
Stops cleanly an agent server from its id.

Parameters:
sid - id of agent server to stop
port - port of the corresponding AdminProxy.
Throws:
java.lang.Exception

stopAgentServer

public void stopAgentServer(short sid,
                            java.lang.String host,
                            int port)
                     throws java.lang.Exception
Stops cleanly an agent server from its id.

Parameters:
sid - id of agent server to stop
host - hostname of the agent server.
port - port of the corresponding AdminProxy.
Throws:
java.lang.Exception

crashAgentServer

public void crashAgentServer(short sid,
                             int port)
                      throws java.lang.Exception
Stops violently an agent server from its id.

Parameters:
sid - id of agent server to stop
port - port of the corresponding AdminProxy.
Throws:
java.lang.Exception

crashAgentServer

public void crashAgentServer(short sid,
                             java.lang.String host,
                             int port)
                      throws java.lang.Exception
Stops violently an agent server from its id.

Parameters:
sid - id of agent server to stop
host - hostname of the agent server.
port - port of the corresponding AdminProxy.
Throws:
java.lang.Exception


Copyright ? 2004 Scalagent - All rights reserved