Reply_Dispatcher.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     Reply_Dispatcher.h
00006  *
00007  *  $Id: Reply_Dispatcher.h 79705 2007-09-24 07:45:37Z johnnyw $
00008  *
00009  *   Define the interface for the Reply_Dispatcher strategies.
00010  *
00011  *
00012  *  @author  Alexander Babu Arulanthu <alex@cs.wustl.edu>
00013  */
00014 //=============================================================================
00015 
00016 #ifndef TAO_REPLY_DISPATCHER_H
00017 #define TAO_REPLY_DISPATCHER_H
00018 
00019 #include /**/ "ace/pre.h"
00020 
00021 #include /**/ "tao/TAO_Export.h"
00022 
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif /* ACE_LACKS_PRAGMA_ONCE */
00026 
00027 #include "tao/Basic_Types.h"
00028 #include "tao/GIOPC.h"
00029 
00030 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00031 
00032 // Forward Declarations.
00033 class TAO_Pluggable_Reply_Params;
00034 
00035 /**
00036  * @class TAO_Reply_Dispatcher
00037  *
00038  * Different invocation modes process the Reply messages in
00039  * different ways.  Traditional synchronous replies simply receive
00040  * the message and wake up the waiting thread (if any).
00041  * Asynchronous Method Invocation (Callbacks) must process the
00042  * message in the thread that receives it.
00043  * Deferred Synchronous (DII) and AMI in the Poller mode save the
00044  * reply for later processing in the application.
00045  * The lower level components in the ORB only deal with this
00046  * abstract interface, when the invocation is made the right type
00047  * of Reply Dispatcher is instantiated and registered with the
00048  * Transport object.
00049  */
00050 class TAO_Export TAO_Reply_Dispatcher
00051 {
00052 
00053 public:
00054   /// Constructor.
00055   TAO_Reply_Dispatcher (void);
00056 
00057   /// Destructor.
00058   virtual ~TAO_Reply_Dispatcher (void);
00059 
00060   /**
00061    * Dispatch the reply. Return 1 on sucess, -1 on error.
00062    * @todo Pluggable Messaging:  this method has too many arguments,
00063    *    the "Right Thing"[tm] is for the Transport Object to create a
00064    *    "ClientReply" that encapsulates all we need to process a
00065    *    reply.  Naturally it is possible that different messaging
00066    *    protocols implement different variants of such ClientReply
00067    *    class.
00068    */
00069   virtual int dispatch_reply (TAO_Pluggable_Reply_Params &params) = 0;
00070 
00071   /**
00072    * The used for the pending reply has been closed.
00073    * No reply is expected.
00074    * @todo If the connection was closed due to a CloseConnection
00075    *    message then we could re-issue the request instead of raising
00076    *    the exception, it would a matter of simply adding a boolean
00077    *    argument to this function.
00078    */
00079   virtual void connection_closed (void) = 0;
00080 
00081   /// Get the locate reply status.
00082   GIOP::LocateStatusType locate_reply_status (void) const;
00083 
00084   GIOP::ReplyStatusType reply_status (void) const;
00085 
00086 protected:
00087   /// LocateReply status.
00088   GIOP::LocateStatusType locate_reply_status_;
00089 
00090   // RequestReply status
00091   GIOP::ReplyStatusType reply_status_;
00092 };
00093 
00094 TAO_END_VERSIONED_NAMESPACE_DECL
00095 
00096 #if defined (__ACE_INLINE__)
00097 #include "tao/Reply_Dispatcher.inl"
00098 #endif /* __ACE_INLINE__ */
00099 
00100 #include /**/ "ace/post.h"
00101 
00102 #endif /* TAO_REPLY_DISPATCHER_H */

Generated on Tue Feb 2 17:37:52 2010 for TAO by  doxygen 1.4.7