Top Description Inners Fields Constructors Methods
org.eclipse.jetty.jmx

public Class ConnectorServer

extends AbstractLifeCycle
Class Inheritance
Imports
java.io.IOException, java.lang.management.ManagementFactory, java.net.InetAddress, .InetSocketAddress, .ServerSocket, .UnknownHostException, java.rmi.registry.LocateRegistry, .Registry, java.rmi.server.RMIClientSocketFactory, .RMIServerSocketFactory, .UnicastRemoteObject, java.util.HashMap, .Map, .Objects, java.util.function.IntConsumer, javax.management.MBeanServer, .ObjectName, javax.management.remote.JMXConnectorServer, .JMXConnectorServerFactory, .JMXServiceURL, javax.management.remote.rmi.RMIConnectorServer, javax.rmi.ssl.SslRMIClientSocketFactory, org.eclipse.jetty.util.HostPort, .IO, .StringUtil, org.eclipse.jetty.util.component.AbstractLifeCycle, org.eclipse.jetty.util.ssl.SslContextFactory, org.eclipse.jetty.util.thread.ShutdownThread, org.slf4j.Logger, .LoggerFactory

LifeCycle wrapper for JMXConnectorServer.

This class provides the following facilities:

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private JMXConnectorServer
private final Map<String, Object>
private JMXServiceURL
private String
private Registry
private int
private int
private SslContextFactory.Server
private static final int
private static final Logger
public static final String
Inherited from org.eclipse.jetty.util.component.AbstractLifeCycle:
FAILEDSTARTEDSTARTINGSTOPPEDSTOPPING

Constructor Summary

AccessConstructor and Description
public
ConnectorServer(JMXServiceURL
the address of the new ConnectorServer
serviceURL
,
String
object name string to be assigned to ConnectorServer bean
objectName
)

Constructs a ConnectorServer

public
ConnectorServer(JMXServiceURL
the address of the new ConnectorServer
serviceURL
,
Map<String, ?>
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.
environment
,
String
object name string to be assigned to ConnectorServer bean
objectName
)

Constructs a ConnectorServer

public
ConnectorServer(JMXServiceURL
the address of the new ConnectorServer
serviceURL
,
Map<String, ?>
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.
environment
,
String
object name string to be assigned to ConnectorServer bean
objectName
,
SslContextFactory.Server
the SslContextFactory.Server to use for secure communication
sslContextFactory
)

Constructs a ConnectorServer

Method Summary

Modifier and TypeMethod and Description
public void
doStart()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Method to override to start the lifecycle
public void
doStop()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Method to override to stop the lifecycle
public JMXServiceURL

Returns:

the JMXServiceURL of this ConnectorServer
getAddress
()

Get the JMXServiceURL of this ConnectorServer.

public String

Returns:

the ObjectName of this ConnectorServer
getObjectName
()

Get the ObjectName of this ConnectorServer.

public SslContextFactory.Server
private String
public void
putAttribute(String
the attribute name
name
,
Object
the attribute value
value
)

Puts an attribute into the environment Map.

public void
setObjectName(String
the ObjectName of this ConnectorServer
objectName
)

Set the ObjectName of this ConnectorServer.

public void
private String
private void
Inherited from org.eclipse.jetty.util.component.AbstractLifeCycle:
addEventListenergetEventListenersgetStategetStateisFailedisRunningisStartedisStartingisStoppedisStoppingremoveEventListenersetEventListenersstartstoptoString

Field Detail

_connectorServerback to summary
private JMXConnectorServer _connectorServer
_environmentback to summary
private final Map<String, Object> _environment
_jmxURLback to summary
private JMXServiceURL _jmxURL
_objectNameback to summary
private String _objectName
_registryback to summary
private Registry _registry
_registryPortback to summary
private int _registryPort
_rmiPortback to summary
private int _rmiPort
_sslContextFactoryback to summary
private SslContextFactory.Server _sslContextFactory
DEFAULT_REGISTRY_PORTback to summary
private static final int DEFAULT_REGISTRY_PORT
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.util.component.AbstractLifeCycle.LOG.

RMI_REGISTRY_CLIENT_SOCKET_FACTORY_ATTRIBUTEback to summary
public static final String RMI_REGISTRY_CLIENT_SOCKET_FACTORY_ATTRIBUTE

