APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.rmi.transport

pack-priv final Class DGCImpl

extends Object
implements DGC
Class Inheritance
All Implemented Interfaces
java.rmi.dgc.DGC, java.rmi.Remote
Annotations
@SuppressWarnings:deprecation
Imports
java.io.ObjectInputFilter, java.rmi.Remote, .RemoteException, java.rmi.dgc.DGC, .Lease, .VMID, java.rmi.server.LogStream, .ObjID, .RemoteServer, .ServerNotActiveException, .UID, java.security.Security, java.util.ArrayList, .HashSet, .HashMap, .Iterator, .List, .Map, .Set, java.util.concurrent.Future, .ScheduledExecutorService, .TimeUnit, sun.rmi.runtime.Log, .RuntimeUtil, sun.rmi.server.UnicastRef, .UnicastServerRef, .Util

This class implements the guts of the server-side distributed GC algorithm
Author
Ann Wollrath

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private Future<?>
checker

checks for lease expiration

private static DGCImpl
dgc

remote implementation of DGC interface for this VM

private static final String
DGC_FILTER_PROPNAME

Property name of the DGC serial filter to augment the built-in list of allowed types.

private static int
DGC_MAX_ARRAY_SIZE

Registry maximum array size in remote invocations.

private static int
DGC_MAX_DEPTH

Registry max depth of remote invocations.

private static final ObjectInputFilter
dgcFilter

The dgcFilter created from the value of the "sun.rmi.transport.dgcFilter" property.

pack-priv static final Log
private static final long
leaseCheckInterval

lease check interval; default is half of lease grant duration

private Map<VMID, DGCImpl.LeaseInfo>
leaseTable

table that maps VMID to LeaseInfo

private static final long
leaseValue

lease duration to grant to clients

private static final ScheduledExecutorService
scheduler

thread pool for scheduling delayed tasks

Constructor Summary

AccessConstructor and Description
private
DGCImpl()

Construct a new server-side remote object collector at a particular port.

Method Summary

Modifier and TypeMethod and Description
private static ObjectInputFilter.Status
checkInput(ObjectInputFilter.FilterInfo
access to class, arrayLength, etc.
filterInfo
)

ObjectInputFilter to filter DGC input objects.

private void

Returns:

if true, there are leases outstanding; otherwise leases no longer need to be checked
checkLeases
()

Check if leases have expired.

public void
clean(ObjID[] ids, long sequenceNum, VMID vmid, boolean strong)

Implements java.rmi.dgc.DGC.clean.

The clean call removes the VMID from the set of clients that hold references to the object associated with the LiveRef ref.

public Lease
dirty(ObjID[] ids, long sequenceNum, Lease lease)

Implements java.rmi.dgc.DGC.dirty.

The dirty call adds the VMID "vmid" to the set of clients that hold references to the object associated with the ObjID id. The long "sequenceNum" is used to detect late dirty calls.

private static void
pack-priv static DGCImpl
getDGCImpl()

Return the remote implementation of the DGC interface for this VM.

private static ObjectInputFilter

Returns:

an ObjectInputFilter, or null
initDgcFilter
()

Initialize the dgcFilter from the security properties or system property; if any

pack-priv void
registerTarget(VMID vmid, Target target)

Register interest in receiving a callback when this VMID becomes inaccessible.

pack-priv void
unregisterTarget(VMID vmid, Target target)

Remove notification request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

checkerback to summary
private Future<?> checker

checks for lease expiration

dgcback to summary
private static DGCImpl dgc

remote implementation of DGC interface for this VM

DGC_FILTER_PROPNAMEback to summary
private static final String DGC_FILTER_PROPNAME

Property name of the DGC serial filter to augment the built-in list of allowed types. Setting the property in the conf/security/java.security file or system property will enable the augmented filter.

DGC_MAX_ARRAY_SIZEback to summary
private static int DGC_MAX_ARRAY_SIZE

Registry maximum array size in remote invocations.

DGC_MAX_DEPTHback to summary
private static int DGC_MAX_DEPTH

Registry max depth of remote invocations.

