TAO 4.0.2
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TAO_GIOP_Message_Base Class Reference

Definitions of the GIOP specific stuff. More...

#include <GIOP_Message_Base.h>

Collaboration diagram for TAO_GIOP_Message_Base:
Collaboration graph
[legend]

Public Member Functions

 TAO_GIOP_Message_Base (TAO_ORB_Core *orb_core, TAO_Transport *transport, size_t input_cdr_size=ACE_CDR::DEFAULT_BUFSIZE)
 Constructor.
 
 ~TAO_GIOP_Message_Base ()
 Destructor.
 
void init (CORBA::Octet major, CORBA::Octet minor)
 
int generate_request_header (TAO_Operation_Details &op, TAO_Target_Specification &spec, TAO_OutputCDR &cdr)
 
int generate_locate_request_header (TAO_Operation_Details &op, TAO_Target_Specification &spec, TAO_OutputCDR &cdr)
 Write the RequestHeader in to the cdr stream.
 
int generate_reply_header (TAO_OutputCDR &cdr, TAO_Pluggable_Reply_Params_Base &params)
 Write the reply header.
 
int generate_fragment_header (TAO_OutputCDR &cdr, CORBA::ULong request_id)
 
int format_message (TAO_OutputCDR &cdr, TAO_Stub *stub, TAO_ServerRequest *req)
 
int parse_next_message (TAO_Queued_Data &qd, size_t &mesg_length)
 
int extract_next_message (ACE_Message_Block &incoming, TAO_Queued_Data *&qd)
 
int consolidate_node (TAO_Queued_Data *qd, ACE_Message_Block &incoming)
 Check whether the node qd needs consolidation from incoming.
 
int process_request_message (TAO_Transport *transport, TAO_Queued_Data *qd)
 
int process_reply_message (TAO_Pluggable_Reply_Params &reply_info, TAO_Queued_Data *qd)
 
int generate_exception_reply (TAO_OutputCDR &cdr, TAO_Pluggable_Reply_Params_Base &params, const CORBA::Exception &x)
 Generate a reply message with the exception ex.
 
size_t header_length () const
 Header length.
 
size_t fragment_header_length (const TAO_GIOP_Message_Version &giop_version) const
 The header length of a fragment.
 
TAO_OutputCDRout_stream ()
 
int consolidate_fragmented_message (TAO_Queued_Data *qd, TAO_Queued_Data *&msg)
 
int discard_fragmented_message (const TAO_Queued_Data *cancel_request)
 
TAO_GIOP_Fragmentation_Strategyfragmentation_strategy ()
 Outgoing GIOP message fragmentation strategy.
 
bool is_ready_for_bidirectional (TAO_OutputCDR &msg) const
 

Protected Attributes

Outgoing GIOP Fragment Related Attributes

These attributes are only used when fragmenting outgoing GIOP requests and replies.

TAO_GIOP_Fragmentation_Strategyfragmentation_strategy_
 
TAO_OutputCDR out_stream_
 Buffer where the request is placed.
 

Private Member Functions

int process_request (TAO_Transport *transport, TAO_InputCDR &input, TAO_OutputCDR &output, TAO_GIOP_Message_Generator_Parser *)
 Processes the GIOP_REQUEST messages.
 
int process_locate_request (TAO_Transport *transport, TAO_InputCDR &input, TAO_OutputCDR &output, TAO_GIOP_Message_Generator_Parser *)
 Processes the GIOP_LOCATE_REQUEST messages.
 
TAO_GIOP_Message_Generator_Parserget_parser (const TAO_GIOP_Message_Version &version) const
 Get the parser.
 
int dump_consolidated_msg (TAO_OutputCDR &stream)
 Print out consolidate messages.
 
void dump_msg (const char *label, const u_char *ptr, size_t len)
 Print out a debug messages..
 
int write_protocol_header (GIOP::MsgType t, const TAO_GIOP_Message_Version &version, TAO_OutputCDR &msg)
 
