|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.javagroup.process.StandardJProcess
An implementation of the JProcess interface. Should only be used by a ProcessManager.
Field Summary | |
protected URLClassLoader |
_classLoader
Classloader used to load target class |
protected java.util.Vector |
_lockedResources
Resources locked by this process. |
protected java.lang.String |
_name
Process name |
protected long |
_pid
Unique process-id |
protected java.lang.ThreadGroup |
_processThreadGroup
Threadgroup for threads in this process |
protected java.util.Vector |
_resourcesLockedTo
Resources this process is locked to |
protected int |
_state
state of process |
Constructor Summary | |
StandardJProcess(java.lang.String className,
long pid,
java.lang.String[] args,
java.lang.ThreadGroup parent,
java.net.URL[] classpath)
Creates a process. |
Method Summary | |
void |
addClassPath(java.net.URL[] classpath)
|
void |
bindToResource(Resource resource)
|
protected URLClassLoader |
createClassLoader()
Factory method for creating a classloader. |
protected java.lang.ThreadGroup |
createThreadGroup(java.lang.ThreadGroup parent)
Factory method for creating a process ThreadGroup. |
java.lang.ClassLoader |
getClassLoader()
Return the classloader used to load the target class |
java.lang.String |
getName()
Get the name of this process. |
long |
getPid()
Return the process-id. |
int |
getState()
|
java.lang.ThreadGroup |
getThreadGroup()
Return the ThreadGroup for threads in this process. |
void |
kill()
|
void |
launch()
Start the process running. |
void |
registerAndBindToResource(Resource resource)
Register and bind to a resource. |
void |
registerResource(Resource resource)
Register a resource. |
protected void |
releaseResource(Resource resource)
|
void |
releaseResources()
Release all resource locks. |
void |
resourceDisposed(Resource resource)
|
void |
run()
Should not be called directly. |
java.lang.String |
toString()
|
void |
tryGarbageCollect()
Checks if the process is finished running, and if so kills it off to clean up the process table and allow the ClassLoader etc to be garbage collected. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected long _pid
protected java.lang.String _name
protected URLClassLoader _classLoader
protected java.lang.ThreadGroup _processThreadGroup
protected java.util.Vector _lockedResources
protected java.util.Vector _resourcesLockedTo
protected int _state
Constructor Detail |
public StandardJProcess(java.lang.String className, long pid, java.lang.String[] args, java.lang.ThreadGroup parent, java.net.URL[] classpath) throws ProcessCreationException
className
- The fully-qualified name of the target class.args
- The arguments to pass to the target's main(String[]) method.pid
- The process-id number.classpath
- A list of URLs to check for classes.Method Detail |
public void launch()
public void addClassPath(java.net.URL[] classpath)
public void run()
protected URLClassLoader createClassLoader()
protected java.lang.ThreadGroup createThreadGroup(java.lang.ThreadGroup parent)
public java.lang.ClassLoader getClassLoader()
public java.lang.ThreadGroup getThreadGroup()
public void registerResource(Resource resource)
resource
- The resource to be registered/locked.public void registerAndBindToResource(Resource resource)
resource
- The resource to lock and bind to.public void bindToResource(Resource resource)
public void releaseResources()
protected void releaseResource(Resource resource)
public void resourceDisposed(Resource resource)
public void kill()
public void tryGarbageCollect()
public long getPid()
public java.lang.String getName()
public int getState()
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |