|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.jmx.JavaManagementServerBean
public class JavaManagementServerBean
A bean to make starting and stopping a JMX server easier.
The only required property is setPortOne(int), if portTwo is not set is will be calculated
as portOne + 1. faileOnException is set to false buy default.
The bean heeds the following system properties:
| Property | Function |
|---|---|
| com.sun.management.jmxremote | Having this property set (value doesn't matter) enables starting of the JMX Server |
| com.sun.management.jmxremote.ssl | Enables SSL based connections |
| com.sun.management.jmxremote.password.file | The password file that contains usernames and passwords for connecting to the server |
| com.sun.management.jmxremote.access.file | The password file that contains ACLs for users connecting to the server |
IMPORTNANT NOTE Using this bean starts an RMI server. If this bean is used in a JVM that is long running and has any sort of generational garbage collector configured the system properties sun.rmi.dgc.client.gcInterval and sun.rmi.dgc.server.gcInterval need to be set to some high value. They configure how often the RMI server requests a full GC. To disable the RMI induced GCs set the properties to '0x7ffffffffffffffe' Only do this if you can rely on the generational GC to reguarly clean up RMI objects.
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
logger
|
| Constructor Summary | |
|---|---|
JavaManagementServerBean()
|
|
| Method Summary | |
|---|---|
protected int |
calculatePortTwo(int portOne)
Get the second rmi port from the init parameters or calculate it |
String |
getHost()
|
protected Map<String,Object> |
getJmxServerEnvironment()
Generates the environment Map for the JMX server based on system properties |
int |
getPortOne()
|
int |
getPortTwo()
|
protected JMXServiceURL |
getServiceUrl(int portOne,
int portTwo)
Generates the JMXServiceURL for the two specified ports. |
boolean |
isFailOnException()
|
void |
setFailOnException(boolean failOnException)
If an exception should be thrown if setting up the JMX server fails |
void |
setHost(String host)
The host to listen on |
void |
setPortOne(int portOne)
First port in the JMX connection string |
void |
setPortTwo(int portTwo)
Second port in the JMX connection string |
void |
startServer()
Starts the RMI server and JMX connector server |
void |
stopServer()
Stops the JMX connector server and RMI server |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log logger
| Constructor Detail |
|---|
public JavaManagementServerBean()
| Method Detail |
|---|
public boolean isFailOnException()
public void setFailOnException(boolean failOnException)
public int getPortTwo()
public void setPortTwo(int portTwo)
public int getPortOne()
public void setPortOne(int portOne)
public String getHost()
public void setHost(String host)
public void startServer()
public void stopServer()
protected int calculatePortTwo(int portOne)
portOne - Base port to calculate the second port from if needed.
protected JMXServiceURL getServiceUrl(int portOne,
int portTwo)
IllegalStateException - If localhost cannot be resolved or if the JMXServiceURL is malformed.protected Map<String,Object> getJmxServerEnvironment()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||