net.sf.mmm.util.process.base
Class ProcessUtilImpl.ProcessExecutor

java.lang.Object
  extended by net.sf.mmm.util.process.base.ProcessUtilImpl.ProcessExecutor
All Implemented Interfaces:
Callable<Integer>, Stoppable
Enclosing class:
ProcessUtilImpl

protected class ProcessUtilImpl.ProcessExecutor
extends Object
implements Callable<Integer>, Stoppable

This inner class is does the actual execution of the Process(es).


Field Summary
private  ProcessContext context
           
private  Process[] processes
           
private  AsyncTransferrer[] transferrers
           
 
Constructor Summary
ProcessUtilImpl.ProcessExecutor(ProcessContext context, ProcessBuilder[] builders)
          The constructor.
 
Method Summary
 Integer call()
           This method executes the Process(es).
protected  void dispose()
          This method disposes this executor.
 void stop()
          This method stops the task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

private final ProcessContext context
See Also:
ProcessExecutor#ProcessExecutor(ProcessContext, ProcessBuilder[])

processes

private final Process[] processes
See Also:
ProcessExecutor#ProcessExecutor(ProcessContext, ProcessBuilder[])

transferrers

private final AsyncTransferrer[] transferrers
See Also:
ProcessExecutor#ProcessExecutor(ProcessContext, ProcessBuilder[])
Constructor Detail

ProcessUtilImpl.ProcessExecutor

public ProcessUtilImpl.ProcessExecutor(ProcessContext context,
                                       ProcessBuilder[] builders)
                                throws IOException
The constructor.

Parameters:
context - is the context of the process pipe.
builders - are the configurations of the Process(es) to execute. The array needs to have a length greater than zero.
Throws:
IOException - if an input/output error occurred.
Method Detail

dispose

protected void dispose()
This method disposes this executor. All processes are destroyed and all streams are closed.


stop

public void stop()
This method stops the task.

Specified by:
stop in interface Stoppable

call

public Integer call()
             throws InterruptedException
This method executes the Process(es).

Specified by:
call in interface Callable<Integer>
Returns:
the return-code of the (last) process.
Throws:
InterruptedException - if a process was interrupted.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.