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

public final Class Target

Additional top-level class in compilation unit: SequenceEntry.

extends Object
Class Inheritance
Imports
java.rmi.Remote, .NoSuchObjectException, java.rmi.dgc.VMID, java.rmi.server.ObjID, .Unreferenced, java.util.*, sun.rmi.runtime.Log, .RuntimeUtil, sun.rmi.server.Dispatcher

A target contains information pertaining to a remote object that resides in this address space. Targets are located via the ObjectTable.

Field Summary

Modifier and TypeField and Description
private int
callCount

number of pending/executing calls

private final ClassLoader
ccl

context class loader in which target was created

private volatile Dispatcher
disp

dispatcher for remote object

private volatile Transport
exportedTransport

the transport through which this target was exported and through which remote calls will be allowed

private final ObjID
id

object id for target

private static int
nextThreadNum

number to identify next callback thread created here

private final boolean
permanent

flag indicating whether target is subject to collection

private final Vector<VMID>
refSet

set of clients that hold references to this target

private boolean
removed

true if this target has been removed from the object table

private final Hashtable<VMID, SequenceEntry>
sequenceTable

table that maps client endpoints to sequence numbers

private final Remote
stub

stub for remote object

private final WeakRef
weakImpl

weak reference to remote object implementation

Constructor Summary

AccessConstructor and Description
public
Target(Remote impl, Dispatcher disp, Remote stub, ObjID id, boolean permanent)

Construct a Target for a remote object "impl" with a specific object id. If "permanent" is true, then the impl is pinned permanently (the impl will not be collected via distributed and/or local GC).

Method Summary

Modifier and TypeMethod and Description
private static boolean
checkLoaderAncestry(ClassLoader child, ClassLoader ancestor)

Return true if the first class loader is a child of (or identical to) the second class loader.

pack-priv synchronized void
decrementCallCount()

Decrement call count.

pack-priv ClassLoader
pack-priv Dispatcher
getDispatcher()

Returns the dispatcher for this remote object target.

pack-priv Remote
getImpl()

Get the impl for this target.

pack-priv ObjectEndpoint
getObjectEndpoint()

Returns the object endpoint for the target.

public Remote
getStub()

Get the stub (proxy) object for this target

pack-priv WeakRef
getWeakImpl()

Get the weak reference for the Impl of this target.

pack-priv synchronized void
incrementCallCount()

Increment call count.

pack-priv boolean
isEmpty()

Returns true if remembered set is empty; otherwise returns false

pack-priv boolean
isPermanent()

Returns true if the target is permanent.

pack-priv synchronized void
markRemoved()

Mark this target as having been removed from the object table.

pack-priv synchronized void
pinImpl()

Pin impl in target.

pack-priv synchronized void
referenced(long sequenceNum, VMID vmid)

Add an endpoint to the remembered set.

private synchronized void
refSetRemove(VMID vmid)

Remove endpoint from the reference set.

pack-priv void
setExportedTransport(Transport exportedTransport)

Enable the transport through which remote calls to this target are allowed to be set if it has not already been set.

pack-priv synchronized boolean
unexport(boolean force)

Mark this target as not accepting new calls if any of the following conditions exist: a) the force parameter is true, b) the target's call count is zero, or c) the object is already not accepting calls.

pack-priv synchronized void
unpinImpl()

Unpin impl in target.

pack-priv synchronized void
unreferenced(long sequenceNum, VMID vmid, boolean strong)

Remove endpoint from remembered set.

public synchronized void
vmidDead(VMID vmid)

This method is called if the address space associated with the vmid dies.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

callCountback to summary
private int callCount

number of pending/executing calls

cclback to summary
private final ClassLoader ccl

context class loader in which target was created

dispback to summary
private volatile Dispatcher disp

dispatcher for remote object

exportedTransportback to summary
private volatile Transport exportedTransport

the transport through which this target was exported and through which remote calls will be allowed

idback to summary
private final ObjID id

object id for target

nextThreadNumback to summary
private static int nextThreadNum

number to identify next callback thread created here

permanentback to summary
private final boolean permanent

