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

public Class TCPConnection

extends Object
implements Connection
Class Inheritance
All Implemented Interfaces
sun.rmi.transport.Connection
Imports
java.io.*, java.net.Socket, java.rmi.*, sun.rmi.runtime.Log, sun.rmi.transport.*

Field Summary

Modifier and TypeField and Description
private Channel
private long
private InputStream
private long
private OutputStream
private long
private Socket

Constructor Summary

AccessConstructor and Description
pack-priv
TCPConnection(TCPChannel ch, Socket s, InputStream in, OutputStream out)

Constructor used for creating a connection to accept call (an input connection)

pack-priv
TCPConnection(TCPChannel ch, InputStream in, OutputStream out)

Constructor used by subclass when underlying input and output streams are already available.

pack-priv
TCPConnection(TCPChannel ch, Socket s)

Constructor used when socket is available, but not underlying streams.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements sun.rmi.transport.Connection.close.

Close the connection.

pack-priv boolean
expired(long
The current time.
time
)

Returns true if the timeout has expired on this connection; otherwise returns false.

public Channel
getChannel()

Implements sun.rmi.transport.Connection.getChannel.

Returns the channel for this connection.

public InputStream
getInputStream()

Implements sun.rmi.transport.Connection.getInputStream.

Gets the input stream for this connection.

public OutputStream
getOutputStream()

Implements sun.rmi.transport.Connection.getOutputStream.

Gets the output stream for this connection

public boolean

Returns:

true if the connection and server are recently alive
isDead
()

Probes the connection to see if it still alive and connected to a responsive server.

public boolean
isReusable()

Implements sun.rmi.transport.Connection.isReusable.

Determine if this connection can be used for multiple operations.

public void
releaseInputStream()

Implements sun.rmi.transport.Connection.releaseInputStream.

Release the input stream for this connection.

public void
releaseOutputStream()

Implements sun.rmi.transport.Connection.releaseOutputStream.

Release the output stream for this connection.

pack-priv void
setExpiration(long
The time at which the time out expires.
time
)

Set the expiration time of this connection.

pack-priv void
setLastUseTime(long
The time at which the connection was last active.
time
)

Set the timestamp at which this connection was last used successfully.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

channelback to summary
private Channel channel
expirationback to summary
private long expiration
inback to summary
private InputStream in
lastuseback to summary
private long lastuse
outback to summary
private OutputStream out
roundtripback to summary
private long roundtrip
socketback to summary
private Socket socket

Constructor Detail

TCPConnectionback to summary
pack-priv TCPConnection(TCPChannel ch, Socket s, InputStream in, OutputStream out)

Constructor used for creating a connection to accept call (an input connection)

TCPConnectionback to summary
pack-priv TCPConnection(TCPChannel ch, InputStream in, OutputStream out)

Constructor used by subclass when underlying input and output streams are already available.

TCPConnectionback to summary
pack-priv TCPConnection(TCPChannel ch, Socket s)

Constructor used when socket is available, but not underlying streams.

Method Detail

closeback to summary
public void close() throws IOException

Implements sun.rmi.transport.Connection.close.

Close the connection.

expiredback to summary
pack-priv boolean expired(long time)

Returns true if the timeout has expired on this connection; otherwise returns false.

Parameters
time:long

The current time.

getChannelback to summary
public Channel getChannel()

Implements sun.rmi.transport.Connection.getChannel.

Returns the channel for this connection.

getInputStreamback to summary
public InputStream getInputStream() throws IOException

Implements sun.rmi.transport.Connection.getInputStream.

Gets the input stream for this connection.

getOutputStreamback to summary
public OutputStream getOutputStream() throws IOException

Implements sun.rmi.transport.Connection.getOutputStream.

Gets the output stream for this connection

isDeadback to summary
public boolean isDead()

Probes the connection to see if it still alive and connected to a responsive server. If the connection has been idle for too long, the server is pinged. ``Too long'' means ``longer than the last ping round-trip time''.

This method may misdiagnose a dead connection as live, but it will never misdiagnose a live connection as dead.

Returns:boolean

true if the connection and server are recently alive

isReusableback to summary
public boolean isReusable()

Implements sun.rmi.transport.Connection.isReusable.

Determine if this connection can be used for multiple operations. If the socket implements RMISocketInfo, then we can query it about this; otherwise, assume that it does provide a full-duplex persistent connection like java.net.Socket.

releaseInputStreamback to summary
public void releaseInputStream()

Implements sun.rmi.transport.Connection.releaseInputStream.

Release the input stream for this connection.

releaseOutputStreamback to summary
public void releaseOutputStream() throws IOException

Implements sun.rmi.transport.Connection.releaseOutputStream.

Release the output stream for this connection.

setExpirationback to summary
pack-priv void setExpiration(long time)

Set the expiration time of this connection.

Parameters
time:long

The time at which the time out expires.

setLastUseTimeback to summary
pack-priv void setLastUseTime(long time)

Set the timestamp at which this connection was last used successfully. The connection will be pinged for liveness if reused long after this time.

Parameters
time:long

The time at which the connection was last active.