@Singleton public class ProcessManagerService extends Object implements ProcessManagerServiceMBean
| Constructor and Description |
|---|
ProcessManagerService(File storageLocation) |
ProcessManagerService(String storageLocation) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
allocatePortNumber(InstallOptions options,
File nestedProcessDirectory,
String key,
String value) |
protected void |
allocatePorts(InstallOptions options,
File nestedProcessDirectory) |
protected ProcessController |
createController(String id,
ProcessConfig config,
File rootDir,
File installDir) |
protected DownloadStrategy |
createDefaultDownloadStrategy() |
protected Installation |
createInstallation(io.hawt.aether.OpenMavenURL url,
String id,
File rootDir,
ProcessConfig config) |
protected File |
createInstallDir(String id) |
protected String |
createNextId(InstallOptions options)
Returns the next process ID
|
protected void |
exportInstallDirEnvVar(InstallOptions options,
File installDir,
InstallContext installContext,
ProcessConfig config) |
protected DownloadStrategy |
getDownloadStrategy(InstallOptions options) |
Executor |
getExecutor() |
Installation |
getInstallation(String id)
Returns the installation for the given ID or null if the installation does not exist
|
int |
getInstallationCount() |
String |
getInstallationIds() |
static String |
getLocalHostName()
When using the
InetAddress.getHostName() method in an
environment where neither a proper DNS lookup nor an /etc/hosts
entry exists for a given host, the following exception will be thrown:
java.net.UnknownHostException: <hostname>: <hostname>
at java.net.InetAddress.getLocalHost(InetAddress.java:1425)
... |
File |
getStorageLocation() |
Installation |
install(InstallOptions options,
InstallTask postInstall)
Installs a process with an optional URL of the controller JSON
together with an optional install step
|
protected Installation |
installViaScript(InstallOptions options,
InstallTask installTask) |
com.google.common.collect.ImmutableMap<String,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(File installDir,
InstallOptions options) |
ProcessConfig |
loadProcessConfig(File installDir,
InstallOptions options) |
void |
setExecutor(Executor executor) |
void |
setStorageLocation(File storageLocation) |
static void |
substituteEnvironmentVariableExpressions(Map<String,String> map,
Map<String,String> environmentVariables) |
String |
toString() |
void |
uninstall(Installation installation)
Uninstalls the given installation
|
@Inject
public ProcessManagerService(@ConfigProperty(name="process_dir",defaultValue="./processes")
String storageLocation)
throws MalformedObjectNameException,
IOException
public ProcessManagerService(File storageLocation) throws MalformedObjectNameException, IOException
public com.google.common.collect.ImmutableList<Installation> listInstallations()
ProcessManagerlistInstallations in interface ProcessManagerpublic com.google.common.collect.ImmutableMap<String,Installation> listInstallationMap()
listInstallationMap in interface ProcessManagerpublic Installation getInstallation(String id)
ProcessManagergetInstallation in interface ProcessManager@JmxManaged(description="Returns the set of installed processes") public String getInstallationIds()
@JmxManaged(description="Returns the number of installed processes") public int getInstallationCount()
public Installation install(InstallOptions options, InstallTask postInstall) throws Exception
ProcessManagerinstall in interface ProcessManagerExceptionprotected DownloadStrategy getDownloadStrategy(InstallOptions options)
protected void allocatePorts(InstallOptions options, File nestedProcessDirectory) throws IOException
IOExceptionpublic static String getLocalHostName() throws UnknownHostException
InetAddress.getHostName() method in an
environment where neither a proper DNS lookup nor an /etc/hosts
entry exists for a given host, the following exception will be thrown:
java.net.UnknownHostException: <hostname>: <hostname>
at java.net.InetAddress.getLocalHost(InetAddress.java:1425)
...
Instead of just throwing an UnknownHostException and giving up, this
method grabs a suitable hostname from the exception and prevents the
exception from being thrown. If a suitable hostname cannot be acquired
from the exception, only then is the UnknownHostException thrown.UnknownHostExceptionjava.net.InetAddress#getLocalHost()},
java.net.InetAddress#getHostName()}protected int allocatePortNumber(InstallOptions options, File nestedProcessDirectory, String key, String value)
protected void exportInstallDirEnvVar(InstallOptions options, File installDir, InstallContext installContext, ProcessConfig config) throws IOException
IOExceptionpublic void uninstall(Installation installation)
ProcessManageruninstall in interface ProcessManagerpublic ProcessConfig loadProcessConfig(File installDir, InstallOptions options) throws IOException
loadProcessConfig in interface ProcessManagerIOExceptionpublic File getStorageLocation()
public void setStorageLocation(File storageLocation)
public Executor getExecutor()
getExecutor in interface ProcessManagerpublic void setExecutor(Executor executor)
protected Installation installViaScript(InstallOptions options, InstallTask installTask) throws Exception
Exceptionprotected DownloadStrategy createDefaultDownloadStrategy()
protected ProcessConfig loadControllerJson(File installDir, InstallOptions options) throws IOException
IOExceptionprotected String createNextId(InstallOptions options)
protected Installation createInstallation(io.hawt.aether.OpenMavenURL url, String id, File rootDir, ProcessConfig config)
protected ProcessController createController(String id, ProcessConfig config, File rootDir, File installDir)
Copyright © 2014 Red Hat. All Rights Reserved.