flag indicating whether target is subject to collection

refSetback to summary
private final Vector<VMID> refSet

set of clients that hold references to this target

removedback to summary
private boolean removed

true if this target has been removed from the object table

sequenceTableback to summary
private final Hashtable<VMID, SequenceEntry> sequenceTable

table that maps client endpoints to sequence numbers

stubback to summary
private final Remote stub

stub for remote object

weakImplback to summary
private final WeakRef weakImpl

weak reference to remote object implementation

Constructor Detail

Targetback to summary
public Target(Remote impl, Dispatcher disp, Remote stub, ObjID id, boolean permanent)

Construct a Target for a remote object "impl" with a specific object id. If "permanent" is true, then the impl is pinned permanently (the impl will not be collected via distributed and/or local GC). If "on" is false, than the impl is subject to collection. Permanent objects do not keep a server from exiting.

Method Detail

checkLoaderAncestryback to summary
private static boolean checkLoaderAncestry(ClassLoader child, ClassLoader ancestor)

Return true if the first class loader is a child of (or identical to) the second class loader. Either loader may be "null", which is considered to be the parent of any non-null class loader. (utility method added for the 1.2beta4 fix for 4149366)

decrementCallCountback to summary
pack-priv synchronized void decrementCallCount()

Decrement call count.

getContextClassLoaderback to summary
pack-priv ClassLoader getContextClassLoader()
getDispatcherback to summary
pack-priv Dispatcher getDispatcher()

Returns the dispatcher for this remote object target.

getImplback to summary
pack-priv Remote getImpl()

Get the impl for this target.

Note

this may return null if the impl has been garbage collected. (currently, there is no need to make this method public)

getObjectEndpointback to summary
pack-priv ObjectEndpoint getObjectEndpoint()

Returns the object endpoint for the target.

getStubback to summary
public Remote getStub()

Get the stub (proxy) object for this target

getWeakImplback to summary
pack-priv WeakRef getWeakImpl()

Get the weak reference for the Impl of this target.

incrementCallCountback to summary
pack-priv synchronized void incrementCallCount() throws NoSuchObjectException

Increment call count.

isEmptyback to summary
pack-priv boolean isEmpty()

Returns true if remembered set is empty; otherwise returns false

isPermanentback to summary
pack-priv boolean isPermanent()

Returns true if the target is permanent.

markRemovedback to summary
pack-priv synchronized void markRemoved()

Mark this target as having been removed from the object table.

pinImplback to summary
pack-priv synchronized void pinImpl()

Pin impl in target. Pin the WeakRef object so it holds a strong reference to the object to it will not be garbage collected locally. This way there is a single object responsible for the weak ref mechanism.

referencedback to summary
pack-priv synchronized void referenced(long sequenceNum, VMID vmid)

Add an endpoint to the remembered set. Also adds a notifier to call back if the address space associated with the endpoint dies.

refSetRemoveback to summary
private synchronized void refSetRemove(VMID vmid)

Remove endpoint from the reference set.

setExportedTransportback to summary
pack-priv void setExportedTransport(Transport exportedTransport)

Enable the transport through which remote calls to this target are allowed to be set if it has not already been set.

unexportback to summary
pack-priv synchronized boolean unexport(boolean force)

Mark this target as not accepting new calls if any of the following conditions exist: a) the force parameter is true, b) the target's call count is zero, or c) the object is already not accepting calls. Returns true if target is marked as not accepting new calls; returns false otherwise.

unpinImplback to summary
pack-priv synchronized void unpinImpl()

Unpin impl in target. Weaken the reference to impl so that it can be garbage collected locally. But only if there the refSet is empty. All of the weak/strong handling is in WeakRef

unreferencedback to summary
pack-priv synchronized void unreferenced(long sequenceNum, VMID vmid, boolean strong)

Remove endpoint from remembered set. If set becomes empty, remove server from Transport's object table.

vmidDeadback to summary
public synchronized void vmidDead(VMID vmid)

This method is called if the address space associated with the vmid dies. In that case, the vmid should be removed from the reference set.