summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-01-22 00:13:38 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-01-22 00:13:38 +0000
commitfe639ac1ea7d30756ec66a5a25e0edb8318191f4 (patch)
treeb441f89122a63889b073873beefa8e4ecf6a6f11
parent88b3d1ee6612d04014917a881d94b93cb803eb18 (diff)
downloadATCD-fe639ac1ea7d30756ec66a5a25e0edb8318191f4.tar.gz
*** empty log message ***
-rw-r--r--TAO/ChangeLog-98c73
-rw-r--r--TAO/docs/releasenotes/orbcore.html4
-rw-r--r--TAO/tests/POA/Explicit_Activation_POA_Ids/client.dsp4
-rw-r--r--TAO/tests/POA/Explicit_Activation_POA_Ids/server.cpp101
-rw-r--r--TAO/tests/POA/FindPOA/FindPOA.cpp120
-rw-r--r--TAO/tests/POA/FindPOA/FindPOA.dsp89
-rw-r--r--TAO/tests/POA/FindPOA/FindPOA.dsw29
-rw-r--r--TAO/tests/POA/NewPOA/NewPOA.cpp73
-rw-r--r--TAO/tests/POA/RootPOA/RootPOA.cpp13
-rw-r--r--TAO/tests/POA/RootPOA/RootPOA.dsp2
10 files changed, 482 insertions, 26 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c
index 66034530eb7..34d4c90b850 100644
--- a/TAO/ChangeLog-98c
+++ b/TAO/ChangeLog-98c
@@ -1,3 +1,76 @@
+Wed Jan 21 00:31:40 1998 Irfan Pyarali <irfan@cs.wustl.edu>
+
+ * tao/servant_base.cpp (_default_POA): Changed to use
+ TAO_ORB_Core_instance()->root_poa() instead of
+ TAO_ORB_Core_instance()->orb()->resolve_initial_references("RootPOA").
+
+ * tao/poaC: Added string_to_ObjectId and ObjectId_to_string
+ methods to PortableServer.
+
+ * tao/poa.cpp (TAO_Adapter_Activator::unknown_adapter): Changed
+ the implementation of this object so that it does not depend on
+ being friends with the POA and the POAManager. Initially, this
+ was done to avoid recursive locks. However, since user may want
+ to write their own implementations, recursive locks were deemed
+ necessary.
+
+ * tao/default_server.cpp (create_poa_lock): Changed implementation
+ to produce ACE_Recursive_Thread_Mutex instead of
+ ACE_Thread_Mutex.
+
+ * tests/POA/RootPOA/RootPOA.cpp (main) and
+ tests/POA/NewPOA/NewPOA.cpp (main): Added code to destroy the
+ rootPOA. I am not sure this is the responsibility of the user
+ to destroy the rootPOA since they never really created it. The
+ responsibility probably lies with the ORB, but since the spec
+ seems neutral about this, it is ok for now.
+
+ * tao/poa:
+
+ - Added support for transient and persistent POAs by changing
+ the ObjectKey. From now on, each key will contain an
+ identifier that will indicate whether the key came from a
+ persistent or transient POA. That way the dispatch method can
+ decide the value of the activate_it flag while finding the
+ POA. If the key is from a persistent POA, the activate_it
+ flag will be true, else the flag will be set to false.
+
+ - All operations on the parent POA will check for a valid parent
+ before executing the call. Remember that the RootPOA does not
+ have a parent POA.
+
+ - Temporarily added export macros to the POA implementation
+ classes, so that the implementations can directly be debugged
+ (rather than going through the stubs/skeletons). These should
+ be removed once the debugging process is over.
+
+ - Moved the registeration of the POA with its manager from the
+ create_POA method to the POA constructor. This is to insure
+ that the registration of the RootPOA is not "missed" since the
+ RootPOA is not created via the create_POA call. Similarly,
+ moved the removal of the POA from its manager from the destroy
+ method to the POA destructor.
+
+ - TAO_POA::delete_child and TAO_POA_Manager::remove_poa were
+ changed such that when the object is closing down, we are
+ currently iterating over our poa collection and there is not
+ need to remove the item from our collection.
+
+ - Changed use of substr from starting_at/ending_at to
+ starting_at/now_many.
+
+ - Methods that return duplicated values/objects, must first be
+ assigned to a _var variable before being used. This will
+ avoid memory leaks.
+
+ - For find methods, always use != -1 for success.
+
+ - Added code to create_POA_i and find_POA_i_optimized to check
+ when topmost_poa_name == this->name_.
+
+ * tao/object.i (CORBA_Object::Release): We must delete the object
+ when the parent_ refcount goes to zero.
+
Wed Jan 21 17:35:20 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
* TAO_IDL/be/be_visitor_interface.cpp:
diff --git a/TAO/docs/releasenotes/orbcore.html b/TAO/docs/releasenotes/orbcore.html
index bf393d789b3..310ffa474c0 100644
--- a/TAO/docs/releasenotes/orbcore.html
+++ b/TAO/docs/releasenotes/orbcore.html
@@ -393,6 +393,10 @@
<li>Compile and verify ACE and TAO on Linux using the Kuck and
Associates, Inc. (KAI) compiler tools.</li>
+ <LI>CORBA::TypeCode is causing a memory leak. Since objects
+ of this type are rather static in nature, this is
+ currently not a big deal. However, it should be fixed
+ soon. </LI>
</ol>
</li>
diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/client.dsp b/TAO/tests/POA/Explicit_Activation_POA_Ids/client.dsp
index 3a44ace0a59..9613c9e6436 100644
--- a/TAO/tests/POA/Explicit_Activation_POA_Ids/client.dsp
+++ b/TAO/tests/POA/Explicit_Activation_POA_Ids/client.dsp
@@ -89,5 +89,9 @@ SOURCE=.\client.cpp
SOURCE=.\FooC.cpp
# End Source File
+# Begin Source File
+
+SOURCE=.\FooS.cpp
+# End Source File
# End Target
# End Project
diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/server.cpp b/TAO/tests/POA/Explicit_Activation_POA_Ids/server.cpp
index 06d63c27d81..61d903ccb66 100644
--- a/TAO/tests/POA/Explicit_Activation_POA_Ids/server.cpp
+++ b/TAO/tests/POA/Explicit_Activation_POA_Ids/server.cpp
@@ -6,7 +6,7 @@ main (int argc, char **argv)
{
CORBA::Environment env;
- CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv, 0, env);
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, env);
if (env.exception () != 0)
{
env.print_exception ("CORBA::ORB_init");
@@ -15,38 +15,114 @@ main (int argc, char **argv)
CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA");
- PortableServer::POA_var rootPOA = PortableServer::POA::_narrow (obj, env);
+ PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj, env);
if (env.exception () != 0)
{
env.print_exception ("PortableServer::POA::_narrow");
return -1;
}
- MyFooServant afoo (rootPOA, 27);
- PortableServer::ObjectId_var oid = rootPOA->activate_object (&afoo, env);
+ PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::the_POAManager");
+ return -1;
+ }
+
+ // CORBA::PolicyList policies (1);
+ PortableServer::PolicyList policies (1);
+ policies.length (1);
+ policies[0] = root_poa->create_id_assignment_policy (PortableServer::USER_ID, env);
+
+ ACE_CString name = "firstPOA";
+ PortableServer::POA_var first_poa = root_poa->create_POA (name.c_str (),
+ poa_manager.in (),
+ policies,
+ env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::create_POA");
+ return -1;
+ }
+
+ MyFooServant first_foo_impl (root_poa, 27);
+ MyFooServant second_foo_impl (first_poa, 28);
+
+ PortableServer::ObjectId_var first_oid = root_poa->activate_object (&first_foo_impl, env);
if (env.exception () != 0)
{
env.print_exception ("PortableServer::POA::activate_object");
return -1;
}
- Foo_var foo = afoo._this (env);
+ Foo_var first_foo = first_foo_impl._this (env);
if (env.exception () != 0)
{
env.print_exception ("POA_Foo::_this");
return -1;
}
- CORBA::String_var ior = orb->object_to_string (foo, env);
+ PortableServer::ObjectId_var second_oid = PortableServer::string_to_ObjectId ("secondFoo");
+ first_poa->activate_object_with_id (second_oid.in (),
+ &second_foo_impl,
+ env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::activate_object_with_id");
+ return -1;
+ }
+
+ Foo_var second_foo = second_foo_impl._this (env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("POA_Foo::_this");
+ return -1;
+ }
+
+ PortableServer::ObjectId_var third_oid = PortableServer::string_to_ObjectId ("thirdFoo");
+ CORBA::Object_var third_foo = first_poa->create_reference_with_id (third_oid.in (), "IDL:Foo:1.0", env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::create_reference_with_id");
+ return -1;
+ }
+
+ CORBA::String_var first_ior = orb->object_to_string (first_foo, env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("CORBA::ORB::object_to_string");
+ return -1;
+ }
+
+ CORBA::String_var second_ior = orb->object_to_string (second_foo, env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("CORBA::ORB::object_to_string");
+ return -1;
+ }
+
+ CORBA::String_var third_ior = orb->object_to_string (third_foo, env);
if (env.exception () != 0)
{
env.print_exception ("CORBA::ORB::object_to_string");
return -1;
}
- cout << (char *) ior << endl;
+ cout << first_ior.in () << endl;
+ cout << second_ior.in () << endl;
+ cout << third_ior.in () << endl;
+
+ MyFooServant third_foo_impl (first_poa, 29);
+ first_poa->activate_object_with_id (third_oid.in (),
+ &third_foo_impl,
+ env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::activate_object_with_id");
+ return -1;
+ }
- rootPOA->the_POAManager (env)->activate (env);
+ poa_manager->activate (env);
if (env.exception () != 0)
{
env.print_exception ("PortableServer::POAManager::activate");
@@ -56,7 +132,14 @@ main (int argc, char **argv)
if (orb->run () == -1)
ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "CORBA::ORB::run"), -1);
- CORBA::release (orb);
+ root_poa->destroy (CORBA::B_TRUE,
+ CORBA::B_TRUE,
+ env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::destroy");
+ return -1;
+ }
return 0;
}
diff --git a/TAO/tests/POA/FindPOA/FindPOA.cpp b/TAO/tests/POA/FindPOA/FindPOA.cpp
new file mode 100644
index 00000000000..ba13eb26e66
--- /dev/null
+++ b/TAO/tests/POA/FindPOA/FindPOA.cpp
@@ -0,0 +1,120 @@
+#include "ace/streams.h"
+#include "tao/corba.h"
+
+int
+main (int argc, char **argv)
+{
+ CORBA::Environment env;
+
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("CORBA::ORB_init");
+ return -1;
+ }
+
+ CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA");
+
+ PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj, env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::_narrow");
+ return -1;
+ }
+
+ TAO_Adapter_Activator activator_impl;
+ PortableServer::AdapterActivator_var activator = activator_impl._this (env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("TAO_Adapter_Activator::_this");
+ return -1;
+ }
+
+ root_poa->the_activator (activator, env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::the_activator");
+ return -1;
+ }
+
+ ACE_CString name = "firstPOA";
+ PortableServer::POA_var first_poa = root_poa->find_POA (name.c_str (),
+ CORBA::B_TRUE,
+ env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::find_POA");
+ return -1;
+ }
+
+ name += TAO_POA::name_separator ();
+ name += "secondPOA";
+ PortableServer::POA_var second_poa = root_poa->find_POA (name.c_str (),
+ CORBA::B_TRUE,
+ env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::find_POA");
+ return -1;
+ }
+
+ name = "thirdPOA";
+ name += TAO_POA::name_separator ();
+ name += "forthPOA";
+ name += TAO_POA::name_separator ();
+ name += "fifthPOA";
+
+ PortableServer::POA_var fifth_poa = root_poa->find_POA (name.c_str (),
+ CORBA::B_TRUE,
+ env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::find_POA");
+ return -1;
+ }
+
+ CORBA::String_var root_poa_name = root_poa->the_name (env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::_narrow");
+ return -1;
+ }
+
+ CORBA::String_var first_poa_name = first_poa->the_name (env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::_narrow");
+ return -1;
+ }
+
+ CORBA::String_var second_poa_name = second_poa->the_name (env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::_narrow");
+ return -1;
+ }
+
+ CORBA::String_var fifth_poa_name = fifth_poa->the_name (env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::_narrow");
+ return -1;
+ }
+
+ cout << root_poa_name.in () << endl;
+ cout << first_poa_name.in () << endl;
+ cout << second_poa_name.in () << endl;
+ cout << fifth_poa_name.in () << endl;
+
+ // This should destroy all its children
+ root_poa->destroy (CORBA::B_TRUE,
+ CORBA::B_TRUE,
+ env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::destroy");
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/TAO/tests/POA/FindPOA/FindPOA.dsp b/TAO/tests/POA/FindPOA/FindPOA.dsp
new file mode 100644
index 00000000000..12667e200fb
--- /dev/null
+++ b/TAO/tests/POA/FindPOA/FindPOA.dsp
@@ -0,0 +1,89 @@
+# Microsoft Developer Studio Project File - Name="FindPOA" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=FindPOA - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "FindPOA.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "FindPOA.mak" CFG="FindPOA - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "FindPOA - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "FindPOA - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "FindPOA - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "FindPOA - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 tao.lib aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "FindPOA - Win32 Release"
+# Name "FindPOA - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\FindPOA.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/TAO/tests/POA/FindPOA/FindPOA.dsw b/TAO/tests/POA/FindPOA/FindPOA.dsw
new file mode 100644
index 00000000000..f63bde91efd
--- /dev/null
+++ b/TAO/tests/POA/FindPOA/FindPOA.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "FindPOA"=.\FindPOA.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/TAO/tests/POA/NewPOA/NewPOA.cpp b/TAO/tests/POA/NewPOA/NewPOA.cpp
index bb0dc10bd6c..c377fa741f2 100644
--- a/TAO/tests/POA/NewPOA/NewPOA.cpp
+++ b/TAO/tests/POA/NewPOA/NewPOA.cpp
@@ -15,7 +15,7 @@ main (int argc, char **argv)
CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA");
- PortableServer::POA_var rootPOA = PortableServer::POA::_narrow (obj, env);
+ PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj, env);
if (env.exception () != 0)
{
env.print_exception ("PortableServer::POA::_narrow");
@@ -24,15 +24,43 @@ main (int argc, char **argv)
// CORBA::PolicyList policies (2);
PortableServer::PolicyList policies (2);
-
- policies[0] = rootPOA->create_thread_policy (PortableServer::ORB_CTRL_MODEL, env);
- policies[1] = rootPOA->create_lifespan_policy (PortableServer::TRANSIENT, env);
policies.length (2);
+ policies[0] = root_poa->create_thread_policy (PortableServer::ORB_CTRL_MODEL, env);
+ policies[1] = root_poa->create_lifespan_policy (PortableServer::TRANSIENT, env);
- PortableServer::POA_ptr childPOA = rootPOA->create_POA ("my_little_poa",
- PortableServer::POAManager::_nil(),
- policies,
- env);
+ ACE_CString name = "firstPOA";
+ PortableServer::POA_var first_poa = root_poa->create_POA (name.c_str (),
+ PortableServer::POAManager::_nil(),
+ policies,
+ env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::create_POA");
+ return -1;
+ }
+
+ name += TAO_POA::name_separator ();
+ name += "secondPOA";
+ PortableServer::POA_var second_poa = root_poa->create_POA (name.c_str (),
+ PortableServer::POAManager::_nil(),
+ policies,
+ env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::create_POA");
+ return -1;
+ }
+
+ name = "thirdPOA";
+ name += TAO_POA::name_separator ();
+ name += "forthPOA";
+ name += TAO_POA::name_separator ();
+ name += "fifthPOA";
+
+ PortableServer::POA_var fifth_poa = root_poa->create_POA (name.c_str (),
+ PortableServer::POAManager::_nil(),
+ policies,
+ env);
if (env.exception () != 0)
{
env.print_exception ("PortableServer::POA::create_POA");
@@ -52,25 +80,42 @@ main (int argc, char **argv)
return -1;
}
- CORBA::String_var rootPOA_name = rootPOA->the_name (env);
+ CORBA::String_var root_poa_name = root_poa->the_name (env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::_narrow");
+ return -1;
+ }
+
+ CORBA::String_var first_poa_name = first_poa->the_name (env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::_narrow");
+ return -1;
+ }
+
+ CORBA::String_var second_poa_name = second_poa->the_name (env);
if (env.exception () != 0)
{
env.print_exception ("PortableServer::POA::_narrow");
return -1;
}
- CORBA::String_var childPOA_name = childPOA->the_name (env);
+ CORBA::String_var fifth_poa_name = fifth_poa->the_name (env);
if (env.exception () != 0)
{
env.print_exception ("PortableServer::POA::_narrow");
return -1;
}
- cout << rootPOA_name.in () << endl;
- cout << childPOA_name.in () << endl;
+ cout << root_poa_name.in () << endl;
+ cout << first_poa_name.in () << endl;
+ cout << second_poa_name.in () << endl;
+ cout << fifth_poa_name.in () << endl;
- childPOA->destroy (CORBA::B_TRUE,
- CORBA::B_TRUE,
+ // This should destroy all its children
+ root_poa->destroy (CORBA::B_TRUE,
+ CORBA::B_TRUE,
env);
if (env.exception () != 0)
{
diff --git a/TAO/tests/POA/RootPOA/RootPOA.cpp b/TAO/tests/POA/RootPOA/RootPOA.cpp
index 67c4073052b..89827656f91 100644
--- a/TAO/tests/POA/RootPOA/RootPOA.cpp
+++ b/TAO/tests/POA/RootPOA/RootPOA.cpp
@@ -15,14 +15,14 @@ main (int argc, char **argv)
CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA");
- PortableServer::POA_var rootPOA = PortableServer::POA::_narrow (obj, env);
+ PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj, env);
if (env.exception () != 0)
{
env.print_exception ("PortableServer::POA::_narrow");
return -1;
}
- CORBA::String_var poa_name = rootPOA->the_name (env);
+ CORBA::String_var poa_name = root_poa->the_name (env);
if (env.exception () != 0)
{
env.print_exception ("PortableServer::POA::_narrow");
@@ -31,5 +31,14 @@ main (int argc, char **argv)
cout << poa_name.in () << endl;
+ root_poa->destroy (CORBA::B_TRUE,
+ CORBA::B_TRUE,
+ env);
+ if (env.exception () != 0)
+ {
+ env.print_exception ("PortableServer::POA::destroy");
+ return -1;
+ }
+
return 0;
}
diff --git a/TAO/tests/POA/RootPOA/RootPOA.dsp b/TAO/tests/POA/RootPOA/RootPOA.dsp
index 0cd8df1f80d..d0bce707555 100644
--- a/TAO/tests/POA/RootPOA/RootPOA.dsp
+++ b/TAO/tests/POA/RootPOA/RootPOA.dsp
@@ -83,7 +83,7 @@ LINK32=link.exe
# Name "RootPOA - Win32 Debug"
# Begin Source File
-SOURCE=.\rootpoa.cpp
+SOURCE=.\RootPOA.cpp
# End Source File
# End Target
# End Project