APIdia Launch Partner
Top Inners Fields Constructors Methods
com.sun.jmx.remote.internal

public abstract Class ClientNotifForwarder

extends Object
Class Inheritance
Imports
java.io.IOException, .NotSerializableException, java.util.ArrayList, .HashMap, .List, .Map, java.util.concurrent.Executor, .RejectedExecutionException, javax.security.auth.Subject, javax.management.Notification, .NotificationListener, .NotificationFilter, .ObjectName, .MBeanServerNotification, .InstanceNotFoundException, .ListenerNotFoundException, javax.management.remote.NotificationResult, .TargetedNotification, com.sun.jmx.remote.util.ClassLogger, .EnvHelp

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private class

Field Summary

Modifier and TypeField and Description
private boolean
beingReconnected

This variable is used to tell whether a connector (RMIConnector or ClientIntermediary) is doing reconnection.

private long
private Thread
private final ClassLoader
private Executor
private final Map<Integer, ClientListenerInfo>
private static final ClassLogger
private final int
private Integer
private static final int
STARTED

This state tells that a thread has been started for fetching and forwarding notifications.

private static final int
STARTING

This state means that a thread is being created for fetching and forwarding notifications.

private int
private static final int
STOPPED

This state means that the fetching thread is already stopped.

private static final int
STOPPING

This state means that the fetching thread is informed to stop.

private static final int
TERMINATED

This state means that this object is terminated and no more thread will be created for fetching notifications.

private static int
private final long

Constructor Summary

AccessConstructor and Description
public
public
ClientNotifForwarder(ClassLoader defaultClassLoader, Map<String, ?> env)

Method Summary

Modifier and TypeMethod and Description
protected abstract Integer
public synchronized void
private synchronized void
beforeRemove()

Import: should not remove a listener during reconnection, the reconnection needs to change the listener list and that will possibly make removal fail.

protected abstract NotificationResult
fetchNotifs(long clientSequenceNumber, int maxNotifications, long timeout)

Called to fetch notifications from a server.

public synchronized Integer
public synchronized Integer[]
private synchronized void
init(boolean reconnected)

protected abstract void
lostNotifs(String message, long number)

Used to send out a notification about lost notifs

public synchronized void
postReconnection(ClientListenerInfo[] listenerInfos)

Called after reconnection is finished.

public synchronized ClientListenerInfo[]
protected abstract void
public synchronized Integer[]
public synchronized Integer
public synchronized Integer[]
private synchronized void
setState(int newState)

public synchronized void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beingReconnectedback to summary
private boolean beingReconnected

This variable is used to tell whether a connector (RMIConnector or ClientIntermediary) is doing reconnection. This variable will be set to true by the method preReconnection, and set to false by postReconnection. When beingReconnected == true, no thread will be created for fetching notifications.

clientSequenceNumberback to summary
private long clientSequenceNumber
currentFetchThreadback to summary
private Thread currentFetchThread
defaultClassLoaderback to summary
private final ClassLoader defaultClassLoader
executorback to summary
private Executor executor
infoListback to summary
private final Map<Integer, ClientListenerInfo> infoList
loggerback to summary
private static final ClassLogger logger
maxNotificationsback to summary
private final int maxNotifications
mbeanRemovedNotifIDback to summary
private Integer mbeanRemovedNotifID
STARTEDback to summary
private static final int STARTED

This state tells that a thread has been started for fetching and forwarding notifications.

STARTINGback to summary
private static final int STARTING

This state means that a thread is being created for fetching and forwarding notifications.

stateback to summary
private int state
STOPPEDback to summary
private static final int STOPPED

This state means that the fetching thread is already stopped.

STOPPINGback to summary
private static final int STOPPING

This state means that the fetching thread is informed to stop.

TERMINATEDback to summary
private static final int TERMINATED

This state means that this object is terminated and no more thread will be created for fetching notifications.

threadIdback to summary
private static int threadId
timeoutback to summary
private final long timeout

Constructor Detail

ClientNotifForwarderback to summary
public ClientNotifForwarder(Map<String, ?> env)
ClientNotifForwarderback to summary
public ClientNotifForwarder(ClassLoader defaultClassLoader, Map<String, ?> env)
Annotations
@SuppressWarnings:removal

Method Detail

