Package com._1c.g5.v8.dt.internal.pm
Class ProcessManager
java.lang.Object
com._1c.g5.v8.dt.internal.pm.ProcessManager
- All Implemented Interfaces:
IProcessManager
An IProcessManager interface basic implementation
-
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()IProcessManager.dispose()method implementation.voidIProcessManager.dispose(String)method implementation.voidIProcessManager.dispose(String, Object)method implementation.<T> ICloseableInstance<T>getCloseableInstance(String key, Class<T> service) IProcessManager.getCloseableInstance(String, Class)method implementation.getErrorsStream(String key) IProcessManager.getErrorsStream(String)method implementation.getInputStream(String key) IProcessManager.getInputStream(String)method implementation.<T> TgetInstance(String key, Class<T> service) A basic implementation of theIProcessManagerinterface'sgetInstance(String, Class)methodgetOutputStream(String key) IProcessManager.getOutputStream(String)method implementation.getProcessBinder(String key) Returns new or exiting instance ofProcessBinderwhich allows bindings for the process with given key.static ProcessManagerReturns an instance ofIProcessManager.booleanisProcessAlive(String key) IProcessManager#isBound(String, Class)method implementation.
-
Method Details
-
getProcessManager
Returns an instance of
IProcessManager.- Throws:
RemoteException- if startup RMI registering failsAlreadyBoundException- if IProcessRegister is already bound (for instance, if other instance ofIProcessManageris created and it has chosen the same port).PortAllocatingException- when cannot obtain free port to make RMI registry listen on
-
isProcessAlive
IProcessManager#isBound(String, Class)method implementation.- Specified by:
isProcessAlivein interfaceIProcessManager- Parameters:
key- given key- Returns:
trueif the process with given key is currently runningfalseotherwise.
-
getProcessBinder
Description copied from interface:IProcessManagerReturns new or exiting instance of
ProcessBinderwhich allows bindings for the process with given key. Each calling for the same key will return the same instance.- Specified by:
getProcessBinderin interfaceIProcessManager- Parameters:
key- given key- Returns:
- new or exiting instance of
ProcessBinderwhich allows bindings for the process with given key - See Also:
-
getInstance
public <T> T getInstance(String key, Class<T> service) throws InstantiationException, IllegalAccessException, IOException, InterruptedException, ProcessStartingTimedOut, ProcessExitedWithErrorException A basic implementation of the
IProcessManagerinterface'sgetInstance(String, Class)method- Specified by:
getInstancein interfaceIProcessManager- Type Parameters:
T- - the type of the service- Parameters:
key- - the key of the process within that to run the implementation (notnull)service- - the service for that to return a stub (notnull)- Returns:
- a stub for given service binded to implementation instance running within a separate process (not
null) - Throws:
InstantiationException- if the implementation represents an abstract class, an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reasonIllegalAccessException- if could not instantiate the implementation by it's default constructor (for instance, if the default constructor is unaccessible)IOException- if request of starting a new process or creating an instance within a process is failedInterruptedException- if request of starting a new process is interruptedProcessStartingTimedOut- if could not initially start the process, or process does not responseProcessExitedWithErrorException- if process has not already started, and just after it started, it has exited with error code
-
getCloseableInstance
public <T> ICloseableInstance<T> getCloseableInstance(String key, Class<T> service) throws IllegalAccessException, InstantiationException, IOException, InterruptedException, ProcessStartingTimedOut, ProcessExitedWithErrorException, IllegalStateException IProcessManager.getCloseableInstance(String, Class)method implementation.- Specified by:
getCloseableInstancein interfaceIProcessManager- Parameters:
key- a key of a process within that service implementation is runningservice- a service for that instance is created- Returns:
ICloseableInstancewith wrapped instance created byIProcessManager.getInstance(String, Class)method andICloseableInstance.close()which invokesdispose(key, instance)- Throws:
IllegalAccessException- if could not instantiate the implementation by it's default constructor (for instance, if the default constructor is unaccessible)InstantiationException- if the implementation represents an abstract class, an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reasonIOException- if request of starting a new process or creating an instance within a process is failedInterruptedException- if request of starting a new process is interruptedProcessStartingTimedOut- if could not initially start the process, or process does not responseProcessExitedWithErrorException- if process has not already started, and just after it started, it has exited with error codeIllegalStateException- if 'java.security.policy' system property is not set (System.getProperty("java.security.policy")returns null), or service for key is not bound.- See Also:
-
getOutputStream
IProcessManager.getOutputStream(String)method implementation.- Specified by:
getOutputStreamin interfaceIProcessManager- Parameters:
key- given process's key (notnull)- Returns:
- an output stream piped to the process's standard input stream,
or null output stream if process's input stream is redirected,
or
nullif process with given key has never been running - See Also:
-
getInputStream
IProcessManager.getInputStream(String)method implementation.- Specified by:
getInputStreamin interfaceIProcessManager- Parameters:
key- given process's key (notnull)- Returns:
- an input stream piped to the process's standard output stream,
or null input stream if porcess's output stream is redirected,
or
nullif process has never been running - See Also:
-
getErrorsStream
IProcessManager.getErrorsStream(String)method implementation.- Specified by:
getErrorsStreamin interfaceIProcessManager- Parameters:
key- given process's key (notnull)- Returns:
- an input stream piped to the process's standard error stream,
or null input stream if porcess's error stream is redirected,
or
nullif process has never been running - See Also:
-
dispose
public void dispose()IProcessManager.dispose()method implementation.- Specified by:
disposein interfaceIProcessManager
-
dispose
IProcessManager.dispose(String)method implementation.- Specified by:
disposein interfaceIProcessManager- Parameters:
key- - the key for that to release resources. This key is also associated with the process to kill. (notnull)
-
dispose
IProcessManager.dispose(String, Object)method implementation.- Specified by:
disposein interfaceIProcessManager- Parameters:
key- - the specified key for that the object associated with stub is running. (notnull) Also associated with one remote processstub- - the stub to release obtained before byIProcessManager.getInstance(String, Class)method (notnull)
-