Package org.eclipse.jetty.jmx
Class ConnectorServer
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.jmx.ConnectorServer
-
- All Implemented Interfaces:
LifeCycle
public class ConnectorServer extends AbstractLifeCycle
LifeCycle wrapper for JMXConnectorServer.
This class provides the following facilities:
- participates in the
Server
lifecycle - starts the RMI registry if not there already
- allows to bind the RMI registry and the RMI server to the loopback interface
- makes it easy to use TLS for the JMX communication
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
ConnectorServer.JMXRMIServerSocketFactory
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
Fields Modifier and Type Field Description private javax.management.remote.JMXConnectorServer
_connectorServer
private java.util.Map<java.lang.String,java.lang.Object>
_environment
private javax.management.remote.JMXServiceURL
_jmxURL
private java.lang.String
_objectName
private java.rmi.registry.Registry
_registry
private int
_registryPort
private int
_rmiPort
private SslContextFactory
_sslContextFactory
private static Logger
LOG
static java.lang.String
RMI_REGISTRY_CLIENT_SOCKET_FACTORY_ATTRIBUTE
-
Constructor Summary
Constructors Constructor Description ConnectorServer(javax.management.remote.JMXServiceURL serviceURL, java.lang.String name)
Constructs a ConnectorServerConnectorServer(javax.management.remote.JMXServiceURL svcUrl, java.util.Map<java.lang.String,?> environment, java.lang.String name)
Constructs a ConnectorServerConnectorServer(javax.management.remote.JMXServiceURL svcUrl, java.util.Map<java.lang.String,?> environment, java.lang.String name, SslContextFactory sslContextFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doStart()
void
doStop()
javax.management.remote.JMXServiceURL
getAddress()
private java.lang.String
normalizeHost(java.lang.String host)
private java.lang.String
startRegistry(HostPort hostPort)
private void
stopRegistry()
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop, toString
-
-
-
-
Field Detail
-
RMI_REGISTRY_CLIENT_SOCKET_FACTORY_ATTRIBUTE
public static final java.lang.String RMI_REGISTRY_CLIENT_SOCKET_FACTORY_ATTRIBUTE
- See Also:
- Constant Field Values
-
LOG
private static final Logger LOG
-
_jmxURL
private javax.management.remote.JMXServiceURL _jmxURL
-
_environment
private final java.util.Map<java.lang.String,java.lang.Object> _environment
-
_objectName
private final java.lang.String _objectName
-
_sslContextFactory
private final SslContextFactory _sslContextFactory
-
_registryPort
private int _registryPort
-
_rmiPort
private int _rmiPort
-
_connectorServer
private javax.management.remote.JMXConnectorServer _connectorServer
-
_registry
private java.rmi.registry.Registry _registry
-
-
Constructor Detail
-
ConnectorServer
public ConnectorServer(javax.management.remote.JMXServiceURL serviceURL, java.lang.String name)
Constructs a ConnectorServer- Parameters:
serviceURL
- the address of the new ConnectorServername
- object name string to be assigned to ConnectorServer bean
-
ConnectorServer
public ConnectorServer(javax.management.remote.JMXServiceURL svcUrl, java.util.Map<java.lang.String,?> environment, java.lang.String name)
Constructs a ConnectorServer- Parameters:
svcUrl
- the address of the new ConnectorServerenvironment
- a set of attributes to control the new ConnectorServer's behavior. This parameter can be null. Keys in this map must be Strings. The appropriate type of each associated value depends on the attribute. The contents of environment are not changed by this call.name
- object name string to be assigned to ConnectorServer bean
-
ConnectorServer
public ConnectorServer(javax.management.remote.JMXServiceURL svcUrl, java.util.Map<java.lang.String,?> environment, java.lang.String name, SslContextFactory sslContextFactory)
-
-
Method Detail
-
getAddress
public javax.management.remote.JMXServiceURL getAddress()
-
doStart
public void doStart() throws java.lang.Exception
- Overrides:
doStart
in classAbstractLifeCycle
- Throws:
java.lang.Exception
-
doStop
public void doStop() throws java.lang.Exception
- Overrides:
doStop
in classAbstractLifeCycle
- Throws:
java.lang.Exception
-
startRegistry
private java.lang.String startRegistry(HostPort hostPort) throws java.lang.Exception
- Throws:
java.lang.Exception
-
normalizeHost
private java.lang.String normalizeHost(java.lang.String host) throws java.net.UnknownHostException
- Throws:
java.net.UnknownHostException
-
stopRegistry
private void stopRegistry()
-
-