org.objectweb.jonathan.protocols.tcpip
Class TcpIpProtocol
- Protocol
public class TcpIpProtocol
This is an implementation of the
Protocol
interface representing the TCP/IP stack.
context_factory
protected ContextFactory context_factory
verbose
public boolean verbose
Indicates whether warning messages should be printed to stderr.
This constant is defined under the name /jonathan/tcpip/verbose
in the bootstrap context
.
TcpIpProtocol
public TcpIpProtocol(TcpIpConnectionMgr connection_mgr,
Scheduler scheduler,
ChunkFactory chunk_factory,
MarshallerFactory mf,
ContextFactory context_factory)
Constructs a new instance of TcpIpProtocol.
connection_mgr
- a connection manager for this protocol;scheduler
- the kernel's scheduler;chunk_factory
- a chunk factory;mf
- a marshaller factory;context_factory
- a context factory
createProtocolGraph
public ProtocolGraph createProtocolGraph(ProtocolGraph[] lower,
Context hints)
Creates a new ProtocolGraph
lower
- lower-level protocol graphs. Ignored as TCP/IP is a leaf.hints
- may contain a "port" key/value pair.
- a new ProtocolGraph
isAnInvocationProtocol
public boolean isAnInvocationProtocol()
Returns false: TcpIpProtocol cannot deal with invocations.
- isAnInvocationProtocol in interface Protocol
- false.
isLocal
public boolean isLocal(IpSessionIdentifier tcp_session_id)
Returns true if the provided session identifier corresponds to a local
connection managed by this protocol.
tcp_session_id
- a TcpIpSessionIdentifier.
- true if the provided session identifier corresponds to a local
connection managed by this protocol, otherwise false.
newSessionIdentifier
public IpSessionIdentifier newSessionIdentifier(String host,
int port)
Creates a new TcpIpSessionIdentifier.
host
- a port number;port
- an host name;
- a new TcpIpSessionIdentifier.
setVerbose
public void setVerbose(boolean verbose)
Used to set the verbiage level.
verbose
- if true, turn on verbosity