abstract class AbstractDgcClient extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
AbstractDgcClient.CleanRequest
CleanRequest holds the data for the arguments of a clean call
that needs to be made.
|
protected static interface |
AbstractDgcClient.DgcProxy
A DgcProxy is a proxy for invoking DGC operations on a server-side
DGC implementation at a particular endpoint.
|
private class |
AbstractDgcClient.EndpointEntry
EndpointEntry encapsulates the client-side DGC information specific
to a particular endpoint.
|
Modifier and Type | Field and Description |
---|---|
private static int |
cleanConnectRetries
retry count for clean calls that fail with ConnectException
|
private static long |
cleanInterval
maximum interval between retries of failed clean calls
|
private static int |
dirtyFailureRetries
minimum retry count for dirty calls that fail
|
private static Object[] |
emptyObjectArray
constant empty Object array for lease renewal optimization
|
private Map |
endpointTable
endpoint table: maps generic endpoint to EndpointEntry
(lock guards endpointTable)
|
private static long |
leaseValue
lease duration to request (usually ignored by server)
|
private static long |
minimumDuration
minimum lease duration that we bother to honor
|
private static long |
nextSequenceNum
next sequence number for DGC calls (access synchronized on class)
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractDgcClient() |
Modifier and Type | Method and Description |
---|---|
private static long |
computeRenewTime(long grantTime,
long duration)
Given the length of a lease and the time that it was granted,
computes the absolute time at which it should be renewed, giving
room for reasonable computational and communication delays.
|
protected abstract void |
freeEndpoint(Object endpoint)
Indicates that resources for the given endpoint may be freed.
|
protected abstract AbstractDgcClient.DgcProxy |
getDgcProxy(Object endpoint)
Returns a proxy for making DGC calls to the given endpoint.
|
private AbstractDgcClient.EndpointEntry |
getEndpointEntry(Object endpoint)
Looks up the EndpointEntry for the given endpoint.
|
private static long |
getNextSequenceNum()
Gets the next sequence number to be used for a dirty or clean
operation from this AbstractDgcClient.
|
protected abstract Object |
getRefEndpoint(Object ref)
Returns the endpoint in the given live reference.
|
protected abstract Object |
getRefObjectID(Object ref)
Returns the object ID in the given live reference.
|
protected void |
registerRefs(Object endpoint,
Collection refs)
Registers the live reference instances in the supplied collection to
participate in distributed garbage collection.
|
private static final long leaseValue
private static final long cleanInterval
private static final long minimumDuration
private static final int dirtyFailureRetries
private static final int cleanConnectRetries
private static final Object[] emptyObjectArray
private static long nextSequenceNum
private final Map endpointTable
protected abstract AbstractDgcClient.DgcProxy getDgcProxy(Object endpoint)
protected abstract void freeEndpoint(Object endpoint)
protected abstract Object getRefEndpoint(Object ref)
protected abstract Object getRefObjectID(Object ref)
protected final void registerRefs(Object endpoint, Collection refs)
private static long getNextSequenceNum()
private static long computeRenewTime(long grantTime, long duration)
private AbstractDgcClient.EndpointEntry getEndpointEntry(Object endpoint)
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.