Top Description Fields Constructors Methods
sun.rmi.transport

public Class DGCAckHandler

extends Object
Class Inheritance
Imports
java.rmi.server.UID, java.security.AccessController, .PrivilegedAction, java.util.ArrayList, .Collections, .HashMap, .List, .Map, java.util.concurrent.Future, .ScheduledExecutorService, .TimeUnit, sun.rmi.runtime.RuntimeUtil

Holds strong references to a set of remote objects, or live remote references to remote objects, after they have been marshalled (as remote references) as parts of the arguments or the result of a remote invocation. The purpose is to prevent remote objects or live remote references that might otherwise be determined to be unreachable in this VM from being locally garbage collected before the receiver has had an opportunity to register the unmarshalled remote references for DGC. The references are held strongly until an acknowledgment has been received that the receiver has had an opportunity to process the remote references or until a timeout has expired. For remote references sent as parts of the arguments of a remote invocation, the acknowledgment is the beginning of the response indicating completion of the remote invocation. For remote references sent as parts of the result of a remote invocation, a UID is included as part of the result, and the acknowledgment is a transport-level "DGCAck" message containing that UID.
Authors
Ann Wollrath, Peter Jones

Field Summary

Modifier and TypeField and Description
private static final long
dgcAckTimeout

timeout for holding references without receiving an acknowledgment

private final UID
private static final Map<UID, DGCAckHandler>
idTable

table mapping ack ID to handler

private List<Object>
private static final ScheduledExecutorService
scheduler

thread pool for scheduling delayed tasks

private Future<?>

Constructor Summary

AccessConstructor and Description
pack-priv
DGCAckHandler(UID id)

Creates a new DGCAckHandler, associated with the specified UID if the argument is not null.

Method Summary

Modifier and TypeMethod and Description
pack-priv synchronized void
add(Object obj)

Adds the specified reference to this DGCAckHandler.

public static void
received(UID id)

Causes the DGCAckHandler associated with the specified UID to release its references.

pack-priv synchronized void
release()

Releases the references held by this DGCAckHandler.

pack-priv synchronized void
startTimer()

Starts the timer for this DGCAckHandler.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dgcAckTimeoutback to summary
private static final long dgcAckTimeout

timeout for holding references without receiving an acknowledgment

Annotations
@SuppressWarnings:removal
idback to summary
private final UID id
idTableback to summary
private static final Map<UID, DGCAckHandler> idTable

table mapping ack ID to handler

objListback to summary
private List<Object> objList
schedulerback to summary
private static final ScheduledExecutorService scheduler

thread pool for scheduling delayed tasks

Annotations
@SuppressWarnings:removal
taskback to summary
private Future<?> task

Constructor Detail

DGCAckHandlerback to summary
pack-priv DGCAckHandler(UID id)

Creates a new DGCAckHandler, associated with the specified UID if the argument is not null. References added to this DGCAckHandler will be held strongly until its "release" method is invoked or (after the "startTimer" method has been invoked) the timeout has expired. If the argument is not null, then invoking the static "received" method with the specified UID is equivalent to invoking this instance's "release" method.

Method Detail

addback to summary
pack-priv synchronized void add(Object obj)

Adds the specified reference to this DGCAckHandler.

receivedback to summary
public static void received(UID id)

Causes the DGCAckHandler associated with the specified UID to release its references.

releaseback to summary
pack-priv synchronized void release()

Releases the references held by this DGCAckHandler.

startTimerback to summary
pack-priv synchronized void startTimer()

Starts the timer for this DGCAckHandler. After the timeout has expired, the references are released even if the acknowledgment has not been received.