Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

Session_High Interface Reference

Inheritance diagram for Session_High:

Inheritance graph
[legend]
List of all members.

Public Methods

void prepare (Marshaller m) throws JonathanException
boolean direct ()
ReplyInterface prepareInvocation (Marshaller m) throws JonathanException
void send (Marshaller m) throws JonathanException
void close ()

Detailed Description

Session_High is the type of sessions used to send messages down to the network; A Session_High is usually a surrogate for a session of type Session_Low exported to a protocol and represented by an identifier.

Sessions represent handles on particular communication channels: A session object is dynamically created by a protocol, and lets messages be sent and received through the communication channel it represents, using that protocol. Sessions have higher and lower interfaces, respectively used to send messages down and up a protocol stack.

Usually, a Session_High instance is obtained using the bind operation on a session identifier representing a Session_Low interface: it is thus a surrogate, or a proxy, for that interface.

Definition at line 50 of file Session_High.java.


Member Function Documentation

void Session_High::close ( )
 

Closes the session, letting the associated resources be released or reused.

Sessions may have an exclusive access to a communication resource. It is thus very important to ensure that they are properly closed if they are no longer in use.

Reimplemented in MulticastIpProtocol::MulticastIpSession, RTPProtocol::RTPCoder, TcpIpProtocol::SrvSession, and TcpIpProtocol::CltSession.

Referenced by RTPProtocol::RTPCoder::close(), GIOPProtocol::GIOPSession_High::close(), JStubFactory::ClientDelegate::finalize(), GIOPProtocol::ServerSession_Low::send(), EventChannelFactory::ConsumerDelegate::send(), GIOPProtocol::sendError(), and GIOPProtocol::ServerSession_Low::sendSystemException().

boolean Session_High::direct ( )
 

Return false if the prepare or prepareInvocation must be used, true otherwise.

A true return means that the target protocols headers are added when the message is sent, and not before. Invoking one of the prepare methods would in that case return without having changed anything to the provided marshaler.

Returns:
true if the prepare methods need not be used.

Reimplemented in MulticastIpProtocol::MulticastIpSession, RTPProtocol::RTPCoder, and TcpIpProtocol::Session.

Referenced by GIOPProtocol::sendMessage().

void Session_High::prepare ( Marshaller marshaller )
 

Lets the target session write its own headers into the provided message (one-way case).

Protocols usually need to add headers in the front of messages before sending them down the net. It may be much more efficient to add these headers before the actual message is written. The prepare (and prepareInvocation methods are provided for this purpose. Therefore, an entity wishing to send a message down a protocol stack must first prepare that message by invoking the appropriate method (unless a call to direct returns true), and then write its own data to the message.

The prepare method must only be used to prepare messages with a one-way semantics (no reply expected); If a reply is expected, use prepareInvocation instead.

Parameters:
m   a marshaller representing the message
Exceptions:
JonathanException   if something goes wrong.

Reimplemented in GIOPProtocol::ClientSession_High, MulticastIpProtocol::MulticastIpSession, RTPProtocol::RTPCoder, and TcpIpProtocol::Session.

Referenced by OneWayRefImpl::invoke(), JStubFactory::ClientDelegate::request(), GIOPProtocol::sendError(), and GIOPProtocol::sendMessage().

ReplyInterface Session_High::prepareInvocation ( Marshaller marshaller )
 

Reimplemented in GIOPProtocol::ClientSession_High, MulticastIpProtocol::MulticastIpSession, RTPProtocol::RTPCoder, and TcpIpProtocol::Session.

Referenced by JStubFactory::ClientDelegate::request().

void Session_High::send ( Marshaller message )
 

Sends the message down the protocol stack.

The sent message must have been prepared first, unless a call to direct returns true.

It is the responsibility of the recipient of the message to close it.

Parameters:
m   the message to send;
Exceptions:
JonathanException   if something goes wrong.
See also:
prepareInvocation(Marshaller) , prepare(Marshaller)

Reimplemented in MulticastIpProtocol::MulticastIpSession, RTPProtocol::RTPCoder, TcpIpProtocol::SrvSession, and TcpIpProtocol::CltSession.

Referenced by JStubFactory::ClientDelegate::invoke(), OneWayRefImpl::invoke(), RTPProtocol::RTPCoder::send(), GIOPProtocol::sendError(), and GIOPProtocol::sendMessage().


The documentation for this interface was generated from the following file:
Generated at Fri May 31 19:25:20 2002 for Jonathan by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001