Exclusive_TMS.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Exclusive_TMS.h
00006  *
00007  *  Exclusive_TMS.h,v 1.9 2005/11/02 07:13:02 ossama Exp
00008  *
00009  *  @author  Alexander Babu Arulanthu <alex@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_EXCLUSIVE_TMS_H
00015 #define TAO_EXCLUSIVE_TMS_H
00016 
00017 #include /**/ "ace/pre.h"
00018 
00019 #include "tao/Transport_Mux_Strategy.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00026 
00027 class TAO_Pluggable_Reply_Params;
00028 
00029 /**
00030  * @class TAO_Exclusive_TMS
00031  *
00032  * Using this strategy only one request can be pending at a time
00033  * in a connection.  This improves performance because the client
00034  * does not have to demux the reply, and there is less need for
00035  * synchronization.
00036  * On the other hand, it does not scale well when you have
00037  * multiple client threads or asynchronous messaging.
00038  */
00039 class TAO_Export TAO_Exclusive_TMS : public TAO_Transport_Mux_Strategy
00040 {
00041 
00042 public:
00043   /// Constructor.
00044   TAO_Exclusive_TMS (TAO_Transport *transport);
00045 
00046   /// Destructor.
00047   virtual ~TAO_Exclusive_TMS (void);
00048 
00049   /**
00050    * @name The TAO_Transport_Mux_Strategy overrided methods
00051    *
00052    * Please read the documentation in the TAO_Transport_Mux_Strategy class
00053    * for details.
00054    */
00055   //@{
00056   virtual CORBA::ULong request_id (void);
00057   virtual int bind_dispatcher (CORBA::ULong request_id,
00058                                TAO_Reply_Dispatcher *rh);
00059   virtual int unbind_dispatcher (CORBA::ULong request_id);
00060 
00061   virtual int dispatch_reply (TAO_Pluggable_Reply_Params &params);
00062 
00063   virtual bool idle_after_send (void);
00064   virtual bool idle_after_reply (void);
00065   virtual void connection_closed (void);
00066   //@}
00067 
00068 protected:
00069   /// Used to generate a different request_id on each call to
00070   /// request_id().
00071   CORBA::ULong request_id_generator_;
00072 
00073   /// If 0 then the request id and reply dispatcher below are
00074   /// meaningless
00075   int has_request_;
00076 
00077   /// Request id for the current request.
00078   CORBA::ULong request_id_;
00079 
00080   /// Reply Dispatcher corresponding to the request.
00081   TAO_Reply_Dispatcher *rd_;
00082 
00083   // @@ Commented for the time being, let the commented line stay for
00084   //    sometime - Bala
00085   // TAO_GIOP_Message_State message_state_;
00086   // Message state to read the incoming message.
00087 
00088   // @@ Having members of type TAO_GIOP* indicates that we
00089   // (Transport_Mux_Strategy) are aware of the underlying messaging
00090   // protocol. But for the present let us close our eyes till we are
00091   // able to iterate on a use case - Bala.
00092 };
00093 
00094 TAO_END_VERSIONED_NAMESPACE_DECL
00095 
00096 #include /**/ "ace/post.h"
00097 #endif /* EXCLUSIVE_TMS_H */

Generated on Thu Nov 9 11:54:11 2006 for TAO by doxygen 1.3.6