org.objectweb.jonathan.protocols.tcpip

Class TcpIpProtocol

Implemented Interfaces:
Protocol

public class TcpIpProtocol
extends Object
implements Protocol

This is an implementation of the Protocol interface representing the TCP/IP stack.

Field Summary

protected ChunkFactory
chunk_factory
protected TcpIpConnectionMgr
connection_mgr
connection manager
protected ContextFactory
context_factory
protected MarshallerFactory
marshaller_factory
protected Scheduler
scheduler
boolean
verbose
Indicates whether warning messages should be printed to stderr.

Constructor Summary

TcpIpProtocol(TcpIpConnectionMgr connection_mgr, Scheduler scheduler, ChunkFactory chunk_factory, MarshallerFactory mf, ContextFactory context_factory)
Constructs a new instance of TcpIpProtocol.

Method Summary

ProtocolGraph
createProtocolGraph(ProtocolGraph[] lower, Context hints)
Creates a new ProtocolGraph
SessionIdentifier
createSessionIdentifier(Properties info, SessionIdentifier[] next)
boolean
isAnInvocationProtocol()
Returns false: TcpIpProtocol cannot deal with invocations.
boolean
isLocal(IpSessionIdentifier tcp_session_id)
Returns true if the provided session identifier corresponds to a local connection managed by this protocol.
IpSessionIdentifier
newSessionIdentifier(String host, int port)
Creates a new TcpIpSessionIdentifier.
void
setVerbose(boolean verbose)
Used to set the verbiage level.

Field Details

chunk_factory

protected ChunkFactory chunk_factory


connection_mgr

protected TcpIpConnectionMgr connection_mgr
connection manager


context_factory

protected ContextFactory context_factory


marshaller_factory

protected MarshallerFactory marshaller_factory


scheduler

protected Scheduler scheduler


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.

Constructor Details

TcpIpProtocol

public TcpIpProtocol(TcpIpConnectionMgr connection_mgr,
                     Scheduler scheduler,
                     ChunkFactory chunk_factory,
                     MarshallerFactory mf,
                     ContextFactory context_factory)
Constructs a new instance of TcpIpProtocol.

Parameters:
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

Method Details

createProtocolGraph

public ProtocolGraph createProtocolGraph(ProtocolGraph[] lower,
                                         Context hints)
Creates a new ProtocolGraph

Parameters:
lower - lower-level protocol graphs. Ignored as TCP/IP is a leaf.
hints - may contain a "port" key/value pair.

Returns:
a new ProtocolGraph


createSessionIdentifier

public SessionIdentifier createSessionIdentifier(Properties info,
                                                 SessionIdentifier[] next)
            throws JonathanException


isAnInvocationProtocol

public boolean isAnInvocationProtocol()
Returns false: TcpIpProtocol cannot deal with invocations.
Specified by:
isAnInvocationProtocol in interface Protocol

Returns:
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.

Parameters:
tcp_session_id - a TcpIpSessionIdentifier.

Returns:
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.

Parameters:
host - a port number;
port - an host name;

Returns:
a new TcpIpSessionIdentifier.


setVerbose

public void setVerbose(boolean verbose)
Used to set the verbiage level.

Parameters:
verbose - if true, turn on verbosity