public final class AgentSessionProxy extends SessionProxy
Wraps the access to a remote
MBeanServer
thru an
AgentSession
.
Modifier and Type | Class and Description |
---|---|
static class |
AgentSessionProxy.Builder
Builder.
|
SessionProxy.Listener, SessionProxy.SessionConnectVetoException
Session.ConnectionMode
Modifier and Type | Method and Description |
---|---|
void |
closeConnection()
Closes the MBean server connection.
|
protected Session |
createSession()
Creates a session.
|
void |
disconnect()
Disconnects from the session.
|
MBeanServerConnection |
getConnection()
Gets the MBean server connection.
|
<T> T |
getMBeanProxy(Class<T> objectClass)
Gets a proxy to the MBean.
|
<T> T |
getMBeanProxy(ObjectName objectName,
Class<T> objectClass,
boolean notificationBroadcaster)
Gets a proxy to a MBean.
|
String |
getObjectClassName(ObjectName objectName)
Gets an object class name.
|
ObjectName |
getObjectName()
Gets the object name.
|
ObjectName[] |
getObjectNames()
Gets the object names.
|
static AgentSessionProxy.Builder |
newBuilder()
Returns a new builder.
|
connect, getClientName, getConnectionMode, getContext, getContextUUID, getFactory, getServerName, getServerURI, getSession, getThisLogger, hasLoginInfo, isConnected, isPrivate, isRemote, lockConnect, lockConnectInterruptibly, login, logout, sessionException, sessionMode, tearDown, unlockConnect
@Nonnull @CheckReturnValue public static AgentSessionProxy.Builder newBuilder()
public void closeConnection()
public void disconnect()
This method may be called redundantly.
disconnect
in class SessionProxy
@Nonnull @CheckReturnValue public MBeanServerConnection getConnection() throws SessionException
SessionException
- When a connection is not available.@Nonnull @CheckReturnValue public <T> T getMBeanProxy(@Nonnull Class<T> objectClass) throws SessionException
T
- The type of the returned value.objectClass
- The MBean class.SessionException
- When a connection is not available.@Nonnull @CheckReturnValue public <T> T getMBeanProxy(@Nonnull ObjectName objectName, @Nonnull Class<T> objectClass, boolean notificationBroadcaster) throws SessionException
T
- The type of the returned value.objectName
- The object name.objectClass
- The MBean class.notificationBroadcaster
- Requests notification emission support.SessionException
- When a connection is not available.@Nonnull @CheckReturnValue public String getObjectClassName(@Nonnull ObjectName objectName) throws SessionException
objectName
- The object name.SessionException
- On session exception.@Nonnull @CheckReturnValue public ObjectName getObjectName()
@Nonnull @CheckReturnValue public ObjectName[] getObjectNames() throws SessionException
SessionException
- When a connection is not available.protected Session createSession() throws RemoteException, SessionException
createSession
in class SessionProxy
RemoteException
- From RMI.SessionException
- When session creation fails.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.