|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openide.ServiceType | +--org.openide.execution.Executor | +--org.openide.execution.ProcessExecutor
Executes a class externally (in a separate process). Provides basic implementation that allows to specify the process to execute, its parameters and also to substitute the content of repositorypath, classpath, bootclasspath and librarypath. This is done by inner class Format.
The behaviour described here can be overriden by subclasses to use different format (extend the set of recognized tags), execute the process with additional environment properties, etc.
Inner Class Summary | |
static class |
ProcessExecutor.Format
Default format that can format tags related to execution. |
Inner classes inherited from class org.openide.ServiceType |
ServiceType.Handle, ServiceType.Registry |
Field Summary | |
protected NbProcessDescriptor |
externalExecutor
external process - like java.exe - property |
Fields inherited from class org.openide.ServiceType |
PROP_NAME |
Constructor Summary | |
ProcessExecutor()
Create a new executor. |
Method Summary | |
protected Process |
createProcess(DataObject obj)
Called to create the java.lang.Process for given data object. |
protected Process |
createProcess(ExecInfo info)
Called to create the java.lang.Process for given exec info. |
ExecutorTask |
execute(DataObject obj)
Executes given dataobject by creating new process in underlying operating system. |
ExecutorTask |
execute(ExecInfo info)
Execute a class given by name with some arguments in this executor. |
boolean |
getAppendEnvironmentVariables()
Check if environment variables will be appended or replaced. |
NbClassPath |
getBootClassPath()
Getter for boot class path associated with this executor. |
NbClassPath |
getClassPath()
Getter for class path associated with this executor. |
String[] |
getEnvironmentVariables()
Get environment variables. |
NbProcessDescriptor |
getExternalExecutor()
Get the current external execution command. |
HelpCtx |
getHelpCtx()
Get context help for this service type. |
NbClassPath |
getLibraryPath()
Getter for repository path. |
NbClassPath |
getRepositoryPath()
Getter for repository path. |
File |
getWorkingDirectory()
Get the working directory. |
void |
setAppendEnvironmentVariables(boolean nue)
Set whether environment variables should be appended and replaced. |
void |
setBootClassPath(NbClassPath path)
Setter for boot class path for this executor. |
void |
setClassPath(NbClassPath path)
Setter for class path for this executor. |
void |
setEnvironmentVariables(String[] nue)
Set environment variables. |
void |
setExternalExecutor(NbProcessDescriptor desc)
Set a new external execution command. |
void |
setWorkingDirectory(File nue)
Set the working directory. |
Methods inherited from class org.openide.execution.Executor |
executors, find, find, getDefault, needsIO |
Methods inherited from class org.openide.ServiceType |
addPropertyChangeListener, clone, createClone, displayName, firePropertyChange, getName, removePropertyChangeListener, setName |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected NbProcessDescriptor externalExecutor
Constructor Detail |
public ProcessExecutor()
Method Detail |
public void setExternalExecutor(NbProcessDescriptor desc)
desc
- the settings for the new external executorpublic HelpCtx getHelpCtx()
ServiceType
getHelpCtx
in class Executor
org.openide.ServiceType
public NbProcessDescriptor getExternalExecutor()
public NbClassPath getClassPath()
public void setClassPath(NbClassPath path)
public NbClassPath getBootClassPath()
public void setBootClassPath(NbClassPath path)
public NbClassPath getRepositoryPath()
public NbClassPath getLibraryPath()
public String[] getEnvironmentVariables()
NAME=VALUE
pairs, or null
(typically, inherit that of parent)public void setEnvironmentVariables(String[] nue)
nue
- the new variablesgetEnvironmentVariables()
public boolean getAppendEnvironmentVariables()
specified
, these are taken as is
for the process' environment, matching the standard Java platform
behavior. If true, any specified environment variables append to
or replace those found in the IDE's own environment, permitting
incremental changes.public void setAppendEnvironmentVariables(boolean nue)
nue
- true if sogetAppendEnvironmentVariables()
public File getWorkingDirectory()
null
(use that of parent)public void setWorkingDirectory(File nue)
nue
- the new directorygetWorkingDirectory()
protected Process createProcess(ExecInfo info) throws IOException
Subclasses can override this to achieve the right behaviour, add system properties, own format, etc.
info
- exec infoIOException
- if the action failsprotected Process createProcess(DataObject obj) throws IOException
Subclasses can override this to achive the right behaviour, add system properties, own format, etc.
obj
- data object to executeIOException
- if the action failspublic ExecutorTask execute(ExecInfo info) throws IOException
Executor
execute
in class Executor
org.openide.execution.Executor
info
- information describing what to executeIOException
- if the execution cannot be started (class is missing, etc.)public ExecutorTask execute(DataObject obj) throws IOException
execute
in class Executor
obj
- object to executeIOException
- if the action fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |