diff options
Diffstat (limited to 'TAO/tao/Connect_Strategy.h')
-rw-r--r-- | TAO/tao/Connect_Strategy.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/TAO/tao/Connect_Strategy.h b/TAO/tao/Connect_Strategy.h new file mode 100644 index 00000000000..000198a083e --- /dev/null +++ b/TAO/tao/Connect_Strategy.h @@ -0,0 +1,76 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Connect_Strategy.h + * + * $Id$ + * + * @author Balachandran Natarajan <bala@cs.wustl.edu> + */ +//============================================================================= + +#ifndef TAO_CONNECT_STRATEGY_H +#define TAO_CONNECT_STRATEGY_H +#include "ace/pre.h" + +#include "TAO_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class TAO_ORB_Core; +class TAO_Connector; +class TAO_Connection_Handler; +class ACE_Synch_Options; +class ACE_Time_Value; + +/** + * @class TAO_Connect_Strategy + * + * @brief Define the interface for the connect strategy, i.e. the + * algorithm that controls how does the ORB establishes remote + * connections. + * + * The thread that establishes remote connections can either make a + * blocking or a non-blocking connect. The strategy to wait for the + * connection completion can also be different. + * + * This strategy controls how does the ORB schedules and waits for + * connection completion. + */ + +class TAO_Export TAO_Connect_Strategy +{ +public: + + /// Constructor + TAO_Connect_Strategy (TAO_ORB_Core *orb); + + /// Destructor + virtual ~TAO_Connect_Strategy (void); + + /* Return the synch option for the connector, based on the timeout + * and the strategy in place. ACE_Connectors behavior can be altered + * by passing the right ACE_Synch_Options to the connect () call. + */ + virtual void synch_options (ACE_Time_Value *val, + ACE_Synch_Options &opt) = 0; + + /* Wait for the connection to be completed and return a transport + * whose reference count has been incremented. If the connection + * establishment fails this method returns a null transport + * indicating the failure of connection. + */ + virtual int wait (TAO_Connection_Handler *ch, + ACE_Time_Value *val) = 0; +protected: + + /// Cached copy of the ORB core pointer + TAO_ORB_Core *orb_core_; +}; + + + +#endif /*TAO_CONNECT_STRATEGY_H*/ |