summaryrefslogtreecommitdiff
path: root/TAO/tao/GIOP_Message_Base.h
diff options
context:
space:
mode:
authorbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-07-06 04:41:00 +0000
committerbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-07-06 04:41:00 +0000
commitd8ad30bbf6dbe53647040d40d2e53fbdf8edf4b8 (patch)
tree3874c3e46e81a1a1c5a6c459720e1c17cab62da2 /TAO/tao/GIOP_Message_Base.h
parent08c2939a52133c144b5f17b7f8556b5dc046c0b0 (diff)
downloadATCD-d8ad30bbf6dbe53647040d40d2e53fbdf8edf4b8.tar.gz
ChangeLogTag: Thu Jul 5 23:30:07 2001 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/GIOP_Message_Base.h')
-rw-r--r--TAO/tao/GIOP_Message_Base.h89
1 files changed, 50 insertions, 39 deletions
diff --git a/TAO/tao/GIOP_Message_Base.h b/TAO/tao/GIOP_Message_Base.h
index ecb194b1148..c30113ec963 100644
--- a/TAO/tao/GIOP_Message_Base.h
+++ b/TAO/tao/GIOP_Message_Base.h
@@ -22,10 +22,12 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "tao/GIOP_Message_Generator_Parser_Impl.h"
-#include "tao/GIOP_Message_Reactive_Handler.h"
#include "tao/GIOP_Utils.h"
+#include "tao/GIOP_Message_State.h"
+
class TAO_Pluggable_Reply_Params;
+class TAO_Queued_Data;
/**
* @class TAO_GIOP_Message_Base
@@ -41,7 +43,7 @@ class TAO_Pluggable_Reply_Params;
class TAO_Export TAO_GIOP_Message_Base : public TAO_Pluggable_Messaging
{
public:
- friend class TAO_GIOP_Message_Reactive_Handler;
+ // friend class TAO_GIOP_Message_Reactive_Handler;
/// Constructor
TAO_GIOP_Message_Base (TAO_ORB_Core *orb_core,
@@ -56,7 +58,7 @@ public:
CORBA::Octet minor);
/// Reset the messaging the object
- virtual void reset (int reset_flag = 1);
+ virtual void reset (void);
/// Write the RequestHeader in to the <cdr> stream. The underlying
/// implementation of the mesaging should do the right thing.
@@ -91,27 +93,40 @@ public:
/// the message.
virtual int format_message (TAO_OutputCDR &cdr);
+ /// Parse the incoming messages..
+ virtual int parse_incoming_messages (ACE_Message_Block &message_block);
- /// Get the message type. The return value would be one of the
- /// following:
- /// TAO_PLUGGABLE_MESSAGE_REQUEST,
- /// TAO_PLUGGABLE_MESSAGE_REPLY,
- /// TAO_PLUGGABLE_MESSAGE_CLOSECONNECTION,
- /// TAO_PLUGGABLE_MESSAGE_MESSAGE_ERROR.
- virtual TAO_Pluggable_Message_Type message_type (void);
+ /// Calculate the amount of data that is missing in the <incoming>
+ /// message block.
+ virtual ssize_t missing_data (ACE_Message_Block &message_block);
+ /* Extract the details of the next message from the <incoming>
+ * through <qd>. Returns 1 if there are more messages and returns a
+ * 0 if there are no more messages in <incoming>.
+ */
+ virtual int extract_next_message (ACE_Message_Block &incoming,
+ TAO_Queued_Data *&qd);
+ /// Check whether the node <qd> needs consolidation from <incoming>
+ virtual int consolidate_node (TAO_Queued_Data *qd,
+ ACE_Message_Block &incoming);
+
+ /// Get the details of the message parsed through the <qd>.
+ virtual void get_message_data (TAO_Queued_Data *qd);
/// Process the request message that we have received on the
/// connection
virtual int process_request_message (TAO_Transport *transport,
- TAO_ORB_Core *orb_core);
+ TAO_Queued_Data *qd);
+
/// Parse the reply message that we received and return the reply
/// information though <reply_info>
virtual int process_reply_message (
- TAO_Pluggable_Reply_Params &reply_info
- );
+ TAO_Pluggable_Reply_Params &reply_info,
+ TAO_Queued_Data *qd);
+
+
/// Generate a reply message with the exception <ex>.
virtual int generate_exception_reply (
@@ -124,13 +139,13 @@ protected:
/// Processes the <GIOP_REQUEST> messages
int process_request (TAO_Transport *transport,
- TAO_ORB_Core *orb_core,
- TAO_InputCDR &input);
+ TAO_InputCDR &input,
+ TAO_OutputCDR &output);
/// Processes the <GIOP_LOCATE_REQUEST> messages
int process_locate_request (TAO_Transport *transport,
- TAO_ORB_Core *orb_core,
- TAO_InputCDR &input);
+ TAO_InputCDR &input,
+ TAO_OutputCDR &output);
/// Set the state
void set_state (CORBA::Octet major,
@@ -141,6 +156,14 @@ protected:
const u_char *ptr,
size_t len);
+ /// Get the message type. The return value would be one of the
+ /// following:
+ /// TAO_PLUGGABLE_MESSAGE_REQUEST,
+ /// TAO_PLUGGABLE_MESSAGE_REPLY,
+ /// TAO_PLUGGABLE_MESSAGE_CLOSECONNECTION,
+ /// TAO_PLUGGABLE_MESSAGE_MESSAGE_ERROR.
+ TAO_Pluggable_Message_Type message_type (TAO_GIOP_Message_State &state);
+
private:
/// Writes the GIOP header in to <msg>
@@ -156,7 +179,8 @@ private:
/// unmanageable difference comes let them be implemented here.
int make_send_locate_reply (TAO_Transport *transport,
TAO_GIOP_Locate_Request_Header &request,
- TAO_GIOP_Locate_Status_Msg &status);
+ TAO_GIOP_Locate_Status_Msg &status,
+ TAO_OutputCDR &output);
/// Send error messages
int send_error (TAO_Transport *transport);
@@ -184,39 +208,26 @@ private:
/// request/response?
virtual int is_ready_for_bidirectional (void);
- /// Are there any more messages that needs processing
- virtual int more_messages (void);
+ /// Creates a new node for the queue with a message block in the
+ /// node of size <sz>..
+ TAO_Queued_Data *make_queued_data (size_t sz);
private:
+ /// Cached ORB_Core pointer...
+ TAO_ORB_Core *orb_core_;
+
/// Thr message handler object that does reading and parsing of the
/// incoming messages
- TAO_GIOP_Message_Reactive_Handler message_handler_;
-
- /// Output CDR
- TAO_OutputCDR *output_;
-
- /// Allocators for the output CDR that we hold. As we cannot rely on
- /// the resources from ORB Core we reserve our own resources. The
- /// reason that we cannot believe the ORB core is that, for a
- /// multi-threaded servers it dishes out resources cached in
- /// TSS. This would be dangerous as TSS gets destroyed before we
- /// would. So we have our own memory that we can rely on.
- /// Implementations of GIOP that we have
- ACE_Allocator *cdr_buffer_alloc_;
- ACE_Allocator *cdr_dblock_alloc_;
- ACE_Allocator *cdr_msgblock_alloc_;
-
- /// A buffer that we will use to initialise the CDR stream
- char repbuf_[ACE_CDR::DEFAULT_BUFSIZE];
+ TAO_GIOP_Message_State message_state_;
/// All the implementations of GIOP message generator and parsers
TAO_GIOP_Message_Generator_Parser_Impl tao_giop_impl_;
protected:
-
/// The generator and parser state.
TAO_GIOP_Message_Generator_Parser *generator_parser_;
+
};