org.objectweb.jonathan.protocols.api

Interface ReplySession

public interface ReplySession

A reply session is used by a server to send a reply back to a client.

Method Summary

void
close()
Closes the session, letting the associated resources be released or reused.
Marshaller
prepareExceptionReply()
Lets the target session write its own headers into a newly created message and returns it (exception case)

An entity wishing to send a message as a reply to an invocation must not create a marshaller on its own and directly send it down the protocol stack.

Marshaller
prepareLocationForwardReply()
Lets the target session write its own headers into a newly created message and returns it (location forward case)

An entity wishing to send a message as a reply to an invocation must not create a marshaller on its own and directly send it down the protocol stack.

Marshaller
prepareReply()
Lets the target session write its own headers into a newly created message and returns it (standard reply case)

An entity wishing to send a message as a reply to an invocation must not create a marshaller on its own and directly send it down the protocol stack.

Marshaller
prepareSystemExceptionReply()
Lets the target session write its own headers into a newly created message and returns it (system exception case)

An entity wishing to send a message as a reply to an invocation must not create a marshaller on its own and directly send it down the protocol stack.

void
send(Marshaller m)
Sends the reply down the protocol stack.

Method Details

close

public void 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.


prepareExceptionReply

public Marshaller prepareExceptionReply()
            throws JonathanException
Lets the target session write its own headers into a newly created message and returns it (exception case)

An entity wishing to send a message as a reply to an invocation must not create a marshaller on its own and directly send it down the protocol stack. Instead, it must ask the session for a marshaller, into which the session will usually already have written its specific headers.

The prepareExceptionReply method must only be used to prepare messages corresponding to an exception raised by the server.

Returns:
a marshaller to write the reply into;


prepareLocationForwardReply

public Marshaller prepareLocationForwardReply()
            throws JonathanException
Lets the target session write its own headers into a newly created message and returns it (location forward case)

An entity wishing to send a message as a reply to an invocation must not create a marshaller on its own and directly send it down the protocol stack. Instead, it must ask the session for a marshaller, into which the session will usually already have written its specific headers.

The prepareLocationForwardReply method must only be used to prepare messages corresponding to an location forward message raised by the server.

Returns:
a marshaller to write the reply into;


prepareReply

public Marshaller prepareReply()
            throws JonathanException
Lets the target session write its own headers into a newly created message and returns it (standard reply case)

An entity wishing to send a message as a reply to an invocation must not create a marshaller on its own and directly send it down the protocol stack. Instead, it must ask the session for a marshaller, into which the session will usually already have written its specific headers.

The prepareException method must only be used to prepare messages corresponding to a non-exceptional reply from the server. If the reply corresponds to an exception raised by the server, use prepareExceptionReply instead.

Returns:
a marshaller to write the reply into;


prepareSystemExceptionReply

public Marshaller prepareSystemExceptionReply()
            throws JonathanException
Lets the target session write its own headers into a newly created message and returns it (system exception case)

An entity wishing to send a message as a reply to an invocation must not create a marshaller on its own and directly send it down the protocol stack. Instead, it must ask the session for a marshaller, into which the session will usually already have written its specific headers.

The prepareSystemExceptionReply method must only be used to prepare messages corresponding to an system exception raised by the server.

Returns:
a marshaller to write the reply into;


send

public void send(Marshaller m)
            throws JonathanException
Sends the reply down the protocol stack.

The sent message must have been obtained by calling the prepareReply or prepareExceptionReply method.

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

Parameters:
m - the message to send;