Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Connect_Strategy.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file Connect_Strategy.h
00006  *
00007  *  $Id: Connect_Strategy.h,v 1.1.1.1 2003/02/21 18:36:44 chad Exp $
00008  *
00009  *  @author Balachandran Natarajan <bala@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_CONNECT_STRATEGY_H
00014 #define TAO_CONNECT_STRATEGY_H
00015 #include "ace/pre.h"
00016 
00017 #include "TAO_Export.h"
00018 
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif /* ACE_LACKS_PRAGMA_ONCE */
00022 
00023 class TAO_ORB_Core;
00024 class TAO_Connector;
00025 class TAO_Connection_Handler;
00026 class ACE_Synch_Options;
00027 class ACE_Time_Value;
00028 
00029 /**
00030  * @class TAO_Connect_Strategy
00031  *
00032  * @brief Define the interface for the connect strategy, i.e. the
00033  *  algorithm that controls how does the ORB establishes remote
00034  *  connections.
00035  *
00036  * The thread that establishes remote connections can either make a
00037  * blocking or a non-blocking connect. The strategy to wait for the
00038  * connection completion can also be different.
00039  *
00040  * This strategy controls how does the ORB schedules and waits for
00041  * connection completion.
00042  */
00043 
00044 class TAO_Export TAO_Connect_Strategy
00045 {
00046 public:
00047 
00048   /// Constructor
00049   TAO_Connect_Strategy (TAO_ORB_Core *orb);
00050 
00051   /// Destructor
00052   virtual ~TAO_Connect_Strategy (void);
00053 
00054   /// Obtain the synch options that can be passed to ACE_Connector
00055   /* Return the synch option for the connector, based on the timeout
00056    * and the strategy in place. ACE_Connectors behavior can be altered
00057    * by passing the right ACE_Synch_Options to the connect () call.
00058    */
00059   virtual void synch_options (ACE_Time_Value *val,
00060                               ACE_Synch_Options &opt) = 0;
00061 
00062   /// Wait for the connection to be completed till a timeout occurs.
00063   /* If the connection establishment fails the state within the
00064    * connection handler is set appropriately.
00065    */
00066   virtual int wait (TAO_Connection_Handler *ch,
00067                     ACE_Time_Value *val) = 0;
00068 
00069   /// Cleanup in case of failed connect.
00070   /*
00071    * Do any left over memory management or related things after
00072    * the connect failed. The argument @c is_successful indicates
00073    * whether the connection handler had undergone a sucessful state
00074    * completion or not.
00075    */
00076   virtual int post_failed_connect (TAO_Connection_Handler *ch,
00077                                    int is_finalized = 1);
00078 
00079 protected:
00080   /// Cached copy of the ORB core pointer
00081   TAO_ORB_Core *orb_core_;
00082 };
00083 
00084 
00085 #include "ace/post.h"
00086 #endif /*TAO_CONNECT_STRATEGY_H*/

Generated on Mon Jun 16 13:48:05 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002