addListenerForMBeanRemovedNotifback to summary
protected abstract Integer addListenerForMBeanRemovedNotif() throws IOException, InstanceNotFoundException
addNotificationListenerback to summary
public synchronized void addNotificationListener(Integer listenerID, ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws IOException, InstanceNotFoundException
beforeRemoveback to summary
private synchronized void beforeRemove() throws IOException

Import: should not remove a listener during reconnection, the reconnection needs to change the listener list and that will possibly make removal fail.

fetchNotifsback to summary
protected abstract NotificationResult fetchNotifs(long clientSequenceNumber, int maxNotifications, long timeout) throws IOException, ClassNotFoundException

Called to fetch notifications from a server.

getListenerIdback to summary
public synchronized Integer getListenerId(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException, IOException
getListenerIdsback to summary
public synchronized Integer[] getListenerIds(ObjectName name, NotificationListener listener) throws ListenerNotFoundException, IOException
initback to summary
private synchronized void init(boolean reconnected) throws IOException
lostNotifsback to summary
protected abstract void lostNotifs(String message, long number)

Used to send out a notification about lost notifs

postReconnectionback to summary
public synchronized void postReconnection(ClientListenerInfo[] listenerInfos) throws IOException

Called after reconnection is finished. This method is intended to be called only by a client connector: RMIConnector and ClientIntermediary.

preReconnectionback to summary
public synchronized ClientListenerInfo[] preReconnection() throws IOException
removeListenerForMBeanRemovedNotifback to summary
protected abstract void removeListenerForMBeanRemovedNotif(Integer id) throws IOException, InstanceNotFoundException, ListenerNotFoundException
removeNotificationListenerback to summary
public synchronized Integer[] removeNotificationListener(ObjectName name, NotificationListener listener) throws ListenerNotFoundException, IOException
removeNotificationListenerback to summary
public synchronized Integer removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException, IOException
removeNotificationListenerback to summary
public synchronized Integer[] removeNotificationListener(ObjectName name)
setStateback to summary
private synchronized void setState(int newState)
terminateback to summary
public synchronized void terminate()
com.sun.jmx.remote.internal back to summary

private Class ClientNotifForwarder.LinearExecutor

extends Object
implements Executor
Class Inheritance
  • java.lang.Object
  • com.sun.jmx.remote.internal.ClientNotifForwarder.LinearExecutor
All Implemented Interfaces
java.util.concurrent.Executor

Field Summary

Modifier and TypeField and Description
private Runnable
private Thread

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public synchronized void
execute(Runnable command)

Implements java.util.concurrent.Executor.execute.

Executes the given command at some time in the future.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

commandback to summary
private Runnable command
threadback to summary
private Thread thread

Constructor Detail

LinearExecutorback to summary
private LinearExecutor()

Method Detail

executeback to summary
public synchronized void execute(Runnable command)

Implements java.util.concurrent.Executor.execute.

Doc from java.util.concurrent.Executor.execute.

Executes the given command at some time in the future. The command may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of the Executor implementation.

com.sun.jmx.remote.internal back to summary

private Class ClientNotifForwarder.NotifFetcher

extends Object
implements Runnable
Class Inheritance
  • java.lang.Object
  • com.sun.jmx.remote.internal.ClientNotifForwarder.NotifFetcher
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
private volatile boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv void
private void
private NotificationResult
private NotificationResult
private boolean
private void
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

private final ClassLoader
private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

alreadyLoggedback to summary
private volatile boolean alreadyLogged

Constructor Detail

NotifFetcherback to summary
private NotifFetcher()

Method Detail

dispatchNotificationback to summary
pack-priv void dispatchNotification(TargetedNotification tn, Integer myListenerID, Map<Integer, ClientListenerInfo> listeners)
doRunback to summary
private void doRun()
fetchNotifsback to summary
private NotificationResult fetchNotifs()
fetchOneNotifback to summary
private NotificationResult fetchOneNotif()
isRejectedExecutionExceptionback to summary
private boolean isRejectedExecutionException(Exception e)
logOnceback to summary
private void logOnce(String msg, SecurityException x)
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

setContextClassLoaderback to summary
private final ClassLoader setContextClassLoader(final ClassLoader loader)
shouldStopback to summary
private boolean shouldStop()