org.fusesource.process.manager.support
Class DefaultProcessController

java.lang.Object
  extended by org.fusesource.process.manager.support.DefaultProcessController
All Implemented Interfaces:
ProcessController

public class DefaultProcessController
extends java.lang.Object
implements ProcessController

A default implementation of ProcessController which assumes a launch script which takes opertions as the first argument such as for the Init Script Actions spec


Constructor Summary
DefaultProcessController(int id, ProcessConfig config, java.util.concurrent.Executor executor, java.io.File baseDir)
           
 
Method Summary
 int configure()
           
 java.io.File getBaseDir()
           
 java.util.concurrent.Executor getExecutor()
           
protected  java.lang.String getLaunchScript()
           
 java.lang.Integer getPid()
           
 int install()
           
 int kill()
           
 int restart()
           
protected  int runCommandLine(java.lang.String command)
          Converts a space separated command line into a Command and executes it
protected  int runConfigCommandValueOrLaunchScriptWith(java.lang.String command, java.lang.String launchArgument)
           
 int start()
           
 int status()
           
 int stop()
           
 java.lang.String toString()
           
 int uninstall()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultProcessController

public DefaultProcessController(int id,
                                ProcessConfig config,
                                java.util.concurrent.Executor executor,
                                java.io.File baseDir)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

install

public int install()
            throws java.lang.InterruptedException,
                   java.io.IOException,
                   CommandFailedException
Specified by:
install in interface ProcessController
Throws:
java.lang.InterruptedException
java.io.IOException
CommandFailedException

uninstall

public int uninstall()
Specified by:
uninstall in interface ProcessController

start

public int start()
          throws java.lang.Exception
Specified by:
start in interface ProcessController
Throws:
java.lang.Exception

stop

public int stop()
         throws java.lang.Exception
Specified by:
stop in interface ProcessController
Throws:
java.lang.Exception

kill

public int kill()
         throws java.lang.Exception
Specified by:
kill in interface ProcessController
Throws:
java.lang.Exception

restart

public int restart()
            throws java.lang.Exception
Specified by:
restart in interface ProcessController
Throws:
java.lang.Exception

status

public int status()
           throws java.lang.Exception
Specified by:
status in interface ProcessController
Throws:
java.lang.Exception

configure

public int configure()
              throws java.lang.Exception
Specified by:
configure in interface ProcessController
Throws:
java.lang.Exception

getBaseDir

public java.io.File getBaseDir()

getExecutor

public java.util.concurrent.Executor getExecutor()

getPid

public java.lang.Integer getPid()
                         throws java.io.IOException
Specified by:
getPid in interface ProcessController
Throws:
java.io.IOException

getLaunchScript

protected java.lang.String getLaunchScript()

runConfigCommandValueOrLaunchScriptWith

protected int runConfigCommandValueOrLaunchScriptWith(java.lang.String command,
                                                      java.lang.String launchArgument)
                                               throws java.lang.InterruptedException,
                                                      java.io.IOException,
                                                      CommandFailedException
Throws:
java.lang.InterruptedException
java.io.IOException
CommandFailedException

runCommandLine

protected int runCommandLine(java.lang.String command)
                      throws java.io.IOException,
                             java.lang.InterruptedException,
                             CommandFailedException
Converts a space separated command line into a Command and executes it

Throws:
java.io.IOException
java.lang.InterruptedException
CommandFailedException


Copyright © 2013 Red Hat. All Rights Reserved.