public class ProcessManager extends Object implements ProcessManagerMBean
Process
.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PROCESS_NAME
Default
ManagedProcess name. |
Modifier and Type | Method and Description |
---|---|
void |
destroyProcess()
Forcibly destroys the
Process . |
ObjectName |
getLocalObjectName(ObjectName objectName)
Obtains the local
ObjectName for the remote MBean in the
Process being managed by this ProcessManager . |
static ObjectName |
getLocalObjectName(String processNamespace,
ObjectName remoteObjectName)
Obtains the local
ObjectName for the remote MBean in the
Process being managed within the MBean name space . |
String |
getProcessHostName()
Obtains the host name that the
Process is running on. |
static ObjectName |
getProcessManagerObjectName()
Obtains the
ObjectName for the ProcessManagerMBean . |
String |
getProcessName()
Obtains the name given to the
Process . |
String |
getProcessNamespace()
Obtains the unique name space for
Process . |
int |
getProcessPort()
|
boolean |
isProcessComplete()
Indicates if the
ManagedProcess is complete. |
static void |
runProcess(ManagedProcess managedProcess,
ProcessConfiguration configuration)
|
static ProcessManager |
startProcess(ManagedProcess managedProcess,
ProcessConfiguration configuration)
|
void |
triggerStopProcess()
Triggers for a graceful shutdown of the
Process . |
public static final String DEFAULT_PROCESS_NAME
ManagedProcess
name.public static ObjectName getProcessManagerObjectName()
ObjectName
for the ProcessManagerMBean
.ObjectName
for the ProcessManagerMBean
.public static void runProcess(ManagedProcess managedProcess, ProcessConfiguration configuration) throws ProcessException
managedProcess
- ManagedProcess
.configuration
- Optional ProcessConfiguration
. May be
null
to use defaults. Please note that most of
the attributes such as JVM options are ignored as the current
Process
can not be altered.ProcessException
- if fails to run the ManagedProcess
.public static ProcessManager startProcess(ManagedProcess managedProcess, ProcessConfiguration configuration) throws ProcessException
managedProcess
- ManagedProcess
.configuration
- Optional ProcessConfiguration
. May be
null
to use defaults.ProcessManager
.ProcessException
- If fails to start the Process
.public static ObjectName getLocalObjectName(String processNamespace, ObjectName remoteObjectName) throws MalformedObjectNameException
ObjectName
for the remote MBean in the
Process
being managed within the MBean name space
.processNamespace
- Name space of the Process
.remoteObjectName
- ObjectName
of the remote MBean.ObjectName
for the remote MBean in the
Process
being managed.MalformedObjectNameException
- If resulting local name is malformed.public ObjectName getLocalObjectName(ObjectName objectName) throws MalformedObjectNameException
ObjectName
for the remote MBean in the
Process
being managed by this ProcessManager
.objectName
- ObjectName
of the remote MBean.ObjectName
for the remote MBean in the
Process
being managed.MalformedObjectNameException
- If resulting local name is malformed.public String getProcessName()
ProcessManagerMBean
Obtains the name given to the Process
.
The name may not be unique as more than one Process
may be
started with the same name.
See ProcessManagerMBean.getProcessNamespace()
for a unique name.
getProcessName
in interface ProcessManagerMBean
Process
.ProcessManagerMBean.getProcessNamespace()
public String getProcessNamespace()
ProcessManagerMBean
Obtains the unique name space for Process
.
This is the unique name that identifies the Process
running
within the OfficeBuilding
. The name is derived from the
ProcessManagerMBean.getProcessName()
however to maintain uniqueness the process name
may be adjusted (typically by providing a unique suffix).
getProcessNamespace
in interface ProcessManagerMBean
Process
.public String getProcessHostName()
ProcessManagerMBean
Process
is running on.getProcessHostName
in interface ProcessManagerMBean
Process
is running on.public int getProcessPort()
ProcessManagerMBean
getProcessPort
in interface ProcessManagerMBean
Registry
containing the
MBeanServer
for this Process
.public void triggerStopProcess() throws ProcessException
ProcessManagerMBean
Triggers for a graceful shutdown of the Process
.
This is a non-blocking call to allow a timeout on graceful shutdown.
triggerStopProcess
in interface ProcessManagerMBean
ProcessException
- If fails to stop the Process
.public void destroyProcess()
ProcessManagerMBean
Process
.destroyProcess
in interface ProcessManagerMBean
public boolean isProcessComplete()
ProcessManagerMBean
ManagedProcess
is complete.isProcessComplete
in interface ProcessManagerMBean
true
if the ManagedProcess
is complete.Copyright © 2005–2016. All rights reserved.