public class SCAdminHelper extends Object
Modifier and Type | Field and Description |
---|---|
protected Hashtable<Short,Process> |
ASP
Hashtable that contain all
Process of running AgentServer |
protected org.objectweb.util.monolog.api.Logger |
logmon |
Constructor and Description |
---|
SCAdminHelper() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
close(Socket socket) |
void |
closeServerStream(Process p)
Closes all subsequent streams of the process to avoid deadlock due to
limited buffer size.
|
void |
crashAgentServer(short sid,
int port)
Stops violently an agent server from its id.
|
void |
crashAgentServer(short sid,
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.
|
Process |
execAgentServer(short sid,
File dir,
String[] jvmargs,
String className,
String[] args)
Runs an agent server from its id and specific parameters.
|
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.
|
String |
startAgentServer(short sid)
Starts an agent server from its id.
|
String |
startAgentServer(short sid,
File dir,
String[] jvmargs)
Starts an agent server from its id using specific jvmargs and storage
directory.
|
String |
startAgentServer(short sid,
File dir,
String[] jvmargs,
String[] args)
Starts an agent server from its id using specific jvmargs and storage
directory.
|
String |
startAgentServer(short sid,
File dir,
String[] jvmargs,
String className,
String[] args)
Starts an agent server from its id.
|
String |
startAgentServer(short sid,
String[] jvmargs)
Starts an agent server from its id using specific jvmargs.
|
void |
stopAgentServer(short sid,
int port)
Stops cleanly an agent server from its id.
|
void |
stopAgentServer(short sid,
String host,
int port)
Stops cleanly an agent server from its id.
|
String |
waitServerStarting(Process p)
Waits for the starting of an AgentServer pointed out by its process.
|
protected Hashtable<Short,Process> ASP
Process
of running AgentServerprotected org.objectweb.util.monolog.api.Logger logmon
public String startAgentServer(short sid) throws Exception
sid
- id of agent server to startException
public String startAgentServer(short sid, String[] jvmargs) throws Exception
sid
- id of agent server to startjvmargs
- arguments to pass to the created java programException
public String startAgentServer(short sid, File dir, String[] jvmargs) throws Exception
sid
- id of agent server to startdir
- new working directory for the created agent server,
current working directory if null
jvmargs
- arguments to pass to the created java programException
public String startAgentServer(short sid, File dir, String[] jvmargs, String[] args) throws Exception
sid
- id of agent server to startdir
- new working directory for the created agent server,
current working directory if null
jvmargs
- arguments to pass to the created java programargs
- additional arguments to pass to the created java
programException
public String startAgentServer(short sid, File dir, String[] jvmargs, String className, String[] args) throws Exception
sid
- id of agent server to startdir
- new working directory for the created agent server,
current working directory if null
jvmargs
- arguments to pass to the created java programclassName
- the name of the main classargs
- additional arguments to pass to the created java
programException
public Process execAgentServer(short sid, File dir, String[] jvmargs, String className, String[] args) throws Exception
sid
- id of agent server to startdir
- new working directory for the created agent server,
current working directory if null
jvmargs
- arguments to pass to the created java programclassName
- the name of the main classargs
- additional arguments to pass to the created java
programException
public String waitServerStarting(Process p) throws Exception
p
- the AgentServer process.Exception
public void closeServerStream(Process p) throws Exception
p
- the AgentServer process.Exception
public void killAgentServer(short sid) throws Exception
sid
- id of agent server to stopException
public int joinAgentServer(short sid) throws Exception
sid
- id of agent server to stopUnknownServerException
- if the agent server is unknown.Exception
public int exitValue(short sid) throws IllegalThreadStateException, UnknownServerException
sid
- id of agent server to stopIllegalThreadStateException
- if the agent server is still running.UnknownServerException
- if the agent server is unknown.public void destroyAgentServer(short sid) throws Exception
sid
- id of agent server to stopException
public void stopAgentServer(short sid, int port) throws Exception
sid
- id of agent server to stopport
- port of the corresponding AdminProxy.Exception
public void stopAgentServer(short sid, String host, int port) throws Exception
sid
- id of agent server to stophost
- hostname of the agent server.port
- port of the corresponding AdminProxy.Exception
public void crashAgentServer(short sid, int port) throws Exception
sid
- id of agent server to stopport
- port of the corresponding AdminProxy.Exception
public void crashAgentServer(short sid, String host, int port) throws Exception
sid
- id of agent server to stophost
- hostname of the agent server.port
- port of the corresponding AdminProxy.Exception
static void close(Socket socket)
Copyright © 2019 ScalAgent D.T.. All rights reserved.