org.jmx4odp.j4oNet
Class BaseServer
java.lang.Object
org.jmx4odp.j4oNet.BaseServer
public class BaseServer
- extends java.lang.Object
Example server that starts a JMX agent with an HTML adaptor and RMI connector.
Usage: java org.jmx4odp.j4oNet.BaseServer
- Author:
- Lucas McGregor
|
Constructor Summary |
BaseServer()
Creates a new instance of SimpleServer |
BaseServer(javax.management.MBeanServer mbs)
Creates a new instance of SimpleServer
That uses the already existing mbs as the base MBeanServer. |
|
Method Summary |
int |
getHtmlPort()
|
java.lang.String |
getJMXServiceURL()
Format the url as "service:jmx:rmi://localhost:0/jndi/rmi://localhost:" + getRmiPort() + "/" + getRmiPort(); |
int |
getRmiPort()
|
boolean |
getVerbose()
|
static void |
main(java.lang.String[] args)
|
void |
setHtmlPort(int i)
|
void |
setRmiPort(int i)
|
void |
setVerbose(boolean b)
If true, the the system will push messages to
STDOUT as it starts up services |
void |
start()
Makes sure that if a MBeanServer was not passed into
the constructor, then one is fetched from the MBeanServerManager. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BaseServer
public BaseServer()
- Creates a new instance of SimpleServer
BaseServer
public BaseServer(javax.management.MBeanServer mbs)
- Creates a new instance of SimpleServer
That uses the already existing mbs as the base MBeanServer.
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception
setVerbose
public void setVerbose(boolean b)
- If true, the the system will push messages to
STDOUT as it starts up services
getVerbose
public boolean getVerbose()
getRmiPort
public int getRmiPort()
setRmiPort
public void setRmiPort(int i)
getHtmlPort
public int getHtmlPort()
setHtmlPort
public void setHtmlPort(int i)
getJMXServiceURL
public java.lang.String getJMXServiceURL()
- Format the url as "service:jmx:rmi://localhost:0/jndi/rmi://localhost:" + getRmiPort() + "/" + getRmiPort();
- Returns:
- the JMX service URL for this base agent's rmi connector.
start
public void start()
throws java.lang.Exception
- Makes sure that if a MBeanServer was not passed into
the constructor, then one is fetched from the MBeanServerManager.
To this MBeanServer, attache an HTML Adaptor and a RMI
Connector and start them both up. This services will
be configured from the attributes of this server.
- Throws:
java.lang.Exception