int make_send_locate_reply (TAO_Transport *transport, TAO_GIOP_Locate_Request_Header &request, TAO_GIOP_Locate_Status_Msg &status, TAO_OutputCDR &output, TAO_GIOP_Message_Generator_Parser *)
 
int send_error (TAO_Transport *transport)
 Send error messages.
 
void send_close_connection (const TAO_GIOP_Message_Version &version, TAO_Transport *transport)
 Close a connection, first sending GIOP::CloseConnection.
 
int send_reply_exception (TAO_Transport *transport, TAO_OutputCDR &cdr, CORBA::ULong request_id, IOP::ServiceContextList *svc_info, CORBA::Exception *x)
 
int generate_locate_reply_header (TAO_OutputCDR &cdr, TAO_Pluggable_Reply_Params_Base &params)
 Write the locate reply header.
 
TAO_Queued_Datamake_queued_data (size_t sz)
 
int parse_request_id (const TAO_Queued_Data *qd, CORBA::ULong &request_id) const
 
int parse_request_id (const TAO_InputCDR &cdr, CORBA::ULong &request_id) const
 
void set_giop_flags (TAO_OutputCDR &msg) const
 

Private Attributes

TAO_ORB_Coreorb_core_
 Cached ORB_Core pointer...
 
TAO_GIOP_Message_Generator_Parser_Impl tao_giop_impl_
 All the implementations of GIOP message generator and parsers.
 
TAO::Incoming_Message_Stack fragment_stack_
 

Detailed Description

Definitions of the GIOP specific stuff.

This class will hold the specific details common to all the GIOP versions. Some of them which are here may be shifted if things start changing between versions.

Constructor & Destructor Documentation

◆ TAO_GIOP_Message_Base()

TAO_GIOP_Message_Base::TAO_GIOP_Message_Base ( TAO_ORB_Core * orb_core,
TAO_Transport * transport,
size_t input_cdr_size = ACE_CDR::DEFAULT_BUFSIZE )

Constructor.

◆ ~TAO_GIOP_Message_Base()

TAO_GIOP_Message_Base::~TAO_GIOP_Message_Base ( )

Destructor.

Member Function Documentation

◆ consolidate_fragmented_message()

int TAO_GIOP_Message_Base::consolidate_fragmented_message ( TAO_Queued_Data * qd,
TAO_Queued_Data *& msg )

Consolidate fragmented message with associated fragments, being stored within this class. If reliable transport is used (like TCP) fragments are partially ordered on stack, last fragment on top. Otherwise If un-reliable transport is used (like UDP) fragments may be dis-ordered, and must be ordered before consolidation.

Returns
0 on success and msg points to consolidated message, 1 if there are still fragments outstanding, in case of error -1 is being returned. In any case qd must be released by method implementation.

◆ consolidate_node()

int TAO_GIOP_Message_Base::consolidate_node ( TAO_Queued_Data * qd,
ACE_Message_Block & incoming )

Check whether the node qd needs consolidation from incoming.

◆ discard_fragmented_message()

int TAO_GIOP_Message_Base::discard_fragmented_message ( const TAO_Queued_Data * cancel_request)

Discard all fragments associated to request-id encoded in cancel_request. This operation will never be called concurrently by multiple threads nor concurrently to consolidate_fragmented_message

Returns
-1 on failure, 0 on success, 1 no fragment on stack relating to CancelRequest.

◆ dump_consolidated_msg()

int TAO_GIOP_Message_Base::dump_consolidated_msg ( TAO_OutputCDR & stream)
private

Print out consolidate messages.

◆ dump_msg()

void TAO_GIOP_Message_Base::dump_msg ( const char * label,
const u_char * ptr,
size_t len )
private

Print out a debug messages..

◆ extract_next_message()

int TAO_GIOP_Message_Base::extract_next_message ( ACE_Message_Block & incoming,
TAO_Queued_Data *& qd )

Extract the details of the next message from the incoming through qd. Returns 0 if the message header could not be parsed completely, returns a 1 if the message header could be parsed completely and returns -1 on error.

◆ format_message()

