public class OfficeBuildingManager extends Object implements OfficeBuildingManagerMBean
OfficeBuilding
Manager.Modifier and Type | Field and Description |
---|---|
static String |
OFFICE_BUILDING_ARTIFACT_ID
Maven Artifact Id for this
OfficeBuilding . |
static String |
OFFICE_BUILDING_GROUP_ID
Maven Group Id for the
OfficeBuilding . |
static String |
OFFICE_BUILDING_PROPERTY_PREFIX
Prefix to property names from
System.getProperties() for
configuration. |
Modifier and Type | Method and Description |
---|---|
void |
closeOfficeFloor(String processNamespace,
long waitTime)
Closes the
OfficeFloor . |
static <I> I |
getMBeanProxy(String hostName,
int port,
File trustStore,
String trustStorePassword,
String userName,
String password,
ObjectName mbeanName,
Class<I> mbeanInterface)
Obtains the MBean proxy.
|
String |
getOfficeBuildingHostName()
Obtains the name of the host running the
OfficeBuilding . |
String |
getOfficeBuildingJmxServiceUrl()
|
static JMXServiceURL |
getOfficeBuildingJmxServiceUrl(String hostName,
int port)
|
static OfficeBuildingManagerMBean |
getOfficeBuildingManager(String hostName,
int port,
File trustStore,
String trustStorePassword,
String userName,
String password)
Obtains the
OfficeBuildingManagerMBean for the
OfficeBuilding . |
static ObjectName |
getOfficeBuildingManagerObjectName()
Obtains
ObjectName for the OfficeBuildingManagerMBean . |
int |
getOfficeBuildingPort()
Obtains the port that the
OfficeBuilding is listening on. |
static OfficeFloorManagerMBean |
getOfficeFloorManager(String hostName,
int port,
String processNamespace,
File trustStore,
String trustStorePassword,
String userName,
String password)
Obtains the
OfficeFloorManagerMBean . |
static ProcessManagerMBean |
getProcessManager(String hostName,
int port,
String processNamespace,
File trustStore,
String trustStorePassword,
String userName,
String password)
Obtains the
ProcessManagerMBean by the process name for the
OfficeBuilding . |
static ProcessShellMBean |
getProcessShell(String hostName,
int port,
String processNamespace,
File trustStore,
String trustStorePassword,
String userName,
String password)
Obtains the
ProcessShellMBean by the process name for the
OfficeBuilding . |
static String |
getSslAlgorithm()
Obtains the SSL algorithm being used.
|
static String |
getSslProtocol()
Obtains the SSL protocol being used.
|
Date |
getStartTime()
Obtains the time the
OfficeBuilding was started. |
static boolean |
isOfficeBuildingAvailable(String hostName,
int port,
File trustStore,
String trustStorePassword,
String userName,
String password)
Determines if the
OfficeBuilding is available for use. |
boolean |
isOfficeBuildingStopped()
Indicates if the
OfficeBuilding has been stopped. |
String[] |
listProcessNamespaces()
Provides a listing of the
Process name spaces currently running
within the OfficeBuilding . |
String |
openOfficeFloor(OpenOfficeFloorConfiguration configuration)
Opens an
OfficeFloor within the OfficeBuilding . |
String |
openOfficeFloor(String arguments)
Opens an
OfficeFloor within the OfficeBuilding . |
static ProcessManager |
spawnOfficeBuilding(String hostName,
int port,
File keyStore,
String keyStorePassword,
String userName,
String password,
File workspace,
boolean isIsolateProcesses,
Properties environment,
String[] jvmOptions,
boolean isAllowClassPathEntries,
ProcessConfiguration configuration)
Spawns an
OfficeBuilding in a new Process . |
static OfficeBuildingManagerMBean |
startOfficeBuilding(String hostName,
int port,
File keyStore,
String keyStorePassword,
String userName,
String password,
File workspace,
boolean isIsolateProcesses,
Properties environment,
MBeanServer mbeanServer,
String[] jvmOptions,
boolean isAllowClassPathEntries)
Starts the
OfficeBuilding . |
String |
stopOfficeBuilding(long waitTime)
Stops the
OfficeBuilding . |
public static final String OFFICE_BUILDING_GROUP_ID
OfficeBuilding
.public static final String OFFICE_BUILDING_ARTIFACT_ID
OfficeBuilding
.public static final String OFFICE_BUILDING_PROPERTY_PREFIX
System.getProperties()
for
configuration.public static ObjectName getOfficeBuildingManagerObjectName()
ObjectName
for the OfficeBuildingManagerMBean
.ObjectName
for the OfficeBuildingManagerMBean
.public static String getSslProtocol()
public static String getSslAlgorithm()
public static OfficeBuildingManagerMBean startOfficeBuilding(String hostName, int port, File keyStore, String keyStorePassword, String userName, String password, File workspace, boolean isIsolateProcesses, Properties environment, MBeanServer mbeanServer, String[] jvmOptions, boolean isAllowClassPathEntries) throws Exception
OfficeBuilding
.hostName
- Host for the OfficeBuilding
. This is necessary as the
RMI JMXConnector
uses this to connect to the
OfficeBuilding
. May be null
to use the
localhost's host name.port
- Port for the OfficeBuilding
.keyStore
- File
containing the security keys.keyStorePassword
- Password to the key store File
.userName
- User name to allow connecting to the
OfficeBuildingManager
.password
- Password to allow connecting to the
OfficeBuildingManager
.workspace
- Work space for the OfficeBuilding
. May be
null
to use default location (temp directory).isIsolateProcesses
- Flag indicating to isolate each Process
.
false
will have artifacts shared between
Process
instances.environment
- Environment Properties
.mbeanServer
- MBeanServer
. May be null
to use platform
MBeanServer
.jvmOptions
- JVM options for the spawned Process
instances.isAllowClassPathEntries
- Flag indicating if allow class path entries via the
OpenOfficeFloorConfiguration
.OfficeBuildingManager
managing the started
OfficeBuilding
.Exception
- If fails to start the OfficeBuilding
.public static boolean isOfficeBuildingAvailable(String hostName, int port, File trustStore, String trustStorePassword, String userName, String password)
OfficeBuilding
is available for use.hostName
- Name of host where the OfficeBuilding
should be
available.port
- Port on which the OfficeBuilding
should be available.trustStore
- File
containing the trusted security keys.trustStorePassword
- Password to the trusted key store File
.userName
- User name to connect.password
- Password to connect.true
if the OfficeBuilding
is available.public static ProcessManager spawnOfficeBuilding(String hostName, int port, File keyStore, String keyStorePassword, String userName, String password, File workspace, boolean isIsolateProcesses, Properties environment, String[] jvmOptions, boolean isAllowClassPathEntries, ProcessConfiguration configuration) throws ProcessException
OfficeBuilding
in a new Process
.hostName
- Host for the OfficeBuilding
. This is necessary as the
RMI JMXConnector
uses this to connect to the
OfficeBuilding
. May be null
to use the
localhost's host name.port
- Port for the OfficeBuilding
.keyStore
- File
containing the security keys.keyStorePassword
- Password to the key store File
.userName
- User name to connect.password
- Password to connect.workspace
- Workspace for the OfficeBuilding
.isIsolateProcesses
- Flag indicating to isolate the Process
instances.environment
- Environment Properties
. May be null
.configuration
- ProcessConfiguration
. May be null
.jvmOptions
- JVM options for the Process
instances.isAllowClassPathEntries
- Flag indicating if the OfficeBuilding
will allow
configured class path entries.ProcessManager
managing the started
OfficeBuilding
.ProcessException
- If fails to spawn the OfficeBuilding
.public static OfficeBuildingManagerMBean getOfficeBuildingManager(String hostName, int port, File trustStore, String trustStorePassword, String userName, String password) throws Exception
Obtains the OfficeBuildingManagerMBean
for the
OfficeBuilding
.
This a utility method to obtain the OfficeBuildingManagerMBean
of
an existing OfficeBuilding
.
hostName
- Name of the host where the OfficeBuilding
resides.
null
indicates localhost.port
- Port where the OfficeBuilding
resides.trustStore
- File
containing the trusted security keys.trustStorePassword
- Password to the trusted key store File
.userName
- User name to connect.password
- Password to connect.OfficeBuildingManagerMBean
.Exception
- If fails to obtain the OfficeBuildingManagerMBean
.public static ProcessManagerMBean getProcessManager(String hostName, int port, String processNamespace, File trustStore, String trustStorePassword, String userName, String password) throws Exception
Obtains the ProcessManagerMBean
by the process name for the
OfficeBuilding
.
This a utility method to obtain the ProcessManagerMBean
of an
existing Process
currently running within the
OfficeBuilding
.
hostName
- Name of the host where the OfficeBuilding
resides.
null
indicates localhost.port
- Port where the OfficeBuilding
resides.processNamespace
- Name of the Process
to obtain its
ProcessManagerMBean
.trustStore
- File
containing the trusted security keys.trustStorePassword
- Password to the trusted key store File
.userName
- User name to connect.password
- Password to connect.ProcessManagerMBean
.Exception
- If fails to obtain the ProcessManagerMBean
.public static ProcessShellMBean getProcessShell(String hostName, int port, String processNamespace, File trustStore, String trustStorePassword, String userName, String password) throws Exception
Obtains the ProcessShellMBean
by the process name for the
OfficeBuilding
.
This a utility method to obtain the ProcessShellMBean
of an
existing Process
currently being managed within the
OfficeBuilding
.
hostName
- Name of the host where the OfficeBuilding
resides.
null
indicates localhost.port
- Port where the OfficeBuilding
resides.processNamespace
- Name of the Process
to obtain its
ProcessShellMBean
.trustStore
- File
containing the trusted security keys.trustStorePassword
- Password to the trusted key store File
.userName
- User name to connect.password
- Password to connect.ProcessShellMBean
.Exception
- If fails to obtain the ProcessShellMBean
.public static OfficeFloorManagerMBean getOfficeFloorManager(String hostName, int port, String processNamespace, File trustStore, String trustStorePassword, String userName, String password) throws Exception
Obtains the OfficeFloorManagerMBean
.
The hostName
and port
are of the
OfficeBuilding
managing the OfficeFloor
Process
.
They are not of the specific Process
containing the
OfficeFloor
.
hostName
- Name of the host where the OfficeBuilding
resides.
null
indicates localhost.port
- Port where the OfficeBuilding
resides.trustStore
- File
containing the trusted security keys.trustStorePassword
- Password to the trusted key store File
.userName
- User name to connect.password
- Password to connect.processNamespace
- Namespace of the OfficeFloorManagerMBean
.OfficeFloorManagerMBean
.Exception
- If fails to obtain OfficeFloorManagerMBean
.public static JMXServiceURL getOfficeBuildingJmxServiceUrl(String hostName, int port) throws IOException
Obtains the OfficeBuilding
JMXConnectorServer
JMXServiceURL
.
This a utility method to obtain the JMXServiceURL
of an existing
OfficeBuilding
.
hostName
- Name of the host where the OfficeBuilding
resides.
null
indicates localhost.port
- Port the OfficeBuilding
is residing on.JMXServiceURL
to the OfficeBuilding
JMXConnectorServer
.IOException
- If fails to obtain the JMXServiceURL
.public static <I> I getMBeanProxy(String hostName, int port, File trustStore, String trustStorePassword, String userName, String password, ObjectName mbeanName, Class<I> mbeanInterface) throws IOException
Obtains the MBean proxy.
This a utility method to obtain an MBean from an existing Office Building.
I
- MBean interface type.hostName
- Host where the OfficeBuilding
resides.port
- Port where the OfficeBuilding
resides.trustStore
- File
containing the trusted security keys.trustStorePassword
- Password to the trusted key store File
.userName
- User name to connect.password
- Password to connect.mbeanName
- ObjectName
for the MBean.mbeanInterface
- MBean interface of the MBean.IOException
- If fails to obtain the MBean proxy.public Date getStartTime()
OfficeBuildingManagerMBean
Obtains the time the OfficeBuilding
was started.
The time is specific to the host the OfficeBuilding
is running
on.
getStartTime
in interface OfficeBuildingManagerMBean
OfficeBuilding
was started.public String getOfficeBuildingJmxServiceUrl()
OfficeBuildingManagerMBean
Obtains the JMXServiceURL
of the OfficeBuilding
being
managed by this OfficeBuildingManagerMBean
.
The returned value can be used as is for the construction of a
JMXServiceURL
to the OfficeBuilding
.
getOfficeBuildingJmxServiceUrl
in interface OfficeBuildingManagerMBean
JMXServiceURL
of the OfficeBuilding
being managed
by this OfficeBuildingManagerMBean
.public String getOfficeBuildingHostName()
OfficeBuildingManagerMBean
OfficeBuilding
.getOfficeBuildingHostName
in interface OfficeBuildingManagerMBean
OfficeBuilding
.public int getOfficeBuildingPort()
OfficeBuildingManagerMBean
OfficeBuilding
is listening on.getOfficeBuildingPort
in interface OfficeBuildingManagerMBean
OfficeBuilding
is listening on.public String openOfficeFloor(String arguments) throws ProcessException
OfficeBuildingManagerMBean
Opens an OfficeFloor
within the OfficeBuilding
.
Allows for open type parameters for JMX invocation.
openOfficeFloor
in interface OfficeBuildingManagerMBean
arguments
- OfficeFloor
arguments separated by white spacing.Process
name space of the opened OfficeFloor
.ProcessException
- If fails to open the OfficeFloor
.ProcessManagerMBean.getProcessNamespace()
public String openOfficeFloor(OpenOfficeFloorConfiguration configuration) throws ProcessException
OfficeBuildingManagerMBean
Opens an OfficeFloor
within the OfficeBuilding
.
The complex argument means this method will typically only be able to be
programmatically invoked - not for JMX console invocation. Use the other
openOfficeFloor
for this type of invocation.
openOfficeFloor
in interface OfficeBuildingManagerMBean
configuration
- OpenOfficeFloorConfiguration
.Process
name space of the opened OfficeFloor
.ProcessException
- If fails to open the OfficeFloor
.ProcessManagerMBean.getProcessNamespace()
public String[] listProcessNamespaces() throws ProcessException
OfficeBuildingManagerMBean
Process
name spaces currently running
within the OfficeBuilding
.listProcessNamespaces
in interface OfficeBuildingManagerMBean
Process
name spaces currently running
within the OfficeBuilding
.ProcessException
- If fails to list process namespaces.public void closeOfficeFloor(String processNamespace, long waitTime) throws ProcessException
OfficeBuildingManagerMBean
OfficeFloor
.closeOfficeFloor
in interface OfficeBuildingManagerMBean
processNamespace
- Process name space for the OfficeFloor
.waitTime
- Time to wait for OfficeFloor
to stop before being
destroyed.ProcessException
- If fails to close the OfficeFloor
.ProcessManagerMBean.getProcessNamespace()
public String stopOfficeBuilding(long waitTime) throws ProcessException
OfficeBuildingManagerMBean
OfficeBuilding
.stopOfficeBuilding
in interface OfficeBuildingManagerMBean
waitTime
- Time to wait for ManagedProcess
instances to stop
before being destroyed.OfficeBuilding
.ProcessException
- If fails to stop the OfficeBuilding
.public boolean isOfficeBuildingStopped()
OfficeBuildingManagerMBean
OfficeBuilding
has been stopped.isOfficeBuildingStopped
in interface OfficeBuildingManagerMBean
true
should the OfficeBuilding
be stopped.Copyright © 2005–2016. All rights reserved.