3 //=============================================================================
5 * @file Transport_Mux_Strategy.h
7 * @author Alexander Babu Arulanthu <alex@cs.wustl.edu>
9 //=============================================================================
11 #ifndef TAO_TRANSPORT_MUX_STRATEGY_H
12 #define TAO_TRANSPORT_MUX_STRATEGY_H
14 #include /**/ "ace/pre.h"
16 #include /**/ "tao/TAO_Export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/Basic_Types.h"
23 #include "tao/Reply_Dispatcher.h"
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
28 class TAO_Pluggable_Reply_Params
;
31 * @class TAO_Transport_Mux_Strategy
33 * @brief Strategy to determine whether the connection should be
34 * multiplexed for multiple requests or it is exclusive for a
35 * single request at a time.
37 class TAO_Export TAO_Transport_Mux_Strategy
40 /// Base class constructor.
41 TAO_Transport_Mux_Strategy (TAO_Transport
*transport
);
43 /// Base class destructor.
44 virtual ~TAO_Transport_Mux_Strategy ();
46 /// Generate and return an unique request id for the current
48 virtual CORBA::ULong
request_id () = 0;
50 /// Bind the dispatcher with the request id. Commonalities in the
51 /// derived class implementations is kept here.
52 virtual int bind_dispatcher (CORBA::ULong request_id
,
53 ACE_Intrusive_Auto_Ptr
<TAO_Reply_Dispatcher
> rd
) = 0;
56 * Unbind the dispatcher, the client is no longer waiting for the
57 * request, for example, because the request timed out.
58 * The strategy can (must) cleanup any resources associated with the
60 * A later reply for that request should be ignored.
62 virtual int unbind_dispatcher (CORBA::ULong request_id
) = 0;
65 * Dispatch a reply timeout for request @a request_id
67 virtual int reply_timed_out (CORBA::ULong request_id
) = 0;
69 /// Dispatch the reply for request_id, cleanup any resources
70 /// allocated for that request.
71 virtual int dispatch_reply (TAO_Pluggable_Reply_Params
¶ms
) = 0;
73 /// Request has been just sent, but the reply is not received. Idle
74 /// the transport now. The return value indicates whether idling was
75 /// successful or not.
76 virtual bool idle_after_send () = 0;
78 /// Request is sent and the reply is received. Idle the transport
79 /// now. The return value indicates whether idling was successful or
81 virtual bool idle_after_reply () = 0;
83 /// The transport object has closed the connection, inform all Reply
84 /// dispatchers and waiting strategies.
85 virtual void connection_closed () = 0;
87 /// Do we have a request pending
88 virtual bool has_request () = 0;
91 /// Cache the transport reference.
92 TAO_Transport
*transport_
;
95 TAO_END_VERSIONED_NAMESPACE_DECL
97 #include /**/ "ace/post.h"
99 #endif /* TRANSPORT_MUX_STRATEGY_H */