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

public Class TCPChannel

Additional top-level class in compilation unit: ConnectionAcceptor.

extends Object
implements Channel
Class Inheritance
All Implemented Interfaces
sun.rmi.transport.Channel
Imports
java.io.DataInputStream, .DataOutputStream, .IOException, java.net.Socket, java.rmi.ConnectIOException, .RemoteException, java.util.ArrayList, .List, .ListIterator, java.util.concurrent.Future, .ScheduledExecutorService, .TimeUnit, sun.rmi.runtime.Log, .RuntimeUtil, sun.rmi.transport.Channel, .Connection, .Endpoint, .TransportConstants

TCPChannel is the socket-based implementation of the RMI Channel abstraction.
Author
Ann Wollrath

Field Summary

Modifier and TypeField and Description
private ConnectionAcceptor
acceptor

connection acceptor (should be in TCPTransport)

private final TCPEndpoint
ep

endpoint for this channel

private final List<TCPConnection>
freeList

list of cached connections

private static final int
handshakeTimeout

client-side connection handshake read timeout

private static final long
idleTimeout

client-side connection idle usage timeout

private Future<?>
reaper

frees cached connections that have expired (guarded by freeList)

private static final int
responseTimeout

client-side connection response read timeout (after handshake)

private static final ScheduledExecutorService
scheduler

thread pool for scheduling delayed tasks

private final TCPTransport
tr

transport for this channel

Constructor Summary

AccessConstructor and Description
pack-priv
TCPChannel(TCPTransport tr, TCPEndpoint ep)

Create channel for endpoint.

Method Summary

Modifier and TypeMethod and Description
private Connection
createConnection()

Create a new connection to the remote endpoint of this channel.

public void
free(Connection
The connection
conn
,
boolean
If true, the connection is in a state in which it can be reused for another method call.
reuse
)

Implements sun.rmi.transport.Channel.free.

Free the connection generated by this channel.

private void
public Endpoint
getEndpoint()

Implements sun.rmi.transport.Channel.getEndpoint.

Return the endpoint for this channel.

public Connection
newConnection()

Implements sun.rmi.transport.Channel.newConnection.

Supplies a connection to the endpoint of the address space for which this is a channel.

public void
shedCache()

Closes all the connections in the cache, whether timed out or not.

private void
writeTransportHeader(DataOutputStream out)

Send transport header over stream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

acceptorback to summary
private ConnectionAcceptor acceptor

connection acceptor (should be in TCPTransport)

epback to summary
private final TCPEndpoint ep

endpoint for this channel

freeListback to summary
private final List<TCPConnection> freeList

list of cached connections

handshakeTimeoutback to summary
private static final int handshakeTimeout

client-side connection handshake read timeout

idleTimeoutback to summary
private static final long idleTimeout

client-side connection idle usage timeout

reaperback to summary
private Future<?> reaper

frees cached connections that have expired (guarded by freeList)

responseTimeoutback to summary
private static final int responseTimeout

client-side connection response read timeout (after handshake)

schedulerback to summary
private static final ScheduledExecutorService scheduler

thread pool for scheduling delayed tasks

trback to summary
private final TCPTransport tr

transport for this channel

Constructor Detail

TCPChannelback to summary
pack-priv TCPChannel(TCPTransport tr, TCPEndpoint ep)

Create channel for endpoint.

Method Detail

createConnectionback to summary
private Connection createConnection() throws RemoteException

Create a new connection to the remote endpoint of this channel. The returned connection is new. The caller must already have passed a security checkConnect or equivalent.

freeback to summary
public void free(Connection conn, boolean reuse)

Implements sun.rmi.transport.Channel.free.

Free the connection generated by this channel.

Parameters
conn:Connection

The connection

reuse:boolean

If true, the connection is in a state in which it can be reused for another method call.

freeCachedConnectionsback to summary
private void freeCachedConnections()
getEndpointback to summary
public Endpoint getEndpoint()

Implements sun.rmi.transport.Channel.getEndpoint.

Return the endpoint for this channel.

newConnectionback to summary
public Connection newConnection() throws RemoteException

Implements sun.rmi.transport.Channel.newConnection.

Supplies a connection to the endpoint of the address space for which this is a channel. The returned connection may be one retrieved from a cache of idle connections.

shedCacheback to summary
public void shedCache()

Closes all the connections in the cache, whether timed out or not.

writeTransportHeaderback to summary
private void writeTransportHeader(DataOutputStream out) throws RemoteException

Send transport header over stream.