summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-17 16:07:58 +0000
committeralex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-17 16:07:58 +0000
commit0607af72bfb7e66b828dd282890d142f4f954585 (patch)
tree8ced1187b9a056451a2e36e13de23bc432799131
parent8863722dcfb04b9614df72a4649b9cef610c7221 (diff)
downloadATCD-0607af72bfb7e66b828dd282890d142f4f954585.tar.gz
ChangeLogTag : Sat Jul 17 10:53:49 1999 Alexander Babu Arulanthu <alex@cs.wustl.edu>
-rw-r--r--TAO/tao/GIOP.h5
-rw-r--r--TAO/tao/Object_Adapter.cpp33
-rw-r--r--TAO/tao/Object_Adapter.h7
-rw-r--r--TAO/tao/Object_Adapter.i3
-rw-r--r--TAO/tao/Reply_Dispatcher.cpp3
-rw-r--r--TAO/tao/Stub.cpp64
6 files changed, 66 insertions, 49 deletions
diff --git a/TAO/tao/GIOP.h b/TAO/tao/GIOP.h
index ae666b93873..52fef3fc723 100644
--- a/TAO/tao/GIOP.h
+++ b/TAO/tao/GIOP.h
@@ -36,6 +36,11 @@
#define TAO_GIOP_H
#include "tao/corbafwd.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
#include "tao/Sequence.h"
#include "tao/CDR.h"
diff --git a/TAO/tao/Object_Adapter.cpp b/TAO/tao/Object_Adapter.cpp
index 33614335dcc..2ef029a18ce 100644
--- a/TAO/tao/Object_Adapter.cpp
+++ b/TAO/tao/Object_Adapter.cpp
@@ -317,7 +317,9 @@ TAO_Object_Adapter::activate_poa (const poa_name &folded_name,
iteratable_poa_name::iterator iterator = ipn.begin ();
iteratable_poa_name::iterator end = ipn.end ();
- TAO_POA *parent = this->orb_core_.root_poa ();
+ TAO_POA *parent = this->orb_core_.root_poa (ACE_TRY_ENV);
+ ACE_CHECK_RETURN (-1);
+
if (parent->name () != *iterator)
ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (),
-1);
@@ -348,15 +350,22 @@ int
TAO_Object_Adapter::find_transient_poa (const poa_name &system_name,
CORBA::Boolean root,
const TAO_Temporary_Creation_Time &poa_creation_time,
- TAO_POA *&poa)
-{
+ TAO_POA *&poa,
+ CORBA::Environment &ACE_TRY_ENV)
+{
int result = 0;
if (root)
- poa = this->orb_core_.root_poa ();
+ {
+ poa = this->orb_core_.root_poa (ACE_TRY_ENV);
+ ACE_CHECK_RETURN (-1);
+ }
else
- result = this->transient_poa_map_->find (system_name,
- poa);
+ {
+ result = this->transient_poa_map_->find (system_name,
+ poa);
+ }
+
if (result == 0 && poa->creation_time () != poa_creation_time)
result = -1;
@@ -1018,11 +1027,10 @@ TAO_POA_Current_Impl::setup (TAO_POA *p,
this->servant_ = servant;
// Set the current context and remember the old one.
- TAO_TSS_Resources *tss =
- TAO_TSS_RESOURCES::instance ();
+ this->tss_resources_ = TAO_TSS_RESOURCES::instance ();
- this->previous_current_impl_ = tss->poa_current_impl_;
- tss->poa_current_impl_ = this;
+ this->previous_current_impl_ = this->tss_resources_->poa_current_impl_;
+ this->tss_resources_->poa_current_impl_ = this;
// Setup is complete.
this->setup_done_ = 1;
@@ -1033,11 +1041,8 @@ TAO_POA_Current_Impl::teardown (void)
{
if (this->setup_done_)
{
- TAO_TSS_Resources *tss =
- TAO_TSS_RESOURCES::instance ();
-
// Reset the old context.
- tss->poa_current_impl_ = this->previous_current_impl_;
+ this->tss_resources_->poa_current_impl_ = this->previous_current_impl_;
}
}
diff --git a/TAO/tao/Object_Adapter.h b/TAO/tao/Object_Adapter.h
index 60e33b58535..51c92ba14ef 100644
--- a/TAO/tao/Object_Adapter.h
+++ b/TAO/tao/Object_Adapter.h
@@ -44,6 +44,7 @@ class TAO_POA;
class TAO_POA_Manager;
class TAO_Temporary_Creation_Time;
class TAO_POA_Current_Impl;
+class TAO_TSS_Resources;
class TAO_Export TAO_POA_Current : public POA_PortableServer::Current
{
@@ -162,6 +163,9 @@ protected:
int setup_done_;
// Is setup complete?
+ TAO_TSS_Resources *tss_resources_;
+ // Pointer to tss resources.
+
// = Hidden because we don't allow these
TAO_POA_Current_Impl (const TAO_POA_Current_Impl &);
void operator= (const TAO_POA_Current_Impl &);
@@ -258,7 +262,8 @@ protected:
int find_transient_poa (const poa_name &system_name,
CORBA::Boolean root,
const TAO_Temporary_Creation_Time &poa_creation_time,
- TAO_POA *&poa);
+ TAO_POA *&poa,
+ CORBA_Environment &ACE_TRY_ENV);
int find_persistent_poa (const poa_name &system_name,
TAO_POA *&poa,
diff --git a/TAO/tao/Object_Adapter.i b/TAO/tao/Object_Adapter.i
index 0b74301bc99..ac888704fdb 100644
--- a/TAO/tao/Object_Adapter.i
+++ b/TAO/tao/Object_Adapter.i
@@ -95,7 +95,8 @@ TAO_Object_Adapter::find_poa (const poa_name &system_name,
return this->find_transient_poa (system_name,
root,
poa_creation_time,
- poa);
+ poa,
+ ACE_TRY_ENV);
}
}
diff --git a/TAO/tao/Reply_Dispatcher.cpp b/TAO/tao/Reply_Dispatcher.cpp
index 1d5f3448150..5b38295ad9c 100644
--- a/TAO/tao/Reply_Dispatcher.cpp
+++ b/TAO/tao/Reply_Dispatcher.cpp
@@ -72,8 +72,7 @@ TAO_Synch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status,
this->reply_ctx_.replace (max, len, context_list, 1);
// Steal the buffer so that no copying is done.
- this->reply_cdr_.reset (message_state->cdr.steal_contents (),
- message_state->cdr.byte_order ());
+ this->reply_cdr_.steal_from (message_state->cdr);
// If condition variable is present, then we are doing leader
// follower model. Do all the nessary things.
diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp
index b4fc7c00b0e..ce121c97536 100644
--- a/TAO/tao/Stub.cpp
+++ b/TAO/tao/Stub.cpp
@@ -99,6 +99,32 @@ TAO_Stub::TAO_Stub (char *repository_id,
this->set_base_profiles (profiles);
}
+void
+TAO_Stub::add_forward_profiles (const TAO_MProfile &mprofiles)
+{
+ // we assume that the profile_in_use_ is being
+ // forwarded! Grab the lock so things don't change.
+ ACE_MT (ACE_GUARD (ACE_Lock,
+ guard,
+ *this->profile_lock_ptr_));
+
+ TAO_MProfile *now_pfiles = this->forward_profiles_;
+ if (now_pfiles == 0)
+ now_pfiles = &this->base_profiles_;
+
+ ACE_NEW (this->forward_profiles_,
+ TAO_MProfile (mprofiles));
+
+ // forwarded profile points to the new IOR (profiles)
+ this->profile_in_use_->forward_to (this->forward_profiles_);
+
+ // new profile list points back to the list which was forwarded.
+ this->forward_profiles_->forward_from (now_pfiles);
+
+ // make sure we start at the beginning of mprofiles
+ this->forward_profiles_->rewind ();
+}
+
// Quick'n'dirty hash of objref data, for partitioning objrefs into
// sets.
//
@@ -809,14 +835,14 @@ TAO_Stub::get_client_policy (
POA_Messaging::RelativeRoundtripTimeoutPolicy*
TAO_Stub::relative_roundtrip_timeout (void)
{
- ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard,
- this->refcount_lock_,
- 0);
+ // No need to lock, the stub only changes its policies at
+ // construction time...
POA_Messaging::RelativeRoundtripTimeoutPolicy* result = 0;
if (this->policies_ != 0)
result = this->policies_->relative_roundtrip_timeout ();
+ // No need to lock, the object is in TSS storage....
if (result == 0)
{
TAO_Policy_Current &policy_current =
@@ -824,6 +850,9 @@ TAO_Stub::relative_roundtrip_timeout (void)
result = policy_current.relative_roundtrip_timeout ();
}
+ // @@ Must lock, but is is harder to implement than just modifying
+ // this call: the ORB does take a lock to modify the policy
+ // manager
if (result == 0)
{
TAO_Policy_Manager *policy_manager =
@@ -900,32 +929,7 @@ TAO_Stub::validate_connection (
return 0;
}
-void
-TAO_Stub::add_forward_profiles (const TAO_MProfile &mprofiles)
-{
- // we assume that the profile_in_use_ is being
- // forwarded! Grab the lock so things don't change.
- ACE_MT (ACE_GUARD (ACE_Lock,
- guard,
- *this->profile_lock_ptr_));
-
- TAO_MProfile *now_pfiles = this->forward_profiles_;
- if (now_pfiles == 0)
- now_pfiles = &this->base_profiles_;
-
- ACE_NEW (this->forward_profiles_,
- TAO_MProfile (mprofiles));
-
- // forwarded profile points to the new IOR (profiles)
- this->profile_in_use_->forward_to (this->forward_profiles_);
-
- // new profile list points back to the list which was forwarded.
- this->forward_profiles_->forward_from (now_pfiles);
-
- // make sure we start at the beginning of mprofiles
- this->forward_profiles_->rewind ();
-}
-
+#endif /* TAO_HAS_CORBA_MESSAGING */
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
@@ -938,5 +942,3 @@ template class ACE_Auto_Basic_Ptr<TAO_Policy_Manager_Impl>;
#pragma instantiate ACE_Auto_Basic_Ptr<TAO_Policy_Manager_Impl>
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
-
-#endif /* TAO_HAS_CORBA_MESSAGING */