00001
00002
00003
00004 #ifndef IMR_LOCATOR_I_H
00005 #define IMR_LOCATOR_I_H
00006 #include "ace/pre.h"
00007
00008 #include "locator_export.h"
00009
00010 #include "Adapter_Activator.h"
00011 #include "Forwarder.h"
00012 #include "Locator_Options.h"
00013 #include "Locator_Repository.h"
00014 #include "AsyncStartupWaiter_i.h"
00015 #include "tao/IORTable/IORTable.h"
00016
00017 #include "orbsvcs/IOR_Multicast.h"
00018
00019 #include "ImR_LocatorS.h"
00020 #include "AsyncStartupWaiterS.h"
00021
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif
00025
00026 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00027 class ACE_Reactor;
00028 ACE_END_VERSIONED_NAMESPACE_DECL
00029
00030 class INS_Locator;
00031
00032
00033
00034
00035
00036 class Locator_Export ImR_Locator_i
00037 : public virtual POA_ImplementationRepository::Locator
00038 {
00039 public:
00040 ImR_Locator_i();
00041
00042 ~ImR_Locator_i (void);
00043
00044
00045 int init (Options& opts);
00046
00047
00048 int init_with_orb (CORBA::ORB_ptr orb, Options& opts);
00049
00050
00051 int fini (void);
00052
00053
00054 int run (void);
00055
00056
00057 void shutdown (bool wait_for_completion);
00058
00059 int debug() const;
00060
00061
00062
00063
00064 virtual CORBA::Long register_activator (const char* name,
00065 ImplementationRepository::Activator_ptr admin);
00066 virtual void unregister_activator (const char* name,
00067 CORBA::Long token);
00068 virtual void notify_child_death (const char* name);
00069
00070
00071
00072 virtual void activate_server (const char * name);
00073 virtual void add_or_update_server (const char * name,
00074 const ImplementationRepository::StartupOptions &options);
00075 virtual void remove_server (const char * name);
00076 virtual void shutdown_server (const char * name);
00077 virtual void find (const char * name,
00078 ImplementationRepository::ServerInformation_out info);
00079 virtual void list (
00080 CORBA::ULong how_many,
00081 ImplementationRepository::ServerInformationList_out server_list,
00082 ImplementationRepository::ServerInformationIterator_out server_iterator);
00083 virtual void shutdown(CORBA::Boolean activators, CORBA::Boolean servers);
00084
00085
00086
00087 virtual void server_is_running (const char* name,
00088 const char* partial_ior,
00089 ImplementationRepository::ServerObject_ptr server_object);
00090 virtual void server_is_shutting_down (const char * name);
00091
00092
00093 char* activate_server_by_object (const char* object_name);
00094
00095 char* activate_server_by_name (const char * name, bool manual_start);
00096
00097 private:
00098
00099 char* activate_server_i (Server_Info& info, bool manual_start);
00100
00101 char* activate_perclient_server_i (Server_Info info, bool manual_start);
00102
00103 ImplementationRepository::StartupInfo*
00104 start_server(Server_Info& info, bool manual_start, int& waiting_clients);
00105
00106 bool is_alive(Server_Info& info);
00107 int is_alive_i(Server_Info& info);
00108
00109
00110
00111 int setup_multicast (ACE_Reactor *reactor, const char *ior);
00112 void teardown_multicast();
00113
00114 void unregister_activator_i(const char* activator);
00115
00116 Activator_Info_Ptr get_activator (const ACE_CString& name);
00117 void connect_activator (Activator_Info& info);
00118
00119 void auto_start_servers(void);
00120
00121 CORBA::Object_ptr set_timeout_policy(CORBA::Object_ptr obj, const ACE_Time_Value& to);
00122
00123 void connect_server(Server_Info& info);
00124
00125 PortableServer::POA_ptr findPOA(const char* name);
00126 private:
00127
00128
00129 ImR_Forwarder forwarder_;
00130
00131
00132 ImR_Adapter adapter_;
00133
00134
00135 IORTable::Locator_var ins_locator_;
00136
00137 CORBA::ORB_var orb_;
00138 PortableServer::POA_var root_poa_;
00139 PortableServer::POA_var imr_poa_;
00140
00141 int debug_;
00142
00143 TAO_IOR_Multicast ior_multicast_;
00144
00145 Locator_Repository repository_;
00146
00147 AsyncStartupWaiter_i waiter_svt_;
00148 ImplementationRepository::AsyncStartupWaiter_var waiter_;
00149
00150 bool read_only_;
00151 ACE_Time_Value startup_timeout_;
00152 ACE_Time_Value ping_interval_;
00153 };
00154
00155 #include "ace/post.h"
00156 #endif