public class ProcessShell extends Object implements ManagedProcessContext, ProcessShellMBean
Modifier and Type | Field and Description |
---|---|
static String |
TRIGGER_STOP_PROCESS_METHOD
Name of the
triggerStopProcess() method to invoke via another
MBean. |
Constructor and Description |
---|
ProcessShell(String processNamespace,
JMXConnectorServer connectorServer,
ObjectOutputStream toParentPipe)
Initiate for
Process . |
ProcessShell(String processNamespace,
MBeanServer mbeanServer)
Initiate for running locally.
|
Modifier and Type | Method and Description |
---|---|
boolean |
continueProcessing()
Flags whether to continue processing.
|
String |
getJmxConnectorServiceUrl()
|
String |
getProcessNamespace()
Obtains the name space for the
ManagedProcess . |
static ObjectName |
getProcessShellObjectName()
Obtains the
ObjectName for the ProcessShellMBean . |
static void |
main(String[] arguments)
Entrance point for running the
ManagedProcess . |
void |
registerMBean(Object mbean,
ObjectName name)
Registers a MBean.
|
static void |
run(String processNamespace,
byte[] serialisedManagedProcess)
Entrance point for running the
ManagedProcess in current
Process . |
void |
triggerStopProcess()
Triggers gracefully stopping the
Process . |
public static final String TRIGGER_STOP_PROCESS_METHOD
triggerStopProcess()
method to invoke via another
MBean.public ProcessShell(String processNamespace, JMXConnectorServer connectorServer, ObjectOutputStream toParentPipe)
Process
.processNamespace
- ManagedProcess
name space.connectorServer
- JMXConnectorServer
.toParentPipe
- ObjectOutputStream
to send the notifications.public ProcessShell(String processNamespace, MBeanServer mbeanServer)
processNamespace
- ManagedProcess
name space.mbeanServer
- Local MBeanServer
.public static ObjectName getProcessShellObjectName()
ObjectName
for the ProcessShellMBean
.ObjectName
for the ProcessShellMBean
.public static void run(String processNamespace, byte[] serialisedManagedProcess) throws Throwable
ManagedProcess
in current
Process
.processNamespace
- ManagedProcess
name space.serialisedManagedProcess
- Serialised ManagedProcess
to be run.Throwable
- If failure in running the ManagedProcess
.public static void main(String[] arguments) throws IOException
ManagedProcess
.arguments
- Arguments.IOException
- If failure in running the ManagedProcess
.public String getJmxConnectorServiceUrl()
ProcessShellMBean
getJmxConnectorServiceUrl
in interface ProcessShellMBean
JMXConnector
JMXServiceURL
for the
Process
.public void triggerStopProcess()
ProcessShellMBean
Process
.triggerStopProcess
in interface ProcessShellMBean
public String getProcessNamespace()
ManagedProcessContext
ManagedProcess
.getProcessNamespace
in interface ManagedProcessContext
ManagedProcess
.public void registerMBean(Object mbean, ObjectName name) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException
ManagedProcessContext
Registers a MBean.
This is equivalent to corresponding MBeanServer
method except
that it also registers the MBean within the MBeanServer
in the
parent managing the Process
.
registerMBean
in interface ManagedProcessContext
mbean
- MBean.name
- ObjectName
of the MBean.InstanceAlreadyExistsException
- The MBean is already under the control of the
MBeanServer
.MBeanRegistrationException
- Failure in registering the MBean.NotCompliantMBeanException
- This MBean is not a JMX compliant MBean.MBeanServer.registerMBean(Object, ObjectName)
public boolean continueProcessing()
ManagedProcessContext
continueProcessing
in interface ManagedProcessContext
true
for the ManagedProcess
to continue
processing. false
to gracefully stop.Copyright © 2005–2016. All rights reserved.