int TAO_GIOP_Message_Base::format_message ( TAO_OutputCDR & cdr,
TAO_Stub * stub,
TAO_ServerRequest * req )

Format the message. As we have not written the message length in the header, we make use of this opportunity to insert and format the message. (Called by client, for requests, provides stub pointer but not the req pointer; called by server, for replies, provides req pointer, not stub pointer.)

◆ fragment_header_length()

size_t TAO_GIOP_Message_Base::fragment_header_length ( const TAO_GIOP_Message_Version & giop_version) const

The header length of a fragment.

◆ fragmentation_strategy()

TAO_GIOP_Fragmentation_Strategy * TAO_GIOP_Message_Base::fragmentation_strategy ( )

Outgoing GIOP message fragmentation strategy.

◆ generate_exception_reply()

int TAO_GIOP_Message_Base::generate_exception_reply ( TAO_OutputCDR & cdr,
TAO_Pluggable_Reply_Params_Base & params,
const CORBA::Exception & x )

Generate a reply message with the exception ex.

◆ generate_fragment_header()

int TAO_GIOP_Message_Base::generate_fragment_header ( TAO_OutputCDR & cdr,
CORBA::ULong request_id )

◆ generate_locate_reply_header()

int TAO_GIOP_Message_Base::generate_locate_reply_header ( TAO_OutputCDR & cdr,
TAO_Pluggable_Reply_Params_Base & params )
private

Write the locate reply header.

◆ generate_locate_request_header()

int TAO_GIOP_Message_Base::generate_locate_request_header ( TAO_Operation_Details & op,
TAO_Target_Specification & spec,
TAO_OutputCDR & cdr )

Write the RequestHeader in to the cdr stream.

◆ generate_reply_header()

int TAO_GIOP_Message_Base::generate_reply_header ( TAO_OutputCDR & cdr,
TAO_Pluggable_Reply_Params_Base & params )

Write the reply header.

◆ generate_request_header()

int TAO_GIOP_Message_Base::generate_request_header ( TAO_Operation_Details & op,
TAO_Target_Specification & spec,
TAO_OutputCDR & cdr )

Write the RequestHeader in to the cdr stream. The underlying implementation of the messaging should do the right thing.

◆ get_parser()

TAO_GIOP_Message_Generator_Parser * TAO_GIOP_Message_Base::get_parser ( const TAO_GIOP_Message_Version & version) const
private

Get the parser.

◆ header_length()

size_t TAO_GIOP_Message_Base::header_length ( ) const

Header length.

◆ init()

void TAO_GIOP_Message_Base::init ( CORBA::Octet major,
CORBA::Octet minor )

Initialize the underlying state object based on the major and minor revision numbers

◆ is_ready_for_bidirectional()

bool TAO_GIOP_Message_Base::is_ready_for_bidirectional ( TAO_OutputCDR & msg) const

Is the messaging object ready for processing BiDirectional request/response?

◆ make_queued_data()

TAO_Queued_Data * TAO_GIOP_Message_Base::make_queued_data ( size_t sz)
private

Creates a new node for the queue with a message block in the node of size sz.

◆ make_send_locate_reply()

int TAO_GIOP_Message_Base::make_send_locate_reply ( TAO_Transport * transport,
TAO_GIOP_Locate_Request_Header & request,
TAO_GIOP_Locate_Status_Msg & status,
TAO_OutputCDR & output,
TAO_GIOP_Message_Generator_Parser * parser )
private

Make a GIOP_LOCATEREPLY and hand that over to the transport so that it can be sent over the connection.

Note
As on date 1.1 & 1.2 seem to have similar headers. Till an unmanageable difference comes let them be implemented here.

◆ out_stream()

TAO_OutputCDR & TAO_GIOP_Message_Base::out_stream ( )

◆ parse_next_message()

int TAO_GIOP_Message_Base::parse_next_message ( TAO_Queued_Data & qd,
size_t & mesg_length )

Parse the details of the next message from the incoming and initializes attributes of qd.

