00001 // -*- C++ -*- 00002 00003 /** 00004 * @file CEC_Event_Loader.h 00005 * 00006 * $Id: CEC_Event_Loader.h 77001 2007-02-12 07:54:49Z johnnyw $ 00007 * 00008 * Define a class to dynamically load the COS Event Service. 00009 * 00010 * @author Priyanka Gontla <pgontla@ece.uci.edu> 00011 */ 00012 00013 #ifndef TAO_CEC_EVENT_LOADER_H 00014 #define TAO_CEC_EVENT_LOADER_H 00015 00016 #include "tao/Object_Loader.h" 00017 00018 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00019 # pragma once 00020 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00021 00022 #include "orbsvcs/CosEvent/CEC_EventChannel.h" 00023 00024 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00025 #include "orbsvcs/CosEvent/CEC_TypedEventChannel.h" 00026 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00027 00028 #include "orbsvcs/CosNamingC.h" 00029 00030 #include "ace/Service_Config.h" 00031 00032 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00033 00034 /** 00035 * @class TAO_CEC_Event_Loader 00036 * 00037 * @brief Dynamically load an instance of the COS Event Service. 00038 */ 00039 class TAO_Event_Serv_Export TAO_CEC_Event_Loader : public TAO_Object_Loader 00040 { 00041 public: 00042 /// Constructor 00043 TAO_CEC_Event_Loader (void); 00044 00045 /// Destructor 00046 ~TAO_CEC_Event_Loader (void); 00047 00048 //@{ 00049 /** 00050 * @name Derived from ACE_Service_Object 00051 */ 00052 virtual int init (int argc, ACE_TCHAR *argv[]); 00053 virtual int fini (void); 00054 //@} 00055 00056 //@{ 00057 /** 00058 * @name Derived from TAO_Object_Loader 00059 */ 00060 virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb, 00061 int argc, 00062 ACE_TCHAR *argv[]); 00063 //@} 00064 00065 protected: 00066 /// Keep a pointer to the underlying ORB. 00067 CORBA::ORB_var orb_; 00068 00069 /// Flag to control the event loop 00070 int terminate_flag_; 00071 00072 /// Attributes used to configure the Event Service properties. 00073 TAO_CEC_EventChannel_Attributes *attributes_; 00074 00075 /// Factory used to configure the Event Service strategies. 00076 TAO_CEC_Factory *factory_; 00077 00078 /// The Event Service implementation class. 00079 TAO_CEC_EventChannel *ec_impl_; 00080 00081 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00082 /// Attributes used to configure the Typed Event Service properties. 00083 TAO_CEC_TypedEventChannel_Attributes *typed_attributes_; 00084 00085 /// The Typed Event Service implementation class. 00086 TAO_CEC_TypedEventChannel *typed_ec_impl_; 00087 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00088 00089 /// Naming Context needed if '-x' option is passed 00090 CosNaming::NamingContext_var naming_context_; 00091 00092 /// Flag to check if '-x' option is passed 00093 int bind_to_naming_service_; 00094 00095 /// The name used when binding to the NamingService. 00096 CosNaming::Name channel_name_; 00097 00098 private: 00099 // Disallow copying and assignment. 00100 TAO_CEC_Event_Loader (const TAO_CEC_Event_Loader &); 00101 TAO_CEC_Event_Loader &operator= (const TAO_CEC_Event_Loader &); 00102 }; 00103 00104 TAO_END_VERSIONED_NAMESPACE_DECL 00105 00106 ACE_FACTORY_DECLARE (TAO_Event_Serv, TAO_CEC_Event_Loader) 00107 00108 #endif /* TAO_CEC_EVENT_LOADER_H */