diff options
author | naga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-30 04:23:10 +0000 |
---|---|---|
committer | naga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-30 04:23:10 +0000 |
commit | 0386d0f2fb5c635b707a879e114ecf93ad24928d (patch) | |
tree | 319e85073283e8c6924e9992dce8cc2a8178de60 | |
parent | 1a508502e91a3c1e408cfc0f4c64d94b24be56c9 (diff) | |
download | ATCD-0386d0f2fb5c635b707a879e114ecf93ad24928d.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/tests/POA/Default_Servant/server.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/TAO/tests/POA/Default_Servant/server.cpp b/TAO/tests/POA/Default_Servant/server.cpp index d98b58280d0..d91b7ccdbdf 100644 --- a/TAO/tests/POA/Default_Servant/server.cpp +++ b/TAO/tests/POA/Default_Servant/server.cpp @@ -1,3 +1,21 @@ +// $Id$ +// +//=================================================================== +// = LIBRARY +// TAO/tests/POA/Default_Servant/server +// +// = FILENAME +// server.cpp +// +// = DESCRIPTION +// A server program for the File IDL module +// +// = AUTHOR +// Irfan Pyarali +// +//==================================================================== + + #include "ace/streams.h" #include "File_i.h" @@ -6,6 +24,7 @@ main (int argc, char **argv) { CORBA::Environment env; + // Initialize the ORB CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, env); if (env.exception () != 0) { @@ -13,8 +32,10 @@ main (int argc, char **argv) return -1; } + // Get the Root POA object reference CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); + // Narrow the object reference to a POA reference PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in (), env); if (env.exception () != 0) { @@ -67,6 +88,7 @@ main (int argc, char **argv) return -1; } + // Create a File System Implementation object in first_poa FileImpl::System file_system_impl (first_poa.in ()); PortableServer::ObjectId_var file_system_oid = @@ -88,7 +110,7 @@ main (int argc, char **argv) env.print_exception ("PortableServer::POA::id_to_reference"); return -1; } - + // Get the IOR for the "FileSystem" object CORBA::String_var file_system_ior = orb->object_to_string (file_system.in (), env); if (env.exception () != 0) @@ -97,8 +119,10 @@ main (int argc, char **argv) return -1; } - cout << file_system_ior.in () << endl; + ACE_DEBUG((LM_DEBUG,"%s\n", + file_system_ior.in ())); + // set the state of the poa_manager to active i.e ready to process requests poa_manager->activate (env); if (env.exception () != 0) { @@ -106,9 +130,11 @@ main (int argc, char **argv) return -1; } + // Run the ORB if (orb->run () == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "CORBA::ORB::run"), -1); + // Destroy the rootPOA and its children root_poa->destroy (CORBA::B_TRUE, CORBA::B_TRUE, env); @@ -120,3 +146,5 @@ main (int argc, char **argv) return 0; } + + |