|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.javagroup.process.StandardProcessManager
An implementation of the ProcessManager interface. Further documentation to come, please refer to ProcessManager for usage information.
Field Summary | |
protected java.net.URL[] |
_classpath
default classpath. |
protected ProcessGarbageCollector |
_garbageCollector
Garbage collector |
protected java.util.Vector |
_garbageQueue
Queue of garbage processes for the gc to remove. |
protected ProcessNamespace |
_namespace
Per-process namespace manager |
protected java.util.Hashtable |
_processes
Hashtable of all processes. |
protected java.util.Vector |
_processEventListeners
Vector of registered ProcessEventListeners |
protected java.lang.ThreadGroup |
_rootProcessGroup
|
protected ProcessSecurityManager |
_securityManager
SecurityManager |
Constructor Summary | |
StandardProcessManager()
Constructs a ProcessManager with no default classpath. |
|
StandardProcessManager(java.net.URL[] classpath)
Constructs a ProcessManager with a given default classpath. |
Method Summary | |
void |
addProcessEventListener(ProcessEventListener listener)
|
JProcess |
createProcess(java.lang.String className)
Create a process. |
JProcess |
createProcess(java.lang.String className,
java.lang.String[] args)
Create a process with given arguments. |
JProcess |
createProcess(java.lang.String className,
java.lang.String[] args,
java.net.URL[] classpath)
Create a process with given args, and additional classpath(s). |
JProcess |
createProcessFromString(java.lang.String string)
Creates a process from the information in a given String of the format: "<classname> <arg>*". |
JProcess |
createProcessFromString(java.lang.String string,
java.net.URL[] classpath)
Creates a process from the information in a given String of the format: "[-eclasspath url[,url]*] |
void |
doGarbageCollect()
Perform garbage collection. |
protected void |
fireProcessCreationEvent(JProcess process)
|
protected void |
fireProcessDestructionEvent(JProcess process)
|
JProcess |
getCurrentProcess()
Return the current process. |
Namespace |
getNamespaceForProcess(JProcess process)
Get the Namespace object for the given process. |
protected long |
getNextPid()
Return the next pid-number and increment the pid counter. |
JProcess |
getProcess(long pid)
Get a process by process-id. |
java.util.Enumeration |
getProcesses()
Get an enumeration of all processes. |
JProcess |
getProcessFor(java.lang.ClassLoader loader)
Get the process whose target class was loaded by a given ClassLoader. |
JProcess |
getProcessFor(java.lang.ThreadGroup group)
Get the process that a threadgroup belongs to. |
StandardIO |
getStandardIOForProcess(JProcess process)
Get the streams a process uses for standard io |
void |
kill(long pid)
Kill a process by pid. |
protected java.net.URL[] |
mergeWithDefaultClasspath(java.net.URL[] classpath)
|
void |
removeProcessEventListener(ProcessEventListener listener)
|
void |
resourceDisposed(Resource resource)
For ResourceDisposalListener interface. |
void |
setStandardIOForProcess(JProcess process,
StandardIO stdio)
Set the streams to be used when the Process asks for standard io. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.net.URL[] _classpath
protected java.util.Hashtable _processes
protected ProcessSecurityManager _securityManager
protected java.util.Vector _processEventListeners
protected ProcessGarbageCollector _garbageCollector
protected ProcessNamespace _namespace
protected java.util.Vector _garbageQueue
protected java.lang.ThreadGroup _rootProcessGroup
Constructor Detail |
public StandardProcessManager()
public StandardProcessManager(java.net.URL[] classpath)
Method Detail |
protected long getNextPid()
public JProcess createProcess(java.lang.String className) throws ProcessCreationException
className
- The name of the target class.public JProcess createProcess(java.lang.String className, java.lang.String[] args) throws ProcessCreationException
className
- The name of the target class.args
- The arguments to pass to the main(String[]) method.public JProcess createProcess(java.lang.String className, java.lang.String[] args, java.net.URL[] classpath) throws ProcessCreationException
className
- The name of the target class.args
- The arguments to pass to the main(String[]) method.classpath
- An array of URLs to search for classes in.public JProcess createProcessFromString(java.lang.String string) throws ProcessCreationException
string
- The string to decode process info from.public JProcess createProcessFromString(java.lang.String string, java.net.URL[] classpath) throws ProcessCreationException
string
- The string to decode process info from.classpath
- Classpaths to search in addition to defaults.public JProcess getProcessFor(java.lang.ThreadGroup group)
group
- The ThreadGroup to attribute a process to.public JProcess getProcessFor(java.lang.ClassLoader loader)
loader
- The classloader to check for.protected java.net.URL[] mergeWithDefaultClasspath(java.net.URL[] classpath)
public JProcess getCurrentProcess()
public JProcess getProcess(long pid)
pid
- The id-number of the process.public java.util.Enumeration getProcesses()
public void kill(long pid)
pid
- The process-id to kill.public void addProcessEventListener(ProcessEventListener listener)
public void removeProcessEventListener(ProcessEventListener listener)
protected void fireProcessDestructionEvent(JProcess process)
protected void fireProcessCreationEvent(JProcess process)
public void resourceDisposed(Resource resource)
public void doGarbageCollect()
public Namespace getNamespaceForProcess(JProcess process)
process
- The process to get Namespace for.public void setStandardIOForProcess(JProcess process, StandardIO stdio)
process
- The process to set for.stdio
- The set of IO streams to use as standard io.public StandardIO getStandardIOForProcess(JProcess process)
process
- The process to get streams for.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |