org.fusesource.process.manager.support
Class ProcessManagerImpl

java.lang.Object
  extended by org.fusesource.process.manager.support.ProcessManagerImpl
All Implemented Interfaces:
ProcessManager

public class ProcessManagerImpl
extends java.lang.Object
implements ProcessManager


Constructor Summary
ProcessManagerImpl()
           
ProcessManagerImpl(java.io.File storageLocation)
           
 
Method Summary
protected  ProcessController createController(int id, ProcessConfig config, java.io.File rootDir, java.io.File installDir)
           
protected  Installation createInstallation(int id, java.io.File rootDir, ProcessConfig config)
           
protected  java.io.File createInstallDir(int id)
           
protected  int createNextId()
          Returns the next process ID
protected  java.io.File findInstallDir(java.io.File rootDir)
          Lets find the install dir, which may be the root dir or could be a child directory (as typically untarring will create a new child directory)
 java.util.concurrent.Executor getExecutor()
           
 java.io.File getStorageLocation()
           
 void init()
           
 Installation install(java.lang.String url, java.net.URL controllerJson)
          Installs a process with an optional URL of the controller JSON
protected  boolean installExists(java.io.File file)
           
 Installation installJar(JarInstallParameters parameters)
          Installs an executable jar as a new managed process
protected  Installation installViaScript(java.net.URL controllerJson, InstallScript installScript)
           
 com.google.common.collect.ImmutableMap<java.lang.Integer,Installation> listInstallationMap()
           
 com.google.common.collect.ImmutableList<Installation> listInstallations()
          Returns the current installed processes which may or may not be running right now
protected  ProcessConfig loadControllerJson(java.net.URL controllerJson)
           
 void setExecutor(java.util.concurrent.Executor executor)
           
 void setStorageLocation(java.io.File storageLocation)
           
 java.lang.String toString()
           
protected  void untarTarball(java.lang.String url, java.io.File installDir)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProcessManagerImpl

public ProcessManagerImpl()

ProcessManagerImpl

public ProcessManagerImpl(java.io.File storageLocation)
Method Detail

init

public void init()
          throws java.lang.Exception
Throws:
java.lang.Exception

toString

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

listInstallations

public com.google.common.collect.ImmutableList<Installation> listInstallations()
Description copied from interface: ProcessManager
Returns the current installed processes which may or may not be running right now

Specified by:
listInstallations in interface ProcessManager

listInstallationMap

public com.google.common.collect.ImmutableMap<java.lang.Integer,Installation> listInstallationMap()
Specified by:
listInstallationMap in interface ProcessManager

install

public Installation install(java.lang.String url,
                            java.net.URL controllerJson)
                     throws java.lang.Exception
Description copied from interface: ProcessManager
Installs a process with an optional URL of the controller JSON

Specified by:
install in interface ProcessManager
Throws:
java.lang.Exception

installJar

public Installation installJar(JarInstallParameters parameters)
                        throws java.lang.Exception
Description copied from interface: ProcessManager
Installs an executable jar as a new managed process

Specified by:
installJar in interface ProcessManager
Throws:
java.lang.Exception

getStorageLocation

public java.io.File getStorageLocation()

setStorageLocation

public void setStorageLocation(java.io.File storageLocation)

getExecutor

public java.util.concurrent.Executor getExecutor()

setExecutor

public void setExecutor(java.util.concurrent.Executor executor)

installViaScript

protected Installation installViaScript(java.net.URL controllerJson,
                                        InstallScript installScript)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

untarTarball

protected void untarTarball(java.lang.String url,
                            java.io.File installDir)
                     throws java.io.IOException,
                            CommandFailedException
Throws:
java.io.IOException
CommandFailedException

loadControllerJson

protected ProcessConfig loadControllerJson(java.net.URL controllerJson)
                                    throws java.io.IOException
Throws:
java.io.IOException

createNextId

protected int createNextId()
Returns the next process ID


createInstallDir

protected java.io.File createInstallDir(int id)

createInstallation

protected Installation createInstallation(int id,
                                          java.io.File rootDir,
                                          ProcessConfig config)

createController

protected ProcessController createController(int id,
                                             ProcessConfig config,
                                             java.io.File rootDir,
                                             java.io.File installDir)

findInstallDir

protected java.io.File findInstallDir(java.io.File rootDir)
Lets find the install dir, which may be the root dir or could be a child directory (as typically untarring will create a new child directory)


installExists

protected boolean installExists(java.io.File file)


Copyright © 2013 Red Hat. All Rights Reserved.