Constructor Detail

ConnectorServerback to summary
public ConnectorServer(JMXServiceURL serviceURL, String objectName)

Constructs a ConnectorServer

Parameters
serviceURL:JMXServiceURL

the address of the new ConnectorServer

objectName:String

object name string to be assigned to ConnectorServer bean

ConnectorServerback to summary
public ConnectorServer(JMXServiceURL serviceURL, Map<String, ?> environment, String objectName)

Constructs a ConnectorServer

Parameters
serviceURL:JMXServiceURL

the address of the new ConnectorServer

environment:Map<String, ?>

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.

objectName:String

object name string to be assigned to ConnectorServer bean

ConnectorServerback to summary
public ConnectorServer(JMXServiceURL serviceURL, Map<String, ?> environment, String objectName, SslContextFactory.Server sslContextFactory)

Constructs a ConnectorServer

Parameters
serviceURL:JMXServiceURL

the address of the new ConnectorServer

environment:Map<String, ?>

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.

objectName:String

object name string to be assigned to ConnectorServer bean

sslContextFactory:SslContextFactory.Server

the SslContextFactory.Server to use for secure communication

Method Detail

doStartback to summary
public void doStart() throws Exception

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Method to override to start the lifecycle

Annotations
@Override
Exceptions
Exception:
If there was a problem starting. Will cause a transition to FAILED state
doStopback to summary
public void doStop() throws Exception

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Method to override to stop the lifecycle

Annotations
@Override
Exceptions
Exception:
If there was a problem stopping. Will cause a transition to FAILED state
getAddressback to summary
public JMXServiceURL getAddress()

Get the JMXServiceURL of this ConnectorServer.

Returns:JMXServiceURL

the JMXServiceURL of this ConnectorServer

getObjectNameback to summary
public String getObjectName()

Get the ObjectName of this ConnectorServer.

Returns:String

the ObjectName of this ConnectorServer

getSslContextFactoryback to summary
public SslContextFactory.Server getSslContextFactory()
normalizeHostback to summary
private String normalizeHost(String host) throws UnknownHostException
putAttributeback to summary
public void putAttribute(String name, Object value)

Puts an attribute into the environment Map.

Parameters
name:String

the attribute name

value:Object

the attribute value

setObjectNameback to summary
public void setObjectName(String objectName)

Set the ObjectName of this ConnectorServer.

Parameters
objectName:String

the ObjectName of this ConnectorServer

setSslContextFactoryback to summary
public void setSslContextFactory(SslContextFactory.Server sslContextFactory)
startRegistryback to summary
private String startRegistry(HostPort hostPort) throws Exception
stopRegistryback to summary
private void stopRegistry()
org.eclipse.jetty.jmx back to summary

private Class ConnectorServer.JMXRMIServerSocketFactory

extends Object
implements RMIServerSocketFactory
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.jmx.ConnectorServer.JMXRMIServerSocketFactory
All Implemented Interfaces
java.rmi.server.RMIServerSocketFactory

Field Summary

Modifier and TypeField and Description
private final String
private final IntConsumer

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public ServerSocket
createServerSocket(int
the port number
port
)

Implements java.rmi.server.RMIServerSocketFactory.createServerSocket.

Create a server socket on the specified port (port 0 indicates an anonymous port).
private ServerSocket
createServerSocket(InetAddress address, int port)

public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

_hostback to summary
private final String _host
_portConsumerback to summary
private final IntConsumer _portConsumer

Constructor Detail

JMXRMIServerSocketFactoryback to summary
private JMXRMIServerSocketFactory(String host, IntConsumer portConsumer)

Method Detail

createServerSocketback to summary
public ServerSocket createServerSocket(int port) throws IOException

Implements java.rmi.server.RMIServerSocketFactory.createServerSocket.

Doc from java.rmi.server.RMIServerSocketFactory.createServerSocket.

Create a server socket on the specified port (port 0 indicates an anonymous port).

Parameters
port:int

the port number

Returns:ServerSocket

the server socket on the specified port

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs during server socket creation
createServerSocketback to summary
private ServerSocket createServerSocket(InetAddress address, int port) throws IOException
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override