summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Cleeland <chris.cleeland@gmail.com>1998-03-06 00:22:21 +0000
committerChris Cleeland <chris.cleeland@gmail.com>1998-03-06 00:22:21 +0000
commit2d9c1fbf091ce93a4b6c34688b3927bb2f1e1c6c (patch)
tree11977ce9c350e7b85fde30a15e9ab6f08b8d5dd9
parent82c1d0b62e1d5875b7d4957ca6dc92f9ac45d690 (diff)
downloadATCD-2d9c1fbf091ce93a4b6c34688b3927bb2f1e1c6c.tar.gz
* tao/giop.cpp: Removed crufty unused code.
* tao/iioporb.cpp: * tao/iiopobj.*: * tao/decode.cpp: * tao/object.{h,i}: * tao/orbobj.cpp: * tao/poaC.cpp: * tao/request.cpp: * tao/servant_base.{h,cpp}: Broke the old, incestous, bizarre "contained" relationship between IIOP_Object and CORBA_Object. Now, multiple CORBA_Objects can reference the same IIOP_Object, and each is reference-counted separately. Moreover, an IIOP_Object has no back-pointer to a CORBA_Object. All of this should help alleviate many memory leaks. * TAO_IDL/be/be_interface.cpp: Changed emitted code for _narrow and _bind to deal with new relationship btw. CORBA_Object and IIOP_Object.
-rw-r--r--TAO/ChangeLog-98c23
-rw-r--r--TAO/TAO_IDL/be/be_interface.cpp57
-rw-r--r--TAO/tao/decode.cpp10
-rw-r--r--TAO/tao/giop.cpp5
-rw-r--r--TAO/tao/iiopobj.cpp7
-rw-r--r--TAO/tao/iiopobj.h3
-rw-r--r--TAO/tao/iiopobj.i2
-rw-r--r--TAO/tao/iioporb.cpp13
-rw-r--r--TAO/tao/orbobj.cpp16
-rw-r--r--TAO/tao/poaC.cpp458
-rw-r--r--TAO/tao/request.cpp20
-rw-r--r--TAO/tao/servant_base.cpp8
-rw-r--r--TAO/tao/servant_base.h16
13 files changed, 247 insertions, 391 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c
index d8087f8a4eb..9d8d5819c6f 100644
--- a/TAO/ChangeLog-98c
+++ b/TAO/ChangeLog-98c
@@ -1,3 +1,26 @@
+Thu Mar 5 18:15:32 1998 Chris Cleeland <cleeland@cs.wustl.edu>
+
+ * tao/giop.cpp: Removed crufty unused code.
+
+ * tao/iioporb.cpp:
+ * tao/iiopobj.*:
+ * tao/decode.cpp:
+ * tao/object.{h,i}:
+ * tao/orbobj.cpp:
+ * tao/poaC.cpp:
+ * tao/request.cpp:
+ * tao/servant_base.{h,cpp}:
+ Broke the old, incestous, bizarre "contained" relationship between
+ IIOP_Object and CORBA_Object. Now, multiple CORBA_Objects can
+ reference the same IIOP_Object, and each is reference-counted
+ separately. Moreover, an IIOP_Object has no back-pointer to a
+ CORBA_Object. All of this should help alleviate many memory
+ leaks.
+
+ * TAO_IDL/be/be_interface.cpp: Changed emitted code for _narrow
+ and _bind to deal with new relationship btw. CORBA_Object and
+ IIOP_Object.
+
Thu Mar 5 17:45:28 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
* tao/cdr.i:
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp
index 80029bee8f8..3d56b79a064 100644
--- a/TAO/TAO_IDL/be/be_interface.cpp
+++ b/TAO/TAO_IDL/be/be_interface.cpp
@@ -536,28 +536,9 @@ be_interface::gen_client_stubs (void)
*cs << "if (!obj->_is_collocated () || !obj->_servant())" << be_nl
<< "{" << be_idt_nl;
- *cs << "STUB_Object *istub;" << nl;
- *cs << this->name () << "_ptr new_obj; // to be returned " << nl;
-#if 0 // XXXASG - I was told that emitting this line of code is the root cause
- // of all evil
- *cs << "obj->Release ();" <<
- " // need this since _is_a grabbed an obj reference " << nl;
-#endif
- *cs << "if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) " <<
- "!= TAO_NOERROR)\n";
- cs->incr_indent ();
- *cs << "return " << this->name () << "::_nil ();\n";
- cs->decr_indent ();
- *cs << nl;
-#if 0 // also the cause of all evil
- *cs << "obj->Release (); " <<
- "// need this since QueryIntf bumped our refcount" << nl;
-#endif
- *cs << "new_obj = new " << this->name () << " (istub); "
- << "// construct obj ref using the stub object" << nl;
- *cs << "return new_obj;\n";
- cs->decr_indent ();
- *cs << "} // end of if\n" << nl;
+ *cs << this->name () << "_ptr new_obj = new " << this->name () << "(obj->_get_parent ());" << be_nl
+ << "return new_obj;" << be_uidt_nl
+ << "} // end of if" << be_nl;
*cs << "STUB_Object *stub = obj->_servant ()->_create_stub (env);" << be_nl
<< "if (env.exception () != 0)" << be_idt_nl
@@ -581,27 +562,17 @@ be_interface::gen_client_stubs (void)
*cs << this->name () << "_ptr " << this->name () << "::_bind (" <<
"const char *host, CORBA::UShort port, const char *key, " <<
"CORBA::Environment &env)" << nl;
- *cs << "{\n";
- cs->incr_indent ();
- *cs << "CORBA::Object_ptr objref = CORBA::Object::_nil ();" << nl;
- *cs << "IIOP_Object *data = new IIOP_Object (host, port, key);" << nl;
- *cs << "if (!data) return " << this->name () << "::_nil ();" << nl;
- *cs << "// get the object_ptr using Query Interface" << nl;
- *cs <<
- "if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)"
- << nl;
- *cs << "{" << nl;
- *cs << "\tenv.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));"
- << nl;
- *cs << "\treturn " << this->name () << "::_nil ();" << nl;
- *cs << "}" << nl;
- *cs << "data->Release (); // QueryInterface had bumped up our count" << nl;
- *cs << "if (CORBA::is_nil (objref))" << nl;
- *cs << "\treturn " << this->name () << "::_nil ();" << nl;
- *cs << "else // narrow it" << nl;
- *cs << "\treturn " << this->name () << "::_narrow (objref, env);\n";
- cs->decr_indent ();
- *cs << "}\n\n";
+ *cs << "{" << be_idt_nl
+ << "IIOP_Object *data = new IIOP_Object (host, port, key);" << be_nl
+ << "if (!data) return " << this->name () << "::_nil ();" << be_nl
+ << "// create the CORBA level proxy" << be_nl
+ << "CORBA::Object_ptr objref = new CORBA_Object (data);" << be_nl
+ << "if (objref == 0)" << be_idt_nl << "{" << be_idt_nl
+ << "data->Release ();" << be_nl
+ << "env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));" << be_nl
+ << "return " << this->name () << "::_nil ();" << be_uidt_nl << "}" << be_uidt_nl
+ << "return " << this->name () << "::_narrow (objref, env);" << be_uidt_nl
+ << "}" << be_nl << be_nl;
// generate code for the elements of the interface
if (this->be_scope::gen_client_stubs () == -1)
diff --git a/TAO/tao/decode.cpp b/TAO/tao/decode.cpp
index 1f47acab9eb..f3d68f736d5 100644
--- a/TAO/tao/decode.cpp
+++ b/TAO/tao/decode.cpp
@@ -649,11 +649,13 @@ TAO_Marshal_ObjRef::decode (CORBA::TypeCode_ptr,
}
else
{
- // retrieve the CORBA::Object from the IIOP_Object we created before.
- if (objdata->QueryInterface (IID_CORBA_Object,
- (void **) data) != TAO_NOERROR)
+ // Create a new CORBA_Object and give it the IIOP_Object just
+ // created.
+ CORBA_Object *corba_proxy = new CORBA_Object (objdata);
+ if (corba_proxy)
+ *(CORBA_Object **)data = corba_proxy;
+ else
continue_decoding = CORBA::B_FALSE;
- objdata->Release ();
}
if (retval == CORBA::TypeCode::TRAVERSE_CONTINUE
&& continue_decoding == CORBA::B_TRUE)
diff --git a/TAO/tao/giop.cpp b/TAO/tao/giop.cpp
index bf847bd1fda..f27d8a73c06 100644
--- a/TAO/tao/giop.cpp
+++ b/TAO/tao/giop.cpp
@@ -607,11 +607,6 @@ TAO_GIOP_Invocation::start (CORBA::Environment &env)
assert (data_ != 0);
- CORBA::Object_ptr obj = 0;
-
- // Get a CORBA::Object_ptr from _data using <QueryInterface>.
- (void) this->data_->QueryInterface (IID_CORBA_Object, (void **) &obj);
-
// Get a pointer to the connector, which might be in thread-specific
// storage, depending on the concurrency model.
TAO_CONNECTOR *con = TAO_ORB_Core_instance ()->connector ();
diff --git a/TAO/tao/iiopobj.cpp b/TAO/tao/iiopobj.cpp
index bcbad669a92..46427878023 100644
--- a/TAO/tao/iiopobj.cpp
+++ b/TAO/tao/iiopobj.cpp
@@ -304,9 +304,6 @@ IIOP_Object::Release (void)
// STUB_OBJECT ... inherited by this one
// IIOP_OBJECT ... this one
//
-// CORBA::Object ... contained within this; it delegates back
-// to this one as its "parent"
-
TAO_HRESULT
IIOP_Object::QueryInterface (REFIID riid,
void **ppv)
@@ -317,8 +314,6 @@ IIOP_Object::QueryInterface (REFIID riid,
|| IID_STUB_Object == riid
|| IID_TAO_IUnknown == riid)
*ppv = this;
- else if (IID_CORBA_Object == riid)
- *ppv = &base;
if (*ppv == 0)
return ResultFromScode (TAO_E_NOINTERFACE);
@@ -348,7 +343,6 @@ IIOP_Object::IIOP_Object (const char *host,
char *repository_id)
: STUB_Object (repository_id),
profile (host, port, objkey),
- base (this),
refcount_ (1),
fwd_profile_ (0)
{
@@ -360,7 +354,6 @@ IIOP_Object::IIOP_Object (char *repository_id,
const char *objkey)
: STUB_Object (repository_id),
profile (addr, objkey),
- base (this),
refcount_ (1),
fwd_profile_ (0)
{
diff --git a/TAO/tao/iiopobj.h b/TAO/tao/iiopobj.h
index 79508ef2412..0495e2f040a 100644
--- a/TAO/tao/iiopobj.h
+++ b/TAO/tao/iiopobj.h
@@ -220,9 +220,6 @@ public:
// Profile for this object.
private:
- CORBA::Object base;
- // The actual CORBA object for this.
-
ACE_SYNCH_MUTEX IUnknown_lock_;
// Mutex to protect <IUnknown>-related stuff.
diff --git a/TAO/tao/iiopobj.i b/TAO/tao/iiopobj.i
index e867d769f09..e32a6b79747 100644
--- a/TAO/tao/iiopobj.i
+++ b/TAO/tao/iiopobj.i
@@ -42,7 +42,6 @@ IIOP_Object::~IIOP_Object (void)
ACE_INLINE
IIOP_Object::IIOP_Object (char *repository_id)
: STUB_Object (repository_id),
- base (this),
refcount_ (1),
fwd_profile_ (0)
{
@@ -53,7 +52,6 @@ IIOP_Object::IIOP_Object (char *repository_id,
const IIOP::Profile &a_profile)
: STUB_Object (repository_id),
profile (a_profile),
- base (this),
refcount_ (1),
fwd_profile_ (0)
{
diff --git a/TAO/tao/iioporb.cpp b/TAO/tao/iioporb.cpp
index 2d843ca7770..31ae1382080 100644
--- a/TAO/tao/iioporb.cpp
+++ b/TAO/tao/iioporb.cpp
@@ -262,12 +262,13 @@ iiop_string_to_object (CORBA::String string,
TAO_POA::decode_string_to_sequence (data->profile.object_key,
string);
- // Return the objref.
- CORBA::Object_ptr obj;
-
- (void) data->QueryInterface (IID_CORBA_Object,
- (void **) &obj);
- data->Release ();
+ // Create the CORBA level proxy.
+ CORBA_Object *obj = new CORBA_Object (data);
+
+ // Clean up in case of error
+ if (obj == 0)
+ data->Release ();
+
return obj;
}
diff --git a/TAO/tao/orbobj.cpp b/TAO/tao/orbobj.cpp
index ddc94fd63a4..0142ca298c8 100644
--- a/TAO/tao/orbobj.cpp
+++ b/TAO/tao/orbobj.cpp
@@ -499,17 +499,17 @@ CORBA_ORB::key_to_object (const TAO_ObjectKey &key,
return 0;
}
- // Return the CORBA::Object_ptr interface to this objref.
- CORBA::Object_ptr new_obj;
+ // Create the CORBA level proxy
+ CORBA_Object *new_obj = new CORBA_Object (data);
- if (data->QueryInterface (IID_CORBA_Object,
- (void **) &new_obj) != TAO_NOERROR)
- env.exception (new CORBA::INTERNAL (CORBA::COMPLETED_NO));
+ // Clean up in case of errors.
+ if (new_obj == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::INTERNAL (CORBA::COMPLETED_NO));
+ }
- data->Release ();
return new_obj;
-
- // return new CORBA::Object (data);
}
diff --git a/TAO/tao/poaC.cpp b/TAO/tao/poaC.cpp
index 32326180761..b0a8393565c 100644
--- a/TAO/tao/poaC.cpp
+++ b/TAO/tao/poaC.cpp
@@ -56,12 +56,8 @@ PortableServer::CurrentBase_ptr PortableServer::CurrentBase::_narrow (
return PortableServer::CurrentBase::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::CurrentBase_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::CurrentBase::_nil ();
-
- new_obj = new PortableServer::CurrentBase (istub); // construct obj ref using the stub object
+ PortableServer::CurrentBase_ptr new_obj =
+ new PortableServer::CurrentBase (obj->_get_parent ());
return new_obj;
} // end of if
@@ -77,20 +73,17 @@ PortableServer::CurrentBase_ptr PortableServer::CurrentBase::_narrow (
PortableServer::CurrentBase_ptr PortableServer::CurrentBase::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::CurrentBase::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::CurrentBase::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::CurrentBase::_nil ();
- else // narrow it
- return PortableServer::CurrentBase::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::CurrentBase::_nil ();
+ }
+ return PortableServer::CurrentBase::_narrow (objref, env);
}
CORBA::Boolean PortableServer::CurrentBase::_is_a (const CORBA::Char *value, CORBA::Environment &_tao_environment)
@@ -131,12 +124,7 @@ PortableServer::Policy_ptr PortableServer::Policy::_narrow (
return PortableServer::Policy::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::Policy_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::Policy::_nil ();
-
- new_obj = new PortableServer::Policy (istub); // construct obj ref using the stub object
+ PortableServer::Policy_ptr new_obj = new PortableServer::Policy (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -152,20 +140,16 @@ PortableServer::Policy_ptr PortableServer::Policy::_narrow (
PortableServer::Policy_ptr PortableServer::Policy::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
- if (!data) return PortableServer::Policy::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::Policy::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::Policy::_nil ();
- else // narrow it
- return PortableServer::Policy::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::Policy::_nil ();
+ }
+ return PortableServer::Policy::_narrow (objref, env);
}
static const TAO_Param_Data PortableServer_Policy_copy_paramdata [] =
@@ -380,12 +364,7 @@ PortableServer::ThreadPolicy_ptr PortableServer::ThreadPolicy::_narrow (
return PortableServer::ThreadPolicy::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::ThreadPolicy_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::ThreadPolicy::_nil ();
-
- new_obj = new PortableServer::ThreadPolicy (istub); // construct obj ref using the stub object
+ PortableServer::ThreadPolicy_ptr new_obj = new PortableServer::ThreadPolicy (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -401,20 +380,17 @@ PortableServer::ThreadPolicy_ptr PortableServer::ThreadPolicy::_narrow (
PortableServer::ThreadPolicy_ptr PortableServer::ThreadPolicy::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::ThreadPolicy::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::ThreadPolicy::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::ThreadPolicy::_nil ();
- else // narrow it
- return PortableServer::ThreadPolicy::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::ThreadPolicy::_nil ();
+ }
+ return PortableServer::ThreadPolicy::_narrow (objref, env);
}
static const TAO_Param_Data _get_PortableServer_ThreadPolicy_value_paramdata [] =
@@ -492,12 +468,7 @@ PortableServer::LifespanPolicy_ptr PortableServer::LifespanPolicy::_narrow (
return PortableServer::LifespanPolicy::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::LifespanPolicy_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::LifespanPolicy::_nil ();
-
- new_obj = new PortableServer::LifespanPolicy (istub); // construct obj ref using the stub object
+ PortableServer::LifespanPolicy_ptr new_obj = new PortableServer::LifespanPolicy (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -513,20 +484,17 @@ PortableServer::LifespanPolicy_ptr PortableServer::LifespanPolicy::_narrow (
PortableServer::LifespanPolicy_ptr PortableServer::LifespanPolicy::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::LifespanPolicy::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::LifespanPolicy::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::LifespanPolicy::_nil ();
- else // narrow it
- return PortableServer::LifespanPolicy::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::LifespanPolicy::_nil ();
+ }
+ return PortableServer::LifespanPolicy::_narrow (objref, env);
}
static const TAO_Param_Data _get_PortableServer_LifespanPolicy_value_paramdata [] =
@@ -604,12 +572,7 @@ PortableServer::IdUniquenessPolicy_ptr PortableServer::IdUniquenessPolicy::_narr
return PortableServer::IdUniquenessPolicy::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::IdUniquenessPolicy_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::IdUniquenessPolicy::_nil ();
-
- new_obj = new PortableServer::IdUniquenessPolicy (istub); // construct obj ref using the stub object
+ PortableServer::IdUniquenessPolicy_ptr new_obj = new PortableServer::IdUniquenessPolicy (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -625,20 +588,17 @@ PortableServer::IdUniquenessPolicy_ptr PortableServer::IdUniquenessPolicy::_narr
PortableServer::IdUniquenessPolicy_ptr PortableServer::IdUniquenessPolicy::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::IdUniquenessPolicy::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::IdUniquenessPolicy::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::IdUniquenessPolicy::_nil ();
- else // narrow it
- return PortableServer::IdUniquenessPolicy::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::IdUniquenessPolicy::_nil ();
+ }
+ return PortableServer::IdUniquenessPolicy::_narrow (objref, env);
}
static const TAO_Param_Data _get_PortableServer_IdUniquenessPolicy_value_paramdata [] =
@@ -716,12 +676,7 @@ PortableServer::IdAssignmentPolicy_ptr PortableServer::IdAssignmentPolicy::_narr
return PortableServer::IdAssignmentPolicy::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::IdAssignmentPolicy_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::IdAssignmentPolicy::_nil ();
-
- new_obj = new PortableServer::IdAssignmentPolicy (istub); // construct obj ref using the stub object
+ PortableServer::IdAssignmentPolicy_ptr new_obj = new PortableServer::IdAssignmentPolicy (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -737,20 +692,17 @@ PortableServer::IdAssignmentPolicy_ptr PortableServer::IdAssignmentPolicy::_narr
PortableServer::IdAssignmentPolicy_ptr PortableServer::IdAssignmentPolicy::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::IdAssignmentPolicy::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::IdAssignmentPolicy::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::IdAssignmentPolicy::_nil ();
- else // narrow it
- return PortableServer::IdAssignmentPolicy::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::IdAssignmentPolicy::_nil ();
+ }
+ return PortableServer::IdAssignmentPolicy::_narrow (objref, env);
}
static const TAO_Param_Data _get_PortableServer_IdAssignmentPolicy_value_paramdata [] =
@@ -828,12 +780,7 @@ PortableServer::ImplicitActivationPolicy_ptr PortableServer::ImplicitActivationP
return PortableServer::ImplicitActivationPolicy::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::ImplicitActivationPolicy_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::ImplicitActivationPolicy::_nil ();
-
- new_obj = new PortableServer::ImplicitActivationPolicy (istub); // construct obj ref using the stub object
+ PortableServer::ImplicitActivationPolicy_ptr new_obj = new PortableServer::ImplicitActivationPolicy (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -849,20 +796,17 @@ PortableServer::ImplicitActivationPolicy_ptr PortableServer::ImplicitActivationP
PortableServer::ImplicitActivationPolicy_ptr PortableServer::ImplicitActivationPolicy::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::ImplicitActivationPolicy::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::ImplicitActivationPolicy::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::ImplicitActivationPolicy::_nil ();
- else // narrow it
- return PortableServer::ImplicitActivationPolicy::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::ImplicitActivationPolicy::_nil ();
+ }
+ return PortableServer::ImplicitActivationPolicy::_narrow (objref, env);
}
static const TAO_Param_Data _get_PortableServer_ImplicitActivationPolicy_value_paramdata [] =
@@ -940,12 +884,7 @@ PortableServer::ServantRetentionPolicy_ptr PortableServer::ServantRetentionPolic
return PortableServer::ServantRetentionPolicy::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::ServantRetentionPolicy_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::ServantRetentionPolicy::_nil ();
-
- new_obj = new PortableServer::ServantRetentionPolicy (istub); // construct obj ref using the stub object
+ PortableServer::ServantRetentionPolicy_ptr new_obj = new PortableServer::ServantRetentionPolicy (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -961,20 +900,17 @@ PortableServer::ServantRetentionPolicy_ptr PortableServer::ServantRetentionPolic
PortableServer::ServantRetentionPolicy_ptr PortableServer::ServantRetentionPolicy::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::ServantRetentionPolicy::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::ServantRetentionPolicy::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::ServantRetentionPolicy::_nil ();
- else // narrow it
- return PortableServer::ServantRetentionPolicy::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::ServantRetentionPolicy::_nil ();
+ }
+ return PortableServer::ServantRetentionPolicy::_narrow (objref, env);
}
static const TAO_Param_Data _get_PortableServer_ServantRetentionPolicy_value_paramdata [] =
@@ -1053,12 +989,8 @@ PortableServer::RequestProcessingPolicy_ptr PortableServer::RequestProcessingPol
return PortableServer::RequestProcessingPolicy::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::RequestProcessingPolicy_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::RequestProcessingPolicy::_nil ();
-
- new_obj = new PortableServer::RequestProcessingPolicy (istub); // construct obj ref using the stub object
+ PortableServer::RequestProcessingPolicy_ptr
+ new_obj = new PortableServer::RequestProcessingPolicy (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -1074,20 +1006,17 @@ PortableServer::RequestProcessingPolicy_ptr PortableServer::RequestProcessingPol
PortableServer::RequestProcessingPolicy_ptr PortableServer::RequestProcessingPolicy::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::RequestProcessingPolicy::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::RequestProcessingPolicy::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::RequestProcessingPolicy::_nil ();
- else // narrow it
- return PortableServer::RequestProcessingPolicy::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::RequestProcessingPolicy::_nil ();
+ }
+ return PortableServer::RequestProcessingPolicy::_narrow (objref, env);
}
static const TAO_Param_Data _get_PortableServer_RequestProcessingPolicy_value_paramdata [] =
@@ -1152,12 +1081,8 @@ PortableServer::POAManager_ptr PortableServer::POAManager::_narrow (
return PortableServer::POAManager::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::POAManager_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::POAManager::_nil ();
-
- new_obj = new PortableServer::POAManager (istub); // construct obj ref using the stub object
+ PortableServer::POAManager_ptr
+ new_obj = new PortableServer::POAManager (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -1173,20 +1098,17 @@ PortableServer::POAManager_ptr PortableServer::POAManager::_narrow (
PortableServer::POAManager_ptr PortableServer::POAManager::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::POAManager::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::POAManager::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::POAManager::_nil ();
- else // narrow it
- return PortableServer::POAManager::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::POAManager::_nil ();
+ }
+ return PortableServer::POAManager::_narrow (objref, env);
}
// copy constructor
@@ -1357,12 +1279,8 @@ PortableServer::AdapterActivator_ptr PortableServer::AdapterActivator::_narrow (
return PortableServer::AdapterActivator::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::AdapterActivator_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::AdapterActivator::_nil ();
-
- new_obj = new PortableServer::AdapterActivator (istub); // construct obj ref using the stub object
+ PortableServer::AdapterActivator_ptr
+ new_obj = new PortableServer::AdapterActivator (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -1378,20 +1296,17 @@ PortableServer::AdapterActivator_ptr PortableServer::AdapterActivator::_narrow (
PortableServer::AdapterActivator_ptr PortableServer::AdapterActivator::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::AdapterActivator::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::AdapterActivator::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::AdapterActivator::_nil ();
- else // narrow it
- return PortableServer::AdapterActivator::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::AdapterActivator::_nil ();
+ }
+ return PortableServer::AdapterActivator::_narrow (objref, env);
}
static const TAO_Param_Data PortableServer_AdapterActivator_unknown_adapter_paramdata [] =
@@ -1459,12 +1374,8 @@ PortableServer::ServantManager_ptr PortableServer::ServantManager::_narrow (
return PortableServer::ServantManager::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::ServantManager_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::ServantManager::_nil ();
-
- new_obj = new PortableServer::ServantManager (istub); // construct obj ref using the stub object
+ PortableServer::ServantManager_ptr
+ new_obj = new PortableServer::ServantManager (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -1480,20 +1391,17 @@ PortableServer::ServantManager_ptr PortableServer::ServantManager::_narrow (
PortableServer::ServantManager_ptr PortableServer::ServantManager::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::ServantManager::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::ServantManager::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::ServantManager::_nil ();
- else // narrow it
- return PortableServer::ServantManager::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::ServantManager::_nil ();
+ }
+ return PortableServer::ServantManager::_narrow (objref, env);
}
CORBA::Boolean PortableServer::ServantManager::_is_a (const CORBA::Char *value, CORBA::Environment &_tao_environment)
@@ -1534,12 +1442,8 @@ PortableServer::ServantActivator_ptr PortableServer::ServantActivator::_narrow (
return PortableServer::ServantActivator::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::ServantActivator_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::ServantActivator::_nil ();
-
- new_obj = new PortableServer::ServantActivator (istub); // construct obj ref using the stub object
+ PortableServer::ServantActivator_ptr
+ new_obj = new PortableServer::ServantActivator (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -1555,20 +1459,17 @@ PortableServer::ServantActivator_ptr PortableServer::ServantActivator::_narrow (
PortableServer::ServantActivator_ptr PortableServer::ServantActivator::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::ServantActivator::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::ServantActivator::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::ServantActivator::_nil ();
- else // narrow it
- return PortableServer::ServantActivator::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::ServantActivator::_nil ();
+ }
+ return PortableServer::ServantActivator::_narrow (objref, env);
}
PortableServer::Servant PortableServer::ServantActivator::incarnate (const PortableServer::ObjectId &oid, PortableServer::POA_ptr adapter, CORBA::Environment &env)
@@ -1624,12 +1525,8 @@ PortableServer::ServantLocator_ptr PortableServer::ServantLocator::_narrow (
return PortableServer::ServantLocator::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::ServantLocator_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::ServantLocator::_nil ();
-
- new_obj = new PortableServer::ServantLocator (istub); // construct obj ref using the stub object
+ PortableServer::ServantLocator_ptr
+ new_obj = new PortableServer::ServantLocator (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -1645,20 +1542,17 @@ PortableServer::ServantLocator_ptr PortableServer::ServantLocator::_narrow (
PortableServer::ServantLocator_ptr PortableServer::ServantLocator::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::ServantLocator::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::ServantLocator::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::ServantLocator::_nil ();
- else // narrow it
- return PortableServer::ServantLocator::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::ServantLocator::_nil ();
+ }
+ return PortableServer::ServantLocator::_narrow (objref, env);
}
PortableServer::Servant PortableServer::ServantLocator::preinvoke (const PortableServer::ObjectId &oid, PortableServer::POA_ptr adapter, const char *operation, PortableServer::ServantLocator::Cookie & the_cookie, CORBA::Environment &env)
@@ -1714,12 +1608,8 @@ PortableServer::POA_ptr PortableServer::POA::_narrow (
return PortableServer::POA::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::POA_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::POA::_nil ();
-
- new_obj = new PortableServer::POA (istub); // construct obj ref using the stub object
+ PortableServer::POA_ptr
+ new_obj = new PortableServer::POA (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -1735,20 +1625,17 @@ PortableServer::POA_ptr PortableServer::POA::_narrow (
PortableServer::POA_ptr PortableServer::POA::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::POA::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::POA::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::POA::_nil ();
- else // narrow it
- return PortableServer::POA::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::POA::_nil ();
+ }
+ return PortableServer::POA::_narrow (objref, env);
}
// copy constructor
@@ -2775,12 +2662,8 @@ PortableServer::Current_ptr PortableServer::Current::_narrow (
return PortableServer::Current::_nil ();
if (!obj->_is_collocated () || !obj->_servant())
{
- STUB_Object *istub;
- PortableServer::Current_ptr new_obj; // to be returned
- if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) != TAO_NOERROR)
- return PortableServer::Current::_nil ();
-
- new_obj = new PortableServer::Current (istub); // construct obj ref using the stub object
+ PortableServer::Current_ptr
+ new_obj = new PortableServer::Current (obj->_get_parent ()); // construct obj ref using the stub object
return new_obj;
} // end of if
@@ -2796,20 +2679,17 @@ PortableServer::Current_ptr PortableServer::Current::_narrow (
PortableServer::Current_ptr PortableServer::Current::_bind (const char *host, CORBA::UShort port, const char *key, CORBA::Environment &env)
{
- CORBA::Object_ptr objref = CORBA::Object::_nil ();
IIOP_Object *data = new IIOP_Object (host, port, key);
if (!data) return PortableServer::Current::_nil ();
- // get the object_ptr using Query Interface
- if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)
- {
- env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return PortableServer::Current::_nil ();
- }
- data->Release (); // QueryInterface had bumped up our count
- if (CORBA::is_nil (objref))
- return PortableServer::Current::_nil ();
- else // narrow it
- return PortableServer::Current::_narrow (objref, env);
+ // create the CORBA level proxy
+ CORBA::Object_ptr objref = new CORBA_Object (data);
+ if (objref == 0)
+ {
+ data->Release ();
+ env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
+ return PortableServer::Current::_nil ();
+ }
+ return PortableServer::Current::_narrow (objref, env);
}
// copy constructor
diff --git a/TAO/tao/request.cpp b/TAO/tao/request.cpp
index 52518a6a844..24a44eabce2 100644
--- a/TAO/tao/request.cpp
+++ b/TAO/tao/request.cpp
@@ -92,14 +92,8 @@ CORBA_Request::~CORBA_Request (void)
void
CORBA_Request::invoke (void)
{
- STUB_Object *stub;
-
- if (target_->QueryInterface (IID_STUB_Object,
- (void **) &stub) != TAO_NOERROR)
- {
- env_.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return;
- }
+ STUB_Object *stub = this->target_->_get_parent ();
+ stub->AddRef ();
stub->do_dynamic_call ((char *) opname_,
CORBA::B_TRUE,
@@ -114,14 +108,8 @@ CORBA_Request::invoke (void)
void
CORBA_Request::send_oneway (void)
{
- STUB_Object *stub;
-
- if (target_->QueryInterface (IID_STUB_Object,
- (void **) &stub) != TAO_NOERROR)
- {
- env_.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));
- return;
- }
+ STUB_Object *stub = this->target_->_get_parent ();
+ stub->AddRef ();
stub->do_dynamic_call ((char *) opname_,
CORBA::B_TRUE,
diff --git a/TAO/tao/servant_base.cpp b/TAO/tao/servant_base.cpp
index 23a550c5ccf..4ec5eb52dea 100644
--- a/TAO/tao/servant_base.cpp
+++ b/TAO/tao/servant_base.cpp
@@ -4,8 +4,10 @@
#include "tao/corba.h"
TAO_ServantBase::TAO_ServantBase (void)
- : optable_ (0),
- parent_ (0)
+ : optable_ (0)
+#if 0
+ , parent_ (0)
+#endif
{
}
@@ -45,6 +47,7 @@ TAO_ServantBase::_is_a (const char* logical_type_id,
return CORBA::B_FALSE;
}
+#if 0
void
TAO_ServantBase::_set_parent (TAO_IUnknown *p)
{
@@ -57,6 +60,7 @@ TAO_ServantBase::_get_parent (void) const
{
return this->parent_;
}
+#endif
int
TAO_ServantBase::_find (const CORBA::String &opname,
diff --git a/TAO/tao/servant_base.h b/TAO/tao/servant_base.h
index 4efae8dcc01..4471dab5d95 100644
--- a/TAO/tao/servant_base.h
+++ b/TAO/tao/servant_base.h
@@ -38,11 +38,6 @@ protected:
TAO_ServantBase (const TAO_ServantBase &);
// Copy constructor, protected so no instances can be created.
- void _set_parent (TAO_IUnknown *p);
- // Set the "parent" in the QueryInterface hierarchy.
- // @@ TODO use a conformant name; since it is an
- // internal (implementation) method its name should start with '_'
-
virtual CORBA::Boolean _is_a (const char* logical_type_id,
CORBA::Environment &env);
// Local implementation of the CORBA::Object::_is_a method.
@@ -70,9 +65,16 @@ protected:
// @@ TODO use a conformant name; since it is an
// internal (implementation) method its name should start with '_'
+#if 0
+ void _set_parent (TAO_IUnknown *p);
+ // Set the "parent" in the QueryInterface hierarchy.
+ // @@ TODO use a conformant name; since it is an
+ // internal (implementation) method its name should start with '_'
+
TAO_IUnknown *_get_parent (void) const;
// Get the "parent" in the QueryInterface hierarchy.
-
+#endif
+
virtual const char *_interface_repository_id (void) const = 0;
// Get this interface's repository id
@@ -81,8 +83,10 @@ protected:
// The operation table for this servant, it is initialized by the
// most derived class.
+#if 0
TAO_IUnknown *parent_;
// @@ TODO find out why is this here....
+#endif
};
class TAO_Export TAO_Local_ServantBase : public TAO_ServantBase