|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.j256.simplejmx.server.JmxServer
public class JmxServer
JMX server which allows classes to publish and un-publish themselves as JMX beans.
Constructor Summary | |
---|---|
JmxServer()
Create a JMX server that will be set with the port using setters. |
|
JmxServer(int registryPort)
Create a JMX server running on a particular port. |
Method Summary | |
---|---|
void |
register(JmxSelfNaming selfNaming)
Register the object parameter for exposure with JMX that implements self-naming. |
void |
register(Object obj)
Register the object parameter for exposure with JMX. |
void |
register(Object obj,
ObjectName objectName,
JmxAttributeFieldInfo[] attributeFieldInfos,
JmxAttributeMethodInfo[] attributeMethodInfos,
JmxOperationInfo[] operationInfos)
Register the object parameter for exposure with JMX with user defined field-attribute, method-attribute, and operation information. |
void |
setPort(int port)
This is actually calls setRegistryPort(int) . |
void |
setRegistryPort(int registryPort)
Set our port number to listen for JMX connections. |
void |
setServerPort(int serverPort)
Chances are you should be using setPort(int) or setRegistryPort(int) unless you know what you
are doing. |
void |
start()
Start our JMX service. |
void |
stop()
Same as stopThrow() but this ignores any exceptions. |
void |
stopThrow()
Stop the JMX server by closing the connector and unpublishing it from the RMI registry. |
void |
unregister(Object obj)
Same as unregisterThrow(Object) except this ignores exceptions. |
void |
unregister(ObjectName objName)
Same as unregisterThrow(ObjectName) except this ignores exceptions. |
void |
unregisterThrow(Object obj)
Un-register the object parameter from JMX but this throws exceptions. |
void |
unregisterThrow(ObjectName objName)
Un-register the object name from JMX but this throws exceptions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JmxServer()
setPort(int)
.
public JmxServer(int registryPort)
Method Detail |
---|
public void start() throws JMException
JmxServer(int)
constructor
or the setRegistryPort(int)
method before this is called.
IllegalStateException
- If the registry port has not already been set.
JMException
public void stop()
stopThrow()
but this ignores any exceptions.
public void stopThrow() throws JMException
JMException
public void register(JmxSelfNaming selfNaming) throws JMException
register(Object)
.
JMException
public void register(Object obj) throws JMException
JmxResource
annotation or must implement JmxSelfNaming
.
JMException
public void register(Object obj, ObjectName objectName, JmxAttributeFieldInfo[] attributeFieldInfos, JmxAttributeMethodInfo[] attributeMethodInfos, JmxOperationInfo[] operationInfos) throws JMException
obj
- Object that we are registering.objectName
- Name of the object most likely generated by one of the methods from the ObjectNameUtil
class.attributeFieldInfos
- Array of attribute information for fields that are exposed through reflection. Can be null if none.attributeMethodInfos
- Array of attribute information for fields that are exposed through get/set/is methods.operationInfos
- Array of operation information for methods.
JMException
public void unregister(Object obj)
unregisterThrow(Object)
except this ignores exceptions.
public void unregister(ObjectName objName)
unregisterThrow(ObjectName)
except this ignores exceptions.
public void unregisterThrow(Object obj) throws JMException
unregister(Object)
if you
want it to be silent.
JMException
public void unregisterThrow(ObjectName objName) throws JMException
unregister(Object)
if you want
it to be silent.
JMException
public void setPort(int port)
setRegistryPort(int)
.
public void setRegistryPort(int registryPort)
JmxServer(int)
constructor before start()
is called.
public void setServerPort(int serverPort)
setPort(int)
or setRegistryPort(int)
unless you know what you
are doing. This sets what JMX calls the "RMI server port". By default this does not have to be set and 1 plus the
registry port will be used. When you specify a port number in jconsole this is not the port that should be
specified -- see the registry port.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |