00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef TAO_Notify_EVENTCHANNELFACTORY_H
00013 #define TAO_Notify_EVENTCHANNELFACTORY_H
00014
00015 #include "ace/pre.h"
00016
00017 #include "orbsvcs/Notify/notify_serv_export.h"
00018
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif
00022
00023 #include "orbsvcs/Notify/Topology_Object.h"
00024 #include "orbsvcs/Notify/Topology_Factory.h"
00025 #include "orbsvcs/Notify/Reconnection_Registry.h"
00026 #include "orbsvcs/Notify/Routing_Slip.h"
00027
00028 #include "orbsvcs/CosNotifyChannelAdminS.h"
00029 #include "orbsvcs/NotifyExtS.h"
00030
00031 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00032
00033 #if defined(_MSC_VER)
00034 #pragma warning(push)
00035 #pragma warning(disable:4250)
00036 #endif
00037
00038 class TAO_Notify_EventChannel;
00039 template <class TYPE> class TAO_Notify_Container_T;
00040
00041
00042
00043
00044
00045
00046
00047 class TAO_Notify_Serv_Export TAO_Notify_EventChannelFactory
00048 : public virtual POA_NotifyExt::EventChannelFactory
00049 , public TAO_Notify::Topology_Parent
00050
00051 {
00052 friend class TAO_Notify_Builder;
00053 typedef ACE_Unbounded_Set <TAO_Notify::Routing_Slip_Ptr> Routing_Slip_Set;
00054
00055 public:
00056 typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_EventChannelFactory > Ptr;
00057
00058
00059 TAO_Notify_EventChannelFactory (void);
00060
00061
00062 void init (PortableServer::POA_ptr poa);
00063
00064
00065 virtual ~TAO_Notify_EventChannelFactory ();
00066
00067
00068 virtual void _add_ref (void);
00069 virtual void _remove_ref (void);
00070
00071
00072 virtual void remove (TAO_Notify_EventChannel* channel);
00073
00074
00075
00076 virtual CosNotifyChannelAdmin::EventChannel_ptr create_named_channel (
00077 const CosNotification::QoSProperties& initial_qos,
00078 const CosNotification::AdminProperties& initial_admin,
00079 CosNotifyChannelAdmin::ChannelID_out id,
00080 const char* name);
00081
00082
00083
00084
00085
00086
00087
00088
00089 void load_topology (void);
00090
00091
00092
00093 void set_topology_factory(TAO_Notify::Topology_Factory* sf);
00094
00095
00096
00097 virtual bool is_persistent (void) const;
00098
00099 virtual void save_persistent (TAO_Notify::Topology_Saver& saver);
00100 virtual bool change_to_parent (void);
00101 virtual TAO_Notify::Topology_Object* load_child (const ACE_CString &type,
00102 CORBA::Long id,
00103 const TAO_Notify::NVPList& attrs);
00104 CosNotifyChannelAdmin::EventChannelFactory_ptr activate_self (void);
00105 virtual void reconnect (void);
00106
00107
00108 bool handle_change (void);
00109
00110 void load_event_persistence (void);
00111
00112 virtual void save_topology (void);
00113
00114 TAO_Notify_ProxyConsumer * find_proxy_consumer (TAO_Notify::IdVec & id_path, size_t position);
00115 TAO_Notify_ProxySupplier * find_proxy_supplier (TAO_Notify::IdVec & id_path, size_t position);
00116 TAO_Notify_Object * follow_id_path (TAO_Notify::IdVec & id_path, size_t position);
00117 virtual TAO_Notify_Object::ID get_id (void) const;
00118
00119 private:
00120
00121
00122
00123
00124 virtual void destroy (void);
00125
00126
00127 virtual int shutdown (void);
00128
00129 virtual
00130 NotifyExt::ReconnectionRegistry::ReconnectionID register_callback (
00131 NotifyExt::ReconnectionCallback_ptr reconnection);
00132
00133 virtual void unregister_callback (
00134 NotifyExt::ReconnectionRegistry::ReconnectionID id);
00135
00136 virtual CORBA::Boolean is_alive (void);
00137
00138 protected:
00139
00140 virtual ::CosNotifyChannelAdmin::EventChannel_ptr create_channel (
00141 const CosNotification::QoSProperties & initial_qos,
00142 const CosNotification::AdminProperties & initial_admin,
00143 CosNotifyChannelAdmin::ChannelID_out id);
00144
00145 virtual ::CosNotifyChannelAdmin::ChannelIDSeq * get_all_channels (void);
00146
00147 virtual ::CosNotifyChannelAdmin::EventChannel_ptr get_event_channel (
00148 CosNotifyChannelAdmin::ChannelID id);
00149
00150 private:
00151 typedef TAO_Notify_Container_T<TAO_Notify_EventChannel> TAO_Notify_EventChannel_Container;
00152
00153 TAO_Notify_EventChannel_Container& ec_container();
00154
00155
00156 ACE_Auto_Ptr< TAO_Notify_EventChannel_Container > ec_container_;
00157
00158 TAO_SYNCH_MUTEX topology_save_lock_;
00159
00160 CosNotifyChannelAdmin::EventChannelFactory_var channel_factory_;
00161
00162
00163 short topology_save_seq_;
00164 TAO_Notify::Topology_Factory* topology_factory_;
00165 TAO_Notify::Reconnection_Registry reconnect_registry_;
00166 bool loading_topology_;
00167
00168 Routing_Slip_Set routing_slip_restart_set_;
00169
00170
00171 virtual void release (void);
00172
00173 };
00174
00175 TAO_END_VERSIONED_NAMESPACE_DECL
00176
00177 #if defined(_MSC_VER)
00178 #pragma warning(pop)
00179 #endif
00180
00181 #include "ace/post.h"
00182
00183 #endif