dgcFilterback to summary
private static final ObjectInputFilter dgcFilter

The dgcFilter created from the value of the "sun.rmi.transport.dgcFilter" property.

dgcLogback to summary
pack-priv static final Log dgcLog
leaseCheckIntervalback to summary
private static final long leaseCheckInterval

lease check interval; default is half of lease grant duration

leaseTableback to summary
private Map<VMID, DGCImpl.LeaseInfo> leaseTable

table that maps VMID to LeaseInfo

leaseValueback to summary
private static final long leaseValue

lease duration to grant to clients

schedulerback to summary
private static final ScheduledExecutorService scheduler

thread pool for scheduling delayed tasks

Constructor Detail

DGCImplback to summary
private DGCImpl()

Construct a new server-side remote object collector at a particular port. Disallow construction from outside.

Method Detail

checkInputback to summary
private static ObjectInputFilter.Status checkInput(ObjectInputFilter.FilterInfo filterInfo)

ObjectInputFilter to filter DGC input objects. The list of acceptable classes is very short and explicit. The depth and array sizes are limited.

Parameters
filterInfo:ObjectInputFilter.FilterInfo

access to class, arrayLength, etc.

Returns:ObjectInputFilter.Status

ObjectInputFilter.Status#ALLOWED if allowed, ObjectInputFilter.Status#REJECTED if rejected, otherwise ObjectInputFilter.Status#UNDECIDED

checkLeasesback to summary
private void checkLeases()

Check if leases have expired. If a lease has expired, remove it from the table and notify all interested parties that the VMID is essentially "dead".

Returns:void

if true, there are leases outstanding; otherwise leases no longer need to be checked

cleanback to summary
public void clean(ObjID[] ids, long sequenceNum, VMID vmid, boolean strong)

Implements java.rmi.dgc.DGC.clean.

The clean call removes the VMID from the set of clients that hold references to the object associated with the LiveRef ref. The sequence number is used to detect late clean calls. If the argument "strong" is true, then the clean call is a result of a failed "dirty" call, thus the sequence number for the VMID needs to be remembered until the client goes away.

dirtyback to summary
public Lease dirty(ObjID[] ids, long sequenceNum, Lease lease)

Implements java.rmi.dgc.DGC.dirty.

The dirty call adds the VMID "vmid" to the set of clients that hold references to the object associated with the ObjID id. The long "sequenceNum" is used to detect late dirty calls. If the VMID "vmid" is null, a VMID will be generated on the server (for use by the client in subsequent calls) and returned. The client must call the "dirty" method to renew the lease before the "lease" time expires or all references to remote objects in this VM that the client holds are considered "unreferenced".

exportSingletonback to summary
private static void exportSingleton()
getDGCImplback to summary
pack-priv static DGCImpl getDGCImpl()

Return the remote implementation of the DGC interface for this VM.

initDgcFilterback to summary
private static ObjectInputFilter initDgcFilter()

Initialize the dgcFilter from the security properties or system property; if any

Returns:ObjectInputFilter

an ObjectInputFilter, or null

registerTargetback to summary
pack-priv void registerTarget(VMID vmid, Target target)

Register interest in receiving a callback when this VMID becomes inaccessible.

unregisterTargetback to summary
pack-priv void unregisterTarget(VMID vmid, Target target)

Remove notification request.

sun.rmi.transport back to summary

private Class DGCImpl.LeaseInfo

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv long
pack-priv Set<Target>
pack-priv VMID

Constructor Summary

AccessConstructor and Description
pack-priv
LeaseInfo(VMID vmid, long lease)

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
expired(long time)

pack-priv synchronized void
renew(long lease)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

expirationback to summary
pack-priv long expiration
notifySetback to summary
pack-priv Set<Target> notifySet
vmidback to summary
pack-priv VMID vmid

Constructor Detail

LeaseInfoback to summary
pack-priv LeaseInfo(VMID vmid, long lease)

Method Detail

expiredback to summary
pack-priv boolean expired(long time)
renewback to summary
pack-priv synchronized void renew(long lease)