summaryrefslogtreecommitdiff
path: root/TAO/tao/ORB_Core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/ORB_Core.cpp')
-rw-r--r--TAO/tao/ORB_Core.cpp70
1 files changed, 53 insertions, 17 deletions
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index a463d1adc8a..9811b74192f 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -1,7 +1,6 @@
// $Id$
#include "tao/ORB_Core.h"
-#include "tao/ORB.h"
#include "ace/Env_Value_T.h"
#include "ace/Arg_Shifter.h"
@@ -19,6 +18,9 @@
ACE_RCSID(tao, ORB_Core, "$Id$")
+typedef ACE_TSS_Singleton<TAO_ORB_Core_TSS_Resources, ACE_SYNCH_MUTEX>
+ TAO_ORB_CORE_TSS_RESOURCES;
+
// ****************************************************************
CORBA_Environment&
@@ -47,11 +49,8 @@ TAO_ORB_Core::TAO_ORB_Core (void)
#if defined (TAO_ARL_USES_SAME_CONNECTOR_PORT)
arl_same_port_connect_ (0),
#endif /* TAO_ARL_USES_SAME_CONNECTOR_PORT */
- preconnections_ (0),
- poa_current_ (0)
+ preconnections_ (0)
{
- ACE_NEW (this->poa_current_,
- TAO_POA_Current);
}
TAO_ORB_Core::~TAO_ORB_Core (void)
@@ -63,8 +62,6 @@ TAO_ORB_Core::~TAO_ORB_Core (void)
// Allocated in init()
delete this->orb_params_;
-
- delete this->poa_current_;
}
int
@@ -572,6 +569,8 @@ TAO_ORB_Core::init (int &argc, char *argv[])
this->orb_params ()->use_lite_protocol (giop_lite);
+ this->orb_params ()->use_dotted_decimal_addresses (dotted_decimal_addresses);
+
// tell the registry to open all registered interfaces! fredk
if (this->connector_registry ()->open (trf, this->reactor ()) != 0)
return -1;
@@ -824,17 +823,43 @@ TAO_ORB_Core::arl_same_port_connect (void)
#endif /* TAO_ARL_USES_SAME_CONNECTOR_PORT */
int
-TAO_ORB_Core::inherit_from_parent_thread (TAO_ORB_Core_TSS_Resources *tss_resources)
+TAO_ORB_Core::inherit_from_parent_thread (TAO_ORB_Core *p)
{
// Inherit properties/objects used in ORB_Core from the
// parent thread. Stuff inherited here must already exist
// in the "parent" orbcore.
- this->reactor (tss_resources->reactor_);
+ this->reactor (p->reactor ());
// We'll use the spawning thread's reactor.
- // this->connection_cache (tss_resources->connection_cache_);
- // Inherit connection cache?
+ this->thr_mgr (p->thr_mgr ());
+ // We should use the same thread_manager.
+
+ this->connector_registry (p->connector_registry ());
+ // We'll use the spawning thread's connector.
+
+ this->orb (p->orb ());
+ // We'll use the spawning thread's ORB.
+
+ this->root_poa (p->root_poa ());
+ // And its root_poa.
+
+ this->orb_params_ = p->orb_params ();
+ // We also need its ORB_Params.
+
+ this->acceptor (p->acceptor ());
+ // Also grab the acceptor passively listening for connection
+ // requests.
+
+ this->using_collocation (p->using_collocation ());
+ // Use the same collocation settings
+
+ this->resource_factory_ = p->resource_factory ();
+ this->client_factory_ = p->client_factory ();
+ this->server_factory_ = p->server_factory ();
+ // Inherit the factories. Notice that they will not be destroyed by
+ // this orb_core because *_factory_from_service_config_'s all
+ // default to FALSE.
return 0;
}
@@ -1097,10 +1122,21 @@ TAO_ORB_Core::reactor (void)
return tss->reactor_;
}
-TAO_POA_Current &
-TAO_ORB_Core::poa_current (void) const
+TAO_POA_Current *
+TAO_ORB_Core::poa_current (void)
{
- return *this->poa_current_;
+ return TAO_ORB_CORE_TSS_RESOURCES::instance ()->poa_current_;
+}
+
+TAO_POA_Current *
+TAO_ORB_Core::poa_current (TAO_POA_Current *new_current)
+{
+ TAO_ORB_Core_TSS_Resources *tss =
+ TAO_ORB_CORE_TSS_RESOURCES::instance ();
+
+ TAO_POA_Current *old = tss->poa_current_;
+ tss->poa_current_ = new_current;
+ return old;
}
CORBA_Environment*
@@ -1140,7 +1176,7 @@ TAO_ORB_Core::policy_current (TAO_Policy_Current* current)
TAO_ORB_Core_TSS_Resources::TAO_ORB_Core_TSS_Resources (void)
: reactor_ (0),
- poa_current_impl_ (0),
+ poa_current_ (0),
default_environment_ (&this->tss_environment_),
#if defined (TAO_HAS_CORBA_MESSAGING)
policy_current_ (&this->initial_policy_current_),
@@ -1167,6 +1203,8 @@ TAO_ORB_Core_TSS_Resources::~TAO_ORB_Core_TSS_Resources (void)
// ****************************************************************
+// ****************************************************************
+
// This function exists because of Win32's proclivity for expanding
// templates at link time. Since DLLs are just executables, templates
// get expanded and instantiated at link time. Thus, if there are
@@ -1184,8 +1222,6 @@ TAO_ORB_Core_instance (void)
return CORBA::instance ()->orb_core_;
}
-// ****************************************************************
-
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
template class ACE_Env_Value<int>;