org.objectweb.jonathan.protocols.ip.lib
Class JConnectionMgr.Connection
java.lang.Object
org.objectweb.jonathan.protocols.ip.lib.JConnectionMgr.Connection
- JConnectionMgr
- IpConnection
public class JConnectionMgr.Connection
Implementation of TcpIpConnection.
Connection
protected Connection(IpConnection delegate)
throws JonathanException
Builds a new connection.
acquire
public void acquire()
Returns when the socket is acquired. This information is taken into
account by the connection manager to avoid closing connections still in
use.
delete
public void delete()
Deletes this connection, removing it from the connection manager, and
closing the socket. This method should not be used a a socket user unless
a problem occurs on the connection, like an exception when trying to read
or to write data.
- delete in interface IpConnection
getHostName
public String getHostName()
Returns the host name of the underlying socket.
- getHostName in interface IpConnection
- the host name of the underlying socket.
getPort
public int getPort()
Returns the port number of the underlying socket.
- getPort in interface IpConnection
- the port number of the underlying socket.
getSession
public IpSession getSession()
Returns the session attached to this connection.
- getSession in interface IpConnection
- the session attached to this connection.
hashCode
public int hashCode()
release
public void release()
Releases this connection. This is to indicate to the connection manager
that the target connection is no longer used.
- release in interface IpConnection
setSession
public void setSession(IpSession session)
Attaches a new session to this connection.
- setSession in interface IpConnection
session
- the session to be attached to the target connection.
toString
public String toString()