00001 // -*- C++ -*- 00002 00003 /** 00004 * @file CEC_Event_Loader.h 00005 * 00006 * CEC_Event_Loader.h,v 1.17 2006/03/14 06:14:24 jtc Exp 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 ACE_ENV_ARG_DECL) 00064 ACE_THROW_SPEC ((CORBA::SystemException)); 00065 //@} 00066 00067 protected: 00068 /// Keep a pointer to the underlying ORB. 00069 CORBA::ORB_var orb_; 00070 00071 /// Flag to control the event loop 00072 int terminate_flag_; 00073 00074 /// Attributes used to configure the Event Service properties. 00075 TAO_CEC_EventChannel_Attributes *attributes_; 00076 00077 /// Factory used to configure the Event Service strategies. 00078 TAO_CEC_Factory *factory_; 00079 00080 /// The Event Service implementation class. 00081 TAO_CEC_EventChannel *ec_impl_; 00082 00083 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00084 /// Attributes used to configure the Typed Event Service properties. 00085 TAO_CEC_TypedEventChannel_Attributes *typed_attributes_; 00086 00087 /// The Typed Event Service implementation class. 00088 TAO_CEC_TypedEventChannel *typed_ec_impl_; 00089 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00090 00091 /// Naming Context needed if '-x' option is passed 00092 CosNaming::NamingContext_var naming_context_; 00093 00094 /// Flag to check if '-x' option is passed 00095 int bind_to_naming_service_; 00096 00097 /// The name used when binding to the NamingService. 00098 CosNaming::Name channel_name_; 00099 00100 private: 00101 // Disallow copying and assignment. 00102 TAO_CEC_Event_Loader (const TAO_CEC_Event_Loader &); 00103 TAO_CEC_Event_Loader &operator= (const TAO_CEC_Event_Loader &); 00104 }; 00105 00106 TAO_END_VERSIONED_NAMESPACE_DECL 00107 00108 ACE_FACTORY_DECLARE (TAO_Event_Serv, TAO_CEC_Event_Loader) 00109 00110 #endif /* TAO_CEC_EVENT_LOADER_H */