Return values
0If the message header could not be parsed completely,
1If the message header could be parsed completely
-1On error.

◆ parse_request_id() [1/2]

int TAO_GIOP_Message_Base::parse_request_id ( const TAO_InputCDR & cdr,
CORBA::ULong & request_id ) const
private

Parse GIOP request-id of TAO_InputCDR cdr.

Returns
0 on success, otherwise -1

◆ parse_request_id() [2/2]

int TAO_GIOP_Message_Base::parse_request_id ( const TAO_Queued_Data * qd,
CORBA::ULong & request_id ) const
private

Parse GIOP request-id of TAO_Queued_Data qd

Returns
0 on success, otherwise -1

◆ process_locate_request()

int TAO_GIOP_Message_Base::process_locate_request ( TAO_Transport * transport,
TAO_InputCDR & input,
TAO_OutputCDR & output,
TAO_GIOP_Message_Generator_Parser * parser )
private

Processes the GIOP_LOCATE_REQUEST messages.

◆ process_reply_message()

int TAO_GIOP_Message_Base::process_reply_message ( TAO_Pluggable_Reply_Params & reply_info,
TAO_Queued_Data * qd )

Parse the reply message that we received and return the reply information through reply_info

◆ process_request()

int TAO_GIOP_Message_Base::process_request ( TAO_Transport * transport,
TAO_InputCDR & input,
TAO_OutputCDR & output,
TAO_GIOP_Message_Generator_Parser * parser )
private

Processes the GIOP_REQUEST messages.

◆ process_request_message()

int TAO_GIOP_Message_Base::process_request_message ( TAO_Transport * transport,
TAO_Queued_Data * qd )

Process the request message that we have received on the connection

◆ send_close_connection()

void TAO_GIOP_Message_Base::send_close_connection ( const TAO_GIOP_Message_Version & version,
TAO_Transport * transport )
private

Close a connection, first sending GIOP::CloseConnection.

◆ send_error()

int TAO_GIOP_Message_Base::send_error ( TAO_Transport * transport)
private

Send error messages.

◆ send_reply_exception()

int TAO_GIOP_Message_Base::send_reply_exception ( TAO_Transport * transport,
TAO_OutputCDR & cdr,
CORBA::ULong request_id,
IOP::ServiceContextList * svc_info,
CORBA::Exception * x )
private

We must send a LocateReply through transport, this request resulted in some kind of exception.

◆ set_giop_flags()

void TAO_GIOP_Message_Base::set_giop_flags ( TAO_OutputCDR & msg) const
private

Set GIOP message flags in message that has been marshaled into the output CDR stream msg.

Note
It is assumed that the GIOP message header is the first thing marshaled into the output CDR stream msg.

◆ write_protocol_header()

int TAO_GIOP_Message_Base::write_protocol_header ( GIOP::MsgType t,
const TAO_GIOP_Message_Version & version,
TAO_OutputCDR & msg )
private

Writes the GIOP header in to msg

Note
If the GIOP header happens to change in the future, we can push this method in to the generator_parser classes.

Member Data Documentation

◆ fragment_stack_

TAO::Incoming_Message_Stack TAO_GIOP_Message_Base::fragment_stack_
private

All Fragments being received are stored on stack in reverse order, last top

◆ fragmentation_strategy_

TAO_GIOP_Fragmentation_Strategy* TAO_GIOP_Message_Base::fragmentation_strategy_
protected

Strategy that sends data currently marshaled into this TAO_OutputCDR stream if necessary.

◆ orb_core_

TAO_ORB_Core* TAO_GIOP_Message_Base::orb_core_
private

Cached ORB_Core pointer...

◆ out_stream_

TAO_OutputCDR TAO_GIOP_Message_Base::out_stream_
protected

Buffer where the request is placed.

◆ tao_giop_impl_

TAO_GIOP_Message_Generator_Parser_Impl TAO_GIOP_Message_Base::tao_giop_impl_
private

All the implementations of GIOP message generator and parsers.


The documentation for this class was generated from the following files: