diff options
Diffstat (limited to 'TAO/orbsvcs/tests/ImplRepo')
23 files changed, 0 insertions, 2447 deletions
diff --git a/TAO/orbsvcs/tests/ImplRepo/ImplRepoTest.dsw b/TAO/orbsvcs/tests/ImplRepo/ImplRepoTest.dsw deleted file mode 100644 index 45dc287187d..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/ImplRepoTest.dsw +++ /dev/null @@ -1,53 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "ImplRepoTest Client"=.\client.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "ImplRepoTest ImplRepo"=.\implrepo.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "ImplRepoTest Server"=.\server.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/TAO/orbsvcs/tests/ImplRepo/Impl_Repo.idl b/TAO/orbsvcs/tests/ImplRepo/Impl_Repo.idl deleted file mode 100644 index 88cb24d07e0..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/Impl_Repo.idl +++ /dev/null @@ -1,133 +0,0 @@ -// $Id$ - -#include "simple_object.idl" - -interface Ping_Object -{ - oneway void ping (); - // Used for checking for liveness of a server. When the server receives - // this, it should send back a response indicating it is sill alive. - // Depending on the policy specified, a timeout can be reached where the - // Implementation Repository will restart the server. -}; - -interface Implementation_Repository - // = TITLE - // Interface for communicating with the Implementation Repository - // - // = DESCRIPTION - // This interface exports all the administration functionality of - // the Implementation Repository. -{ - exception Already_Registered {}; - // Object already bound in the Implementation Repository - - exception Cannot_Activate - { - string reason_; - }; - - exception Not_Found {}; - // Object not found in the Implementation Repository - - struct Environment_Variable - { - string name_; - string value_; - }; - // One environment variable - - struct INET_Addr - { - unsigned short port_; - unsigned long host_; - }; - // The location of a server - - typedef sequence<Environment_Variable> Environment; - // Complete environment - - typedef sequence<string> Command_Line_Options; - // Command line options - - struct Process_Options - { - string executable_name_; - // Executable name - Command_Line_Options command_line_options_; - // Command line options - Environment environment_; - // Environment - string working_directory_; - // Working directory - unsigned long creation_flags_; - // Creation flags - }; - -// Object activate_object (in Object obj) -// raises (Not_Found, -// Cannot_Activate); - // Restart server that will contain this persistent object and return the - // new Object reference. - // - // The <Not_Found> exception is raised when <obj> is not found - // in the Implementation Repository. The <Cannot_Activate> exception - // is raised when <obj> is found in the Repository but could not be - // activated. - -// INET_Addr activate_server (in string server) -// raises (Not_Found, -// Cannot_Activate); - // Restart server that is named <server> and return the host/port - // - // The <Not_Found> exception is raised when <server> is not found - // in the Implementation Repository. The <Cannot_Activate> exception - // is raised when <server> is found in the Repository but could not be - // activated. - - - //void register_server (in string server, - // in Process_Options options) - // raises (Already_Registered); - // Restart server process when client is looking for <server>. - // - // The <Already_Registered> exception is raised when <server> has - // already been registered with the Implementation Repository. - // - // The <Object_Not_Persistent> exception is raised when <server> is - // not a Persistent Object Reference. - -// void reregister_server (in string server, -// in Process_Options options) -// raises (Already_Registered); - // Restart server process when client is looking for <server>. - // - // The <Already_Registered> exception is raised when <server> has - // already been registered with the Implementation Repository. - // - // The <Object_Not_Persistent> exception is raised when <server> is - // not a Persistent Object Reference. - - -// void remove_server (in string server) -// raises (Not_Found); - // Remove <server> from the Implementation Repository. - // - // The <Not_Found> exception is raised when <server> is not found - // in the Implementation Repository. - -// Profile server_is_running (in string server, -// void server_is_running (in string server, -// in INET_Addr addr, -// in Ping_Object ping); - void server_is_running (in string server, - inout Object obj, - in INET_Addr addr); - - // Used to notify the Implementation Repository that <server> is alive and - // well at <addr>. - -// void server_is_shutting_down (in string server); - // Used to tell the Implementation Repository that <server> is shutting - // down. -}; diff --git a/TAO/orbsvcs/tests/ImplRepo/README b/TAO/orbsvcs/tests/ImplRepo/README deleted file mode 100644 index d1b16ebf92e..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/README +++ /dev/null @@ -1,9 +0,0 @@ -$Id$ - -In short, stay away for now. This is all work in progress and really -rough around the edges. - -More information about the Implementation Repository can be found in -TAO/docs. - --Darrell Brunsch <brunsch@cs.wustl.edu>
\ No newline at end of file diff --git a/TAO/orbsvcs/tests/ImplRepo/Simple_Object.idl b/TAO/orbsvcs/tests/ImplRepo/Simple_Object.idl deleted file mode 100644 index 34fffdef395..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/Simple_Object.idl +++ /dev/null @@ -1,16 +0,0 @@ -// $Id$ - -interface simple_object - // = TITLE - // Defines an interface that encapsulates operations that cube - // numbers. - // - // = DESCRIPTION - // This interface encapsulates an operation that cubes a long. -{ - long simple_method (in long l); - // cube a long - - void shutdown (); - // shutdown the application. -}; diff --git a/TAO/orbsvcs/tests/ImplRepo/client.cpp b/TAO/orbsvcs/tests/ImplRepo/client.cpp deleted file mode 100644 index b0bb4f77765..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/client.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ - -#include "client_impl.h" - -ACE_RCSID(ImplRepo, client, "$Id$") - -// This function runs the test. - -int -main (int argc, char **argv) -{ - Client_i client; - - ACE_DEBUG ((LM_DEBUG, - "\n\tSimple_Client\n\n")); - - if (client.init (argc, argv) == -1) - return 1; - else - return client.run (); -} - diff --git a/TAO/orbsvcs/tests/ImplRepo/client.dsp b/TAO/orbsvcs/tests/ImplRepo/client.dsp deleted file mode 100644 index f451152652e..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/client.dsp +++ /dev/null @@ -1,203 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ImplRepoTest Client" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=ImplRepoTest Client - Win32 Release
-!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 "client.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 "client.mak" CFG="ImplRepoTest Client - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ImplRepoTest Client - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "ImplRepoTest Client - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "ImplRepoTest Client - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir ".\client\Release"
-# PROP BASE Intermediate_Dir ".\client\Release"
-# PROP BASE Target_Dir ".\client"
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ".\Release"
-# PROP Intermediate_Dir ".\Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ".\client"
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\\" /I "..\..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
-# SUBTRACT CPP /YX
-# 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 ace.lib TAO.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
-
-!ELSEIF "$(CFG)" == "ImplRepoTest Client - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ".\client\Debug"
-# PROP BASE Intermediate_Dir ".\client\Debug"
-# PROP BASE Target_Dir ".\client"
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
-# PROP Intermediate_Dir ".\Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ".\client"
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\\" /I "..\..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
-# SUBTRACT CPP /YX
-# 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
-# ADD LINK32 aced.lib TAOd.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "ImplRepoTest Client - Win32 Release"
-# Name "ImplRepoTest Client - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\client.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\client_impl.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Simple_ObjectC.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Simple_ObjectS.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
-# Begin Source File
-
-SOURCE=.\client_impl.h
-# End Source File
-# End Group
-# Begin Group "IDL Files"
-
-# PROP Default_Filter ".idl"
-# Begin Source File
-
-SOURCE=.\Simple_Object.idl
-
-!IF "$(CFG)" == "ImplRepoTest Client - Win32 Release"
-
-USERDEP__SIMPL="..\..\..\..\bin\Release\tao_idl.exe"
-# Begin Custom Build - Invoking TAO_IDL Compiler
-InputPath=.\Simple_Object.idl
-InputName=Simple_Object
-
-BuildCmds= \
- tao_idl $(InputName).idl
-
-"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ImplRepoTest Client - Win32 Debug"
-
-USERDEP__SIMPL="..\..\..\..\bin\tao_idl.exe"
-# Begin Custom Build - Invoking TAO_IDL Compiler
-InputPath=.\Simple_Object.idl
-InputName=Simple_Object
-
-BuildCmds= \
- tao_idl $(InputName).idl
-
-"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/TAO/orbsvcs/tests/ImplRepo/client_impl.cpp b/TAO/orbsvcs/tests/ImplRepo/client_impl.cpp deleted file mode 100644 index 4822865a12f..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/client_impl.cpp +++ /dev/null @@ -1,197 +0,0 @@ -// $Id$ - -#include "client_impl.h" -#include "ace/Get_Opt.h" -#include "ace/Read_Buffer.h" - -ACE_RCSID(ImplRepo, client_impl, "$Id$") - -// Constructor. -Client_i::Client_i (void) - : server_key_ (ACE_OS::strdup ("key0")), - loop_count_ (10), - shutdown_ (0), - server_ (simple_object::_nil ()) -{ -} - -// Reads the Server factory ior from a file - -int -Client_i::read_ior (char *filename) -{ - // Open the file for reading. - ACE_HANDLE f_handle_ = ACE_OS::open (filename, 0); - - if (f_handle_ == ACE_INVALID_HANDLE) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to open %s for writing: %p\n", - filename), - -1); - ACE_Read_Buffer ior_buffer (f_handle_); - this->server_key_ = ior_buffer.read (); - - if (this->server_key_ == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to allocate memory to read ior: %p\n"), - -1); - - ACE_OS::close (f_handle_); - return 0; -} - -// Parses the command line arguments and returns an error status. - -int -Client_i::parse_args (void) -{ - ACE_Get_Opt get_opts (argc_, argv_, "dn:f:x"); - int c; - int result; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'd': // debug flag - TAO_debug_level++; - break; - case 'n': // loop count - this->loop_count_ = (u_int) ACE_OS::atoi (get_opts.optarg); - break; - case 'f': // read the IOR from the file. - result = this->read_ior (get_opts.optarg); - if (result < 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to read ior from %s : %p\n", - get_opts.optarg), - -1); - break; - case 'x': - this->shutdown_ = 1; - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s" - " [-d]" - " [-n loopcount]" - " [-f server-obj-ref-key-file]" - " [-x]" - "\n", - this->argv_ [0]), - -1); - } - - // Indicates successful parsing of command line. - return 0; -} - -// calculate the cube from a long - -void -Client_i::cube_long (int i) -{ - // Cube a long. - CORBA::Long ret_long; - ACE_OS::sleep (2); - ret_long = this->server_->simple_method (i, this->env_); - //this->server_->shutdown (this->env_); - //ACE_OS::sleep (2); - -// ACE_DEBUG ((LM_DEBUG, "FOO!!! %d\n", i)); - ACE_DEBUG ((LM_DEBUG, "The cube of %d is %d\n", i, ret_long)); - - if (this->env_.exception () != 0) - { - this->env_.print_exception ("from cube_long"); - } - else - { - CORBA::Long arg_long = i * i * i; - - if (arg_long != ret_long) - { - ACE_ERROR ((LM_ERROR, - "** cube_long (%ld) ERROR (--> %ld)\n", - ret_long, - arg_long)); - } - } -} - - -// Execute client example code. - -int -Client_i::run () -{ - u_int i; - - for (i = 1; i <= this->loop_count_; i++) - this->cube_long (i); - - if (this->shutdown_) - this->server_->shutdown (this->env_); - - return 0; -} - -Client_i::~Client_i (void) -{ - // Free resources - // Close the ior files - CORBA::release (this->server_); - - if (this->server_key_ != 0) - ACE_OS::free (this->server_key_); -} - - -int -Client_i::init (int argc, char **argv) -{ - this->argc_ = argc; - this->argv_ = argv; - - TAO_TRY - { - // Retrieve the ORB. - this->orb_ = CORBA::ORB_init (this->argc_, - this->argv_, - "internet", - TAO_TRY_ENV); - TAO_CHECK_ENV; - - // Parse command line and verify parameters. - if (this->parse_args () == -1) - return -1; - - if (this->server_key_ == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "%s: no server key specified\n", - this->argv_[0]), - -1); - - - CORBA::Object_var server_object = - this->orb_->string_to_object (this->server_key_, TAO_TRY_ENV); - TAO_CHECK_ENV; - - this->server_ = simple_object::_narrow (server_object.in(), TAO_TRY_ENV); - TAO_CHECK_ENV; - - if (CORBA::is_nil (server_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "invalid server key <%s>\n", - this->server_key_), - -1); - } - TAO_CATCHANY - { - TAO_TRY_ENV.print_exception ("Client_i::init"); - return -1; - } - TAO_ENDTRY; - - return 0; -} diff --git a/TAO/orbsvcs/tests/ImplRepo/client_impl.h b/TAO/orbsvcs/tests/ImplRepo/client_impl.h deleted file mode 100644 index cd207856036..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/client_impl.h +++ /dev/null @@ -1,75 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Simple -// -// = FILENAME -// client_impl.h -// -// = DESCRIPTION -// This class implements a simple CORBA client. -// -// = AUTHORS -// Darrell Brunsch <brunsch@cs.wustl.edu> -// -// ============================================================================ - -#include "Simple_ObjectC.h" -#include "tao/corba.h" - -class Client_i -{ - // = TITLE - // Simple Client Implementation - // - // = DESCRIPTION - // Class wrapper for a client which gets the server IOR and then makes - // several calls to the server before optionally shutting it down. -public: - // = Constructor and destructor. - Client_i (void); - ~Client_i (void); - - int run (); - // Execute client example code. - - int init (int argc, char **argv); - // Initialize the client communication endpoint with server. - -private: - int read_ior (char *filename); - // Function to read the server ior from a file. - - int parse_args (void); - // Parses the arguments passed on the command line. - - void cube_long (int i); - // calculate the cube from a long. - - int argc_; - // # of arguments on the command line. - - char **argv_; - // arguments from command line. - - char *server_key_; - // Key of the obj ref of the server. - - u_int loop_count_; - // Number of times to do the cube operations. - - int shutdown_; - // Flag for server shutdown. - - CORBA::Environment env_; - // Environment variable. - - simple_object_ptr server_; - // Server object ptr. - - CORBA::ORB_var orb_; - // Remember our orb. -}; diff --git a/TAO/orbsvcs/tests/ImplRepo/implrepo.dsp b/TAO/orbsvcs/tests/ImplRepo/implrepo.dsp deleted file mode 100644 index e8b5f3fbc7d..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/implrepo.dsp +++ /dev/null @@ -1,212 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ImplRepoTest ImplRepo" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=ImplRepoTest ImplRepo - Win32 Release
-!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 "implrepo.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 "implrepo.mak" CFG="ImplRepoTest ImplRepo - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ImplRepoTest ImplRepo - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "ImplRepoTest ImplRepo - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "ImplRepoTest ImplRepo - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir ".\implrepo\Release"
-# PROP BASE Intermediate_Dir ".\implrepo\Release"
-# PROP BASE Target_Dir ".\implrepo"
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ".\Release"
-# PROP Intermediate_Dir ".\Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ".\server"
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\\" /I "..\..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
-# SUBTRACT CPP /YX
-# 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 ace.lib TAO.lib /nologo /subsystem:console /machine:I386 /out:"Impl_Repo.exe" /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
-
-!ELSEIF "$(CFG)" == "ImplRepoTest ImplRepo - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ".\implrepo\Debug"
-# PROP BASE Intermediate_Dir ".\implrepo\Debug"
-# PROP BASE Target_Dir ".\implrepo"
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
-# PROP Intermediate_Dir ".\Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ".\server"
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\\" /I "..\..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
-# SUBTRACT CPP /YX
-# 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
-# ADD LINK32 aced.lib TAOd.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"Impl_Repo.exe" /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
-# SUBTRACT LINK32 /profile
-
-!ENDIF
-
-# Begin Target
-
-# Name "ImplRepoTest ImplRepo - Win32 Release"
-# Name "ImplRepoTest ImplRepo - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\Impl_RepoC.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Impl_RepoS.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ir_implrepo_impl.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ir_server.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Simple_ObjectC.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Simple_ObjectS.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
-# Begin Source File
-
-SOURCE=.\ir_implrepo_impl.h
-# End Source File
-# End Group
-# Begin Group "IDL Files"
-
-# PROP Default_Filter ".idl"
-# Begin Source File
-
-SOURCE=.\Impl_Repo.idl
-
-!IF "$(CFG)" == "ImplRepoTest ImplRepo - Win32 Release"
-
-USERDEP__IMPL_="..\..\..\..\bin\Release\tao_idl.exe"
-# Begin Custom Build - Invoking TAO_IDL Compiler
-InputPath=.\Impl_Repo.idl
-InputName=Impl_Repo
-
-BuildCmds= \
- tao_idl $(InputName).idl
-
-"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ImplRepoTest ImplRepo - Win32 Debug"
-
-USERDEP__IMPL_="..\..\..\..\bin\tao_idl.exe"
-# Begin Custom Build - Invoking TAO_IDL Compiler
-InputPath=.\Impl_Repo.idl
-InputName=Impl_Repo
-
-BuildCmds= \
- tao_idl $(InputName).idl
-
-"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/TAO/orbsvcs/tests/ImplRepo/ir_implrepo_impl.cpp b/TAO/orbsvcs/tests/ImplRepo/ir_implrepo_impl.cpp deleted file mode 100644 index 193a3c97be3..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/ir_implrepo_impl.cpp +++ /dev/null @@ -1,344 +0,0 @@ -// $Id$ - -#include "ir_implrepo_impl.h" -#include "ace/Get_Opt.h" -#include "ace/Read_Buffer.h" -#include "ace/Process.h" - -ACE_RCSID(ImplRepo, ir_implrepo_impl, "$Id$") - -IR_iRepo_i::IR_iRepo_i (void) - : ior_output_file_ (0), - server_key_ (0), - server_impl_ (0) -{ -} - -void IR_iRepo_i::start (const char *server) -{ - if (ACE_OS::strcmp (server, "Simple_Server") == 0) - { - ACE_DEBUG ((LM_DEBUG, "Starting Simple_Server!\n")); - ACE_Process_Options proc_opts; - - proc_opts.command_line ("server -o server.ior"); - - ACE_Process proc; - - proc.spawn (proc_opts); - - ACE_OS::sleep (2); - } -} - -void IR_iRepo_i::server_is_running (const char *server, - CORBA::Object_ptr &obj, - const Implementation_Repository::INET_Addr &addr, - CORBA::Environment &_tao_environment) -{ - ACE_DEBUG ((LM_DEBUG, "Server is running!\n")); -// int result = this->read_ior (this->server_input_file_); -// if (result < 0) -// { -// ACE_ERROR ((LM_ERROR, -// "Unable to read ior from %s : %p\n", -// this->server_input_file_)); -// return; -// } -// CORBA::Object_var server_object = -// this->orb_manager_.orb ()->string_to_object (this->server_key_, _tao_environment); - this->server_impl_->forward_to (obj); -} - - -// Reads the Server factory ior from a file - -int -IR_iRepo_i::read_ior (char *filename) -{ - // Open the file for reading. - ACE_HANDLE f_handle_ = ACE_OS::open (filename, 0); - - if (f_handle_ == ACE_INVALID_HANDLE) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to open %s for writing: %p\n", - filename), - -1); - ACE_Read_Buffer ior_buffer (f_handle_); - this->server_key_ = ior_buffer.read (); - - if (this->server_key_ == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to allocate memory to read ior: %p\n"), - -1); - - ACE_OS::close (f_handle_); - return 0; -} - -int -IR_iRepo_i::parse_args (void) -{ - ACE_Get_Opt get_opts (this->argc_, this->argv_, "df:o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'd': // debug flag. - TAO_debug_level++; - break; - case 'o': // output the IOR to a file. - this->ior_output_file_ = ACE_OS::fopen (get_opts.optarg, "w"); - if (this->ior_output_file_ == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to open %s for writing: %p\n", - get_opts.optarg), -1); - break; - case 'f': // read the IOR from the file. - this->server_input_file_ = ACE::strnew (get_opts.optarg); - break; - case '?': // display help for use of the server. - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s" - " [-d]" - " [-f] <server_ior_file>" - " [-o] <ior_output_file>" - "\n", - argv_ [0]), - 1); - } - - // Indicates successful parsing of command line. - return 0; -} - -int -IR_iRepo_i::init (int argc, char** argv, CORBA::Environment& env) -{ - // Call the init of <TAO_ORB_Manager> to initialize the ORB and - // create a child POA under the root POA. - if (this->orb_manager_.init_child_poa (argc, argv, "child_poa", env) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "init_child_poa"), -1); - - TAO_CHECK_ENV_RETURN (env, -1); - - this->argc_ = argc; - this->argv_ = argv; - - int retval = this->parse_args (); - - if (retval != 0) - return retval; - - this->server_impl_ = new IR_Simple_i (this->orb_manager_.orb (), - this->orb_manager_.child_poa (), - this); - - CORBA::String_var str = - this->orb_manager_.activate_under_child_poa ("server", - this->server_impl_, - env); - - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "The server IOR is: <%s>\n", str.in ())); - - if (this->ior_output_file_) - { - ACE_OS::fprintf (this->ior_output_file_, "%s", str.in ()); - ACE_OS::fclose (this->ior_output_file_); - } - - CORBA::String_var ir_var = - this->orb_manager_.activate_under_child_poa ("implrepo", - this, - env); - - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "The IR IOR is: <%s>\n", ir_var.in ())); - - FILE *ir_file = ACE_OS::fopen ("implrepo.ior", "w"); - ACE_OS::fprintf (ir_file, "%s", ir_var.in ()); - ACE_OS::fclose (ir_file); - - return 0; -} - -int -IR_iRepo_i::run (CORBA::Environment& env) -{ - if (this->orb_manager_.run (env) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "IR_Server_i::run"), -1); - return 0; -} - -IR_iRepo_i::~IR_iRepo_i (void) -{ - if (this->server_impl_ != 0) - delete server_impl_; -} - -IR_Adapter_Activator::IR_Adapter_Activator (PortableServer::Servant servant) -: servant_ (servant) -{ - // Nothing -} - - -CORBA::Boolean -IR_Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent, - const char *name, - CORBA_Environment &env) -{ - CORBA::PolicyList policies (2); - policies.length (2); - - // Request Processing Policy - policies[0] = - parent->create_request_processing_policy (PortableServer::USE_DEFAULT_SERVANT, env); - if (env.exception () != 0) - { - env.print_exception ("unknown_adapter::create_request_processing_policy"); - return -1; - } - - // Servant Retention Policy - policies[1] = - parent->create_servant_retention_policy (PortableServer::RETAIN, env); - if (env.exception () != 0) - { - env.print_exception ("unknown_adapter::create_servant_retention_policy"); - return -1; - } - - PortableServer::POA_var child = parent->create_POA (name, - PortableServer::POAManager::_nil (), - policies, - env); - if (env.exception () != 0) - return 0; - - for (CORBA::ULong i = 0; - i < policies.length () && env.exception () == 0; - ++i) - { - CORBA::Policy_ptr policy = policies[i]; - policy->destroy (env); - } - - if (env.exception () != 0) - { - env.print_exception ("unknown_adapter::policy->destroy"); - return -1; - } - - PortableServer::AdapterActivator_var activator = this->_this (env); - if (env.exception () != 0) - { - child->destroy (0, 0, env); - return 0; - } - - child->the_activator (activator.in (), env); - - if (env.exception () != 0) - { - child->destroy (0, 0, env); - return 0; - } - - child->set_servant (this->servant_); - - if (env.exception () != 0) - { - env.print_exception ("unknown_adapter, set_servant"); - child->destroy (0, 0, env); - return 0; - } - - // Finally everything is fine - return 1; -} - - - - -// Constructor -IR_Simple_i::IR_Simple_i (CORBA::ORB_ptr orb_ptr, - PortableServer::POA_ptr poa_ptr, - IR_iRepo_i *ir_impl) - : ir_impl_ (ir_impl), - orb_var_ (CORBA::ORB::_duplicate (orb_ptr)), - poa_var_ (PortableServer::POA::_duplicate (poa_ptr)), - forward_to_var_ (CORBA::Object::_nil ()) -{ -} - -// Destructor - -IR_Simple_i::~IR_Simple_i (void) -{ -} - -// Cube a long - -CORBA::Long -IR_Simple_i::simple_method (CORBA::Long l, CORBA::Environment &env) -{ - return this->forward (env); -} - -// Shutdown. - -void IR_Simple_i::shutdown (CORBA::Environment &env) -{ - this->forward (env); -} - -int IR_Simple_i::forward (CORBA::Environment &env) -{ - this->ir_impl_->start ("Simple_Server"); - ACE_DEBUG ((LM_DEBUG, "Forwarding...\n")); - if (!CORBA::is_nil (this->forward_to_var_.in ())) - { - env.exception (new PortableServer::ForwardRequest (this->forward_to_var_)); -/* - ACE_DEBUG ((LM_DEBUG, "Forwarding...\n")); - - PortableServer::ObjectId_var oid = - this->poa_var_->servant_to_id (this, env); - - if (env.exception () != 0) - return -1; - - PortableServer::Servant servant = this->poa_var_->_servant (); - if (servant == 0) - { -// CORBA::Exception *exception = new Foo::Cannot_Forward; -// env.exception (exception); - return -1; - } - - void *ptr = servant->_downcast ("IDL:PortableServer/POA:1.0"); - POA_PortableServer::POA *poa = (POA_PortableServer::POA *) ptr; - TAO_POA *tao_poa = ACE_dynamic_cast (TAO_POA *, poa); - - tao_poa->forward_object (oid.in (), - this->forward_to_var_.in (), - env);*/ - return 0; - } - else - { - ACE_DEBUG ((LM_DEBUG, "Forward_to reference is nil.\n")); -// CORBA::Exception *exception = new Foo::Cannot_Forward; -// env.exception (exception); - return -1; - } -} - -void IR_Simple_i::forward_to (CORBA::Object_ptr forward_to_ptr) -{ - this->forward_to_var_ = CORBA::Object::_duplicate (forward_to_ptr); -} diff --git a/TAO/orbsvcs/tests/ImplRepo/ir_implrepo_impl.h b/TAO/orbsvcs/tests/ImplRepo/ir_implrepo_impl.h deleted file mode 100644 index acc872f2ee1..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/ir_implrepo_impl.h +++ /dev/null @@ -1,158 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/orbsvcs/tests/ImplRepo -// -// = FILENAME -// ir_implrepo_impl.h -// -// = DESCRIPTION -// This class implements the Simple Object object. -// -// = AUTHOR -// Darrell Brunsch <brunsch@cs.wustl.edu> -// -// ============================================================================ - -#if !defined (IR_IMPLREPO_IMPL_H) -#define IR_IMPLREPO_IMPL_H - -#include "Impl_RepoS.h" -#include "tao/TAO.h" - -// Forward declarations. -class IR_iRepo_i; -class IR_Simple_i; - -// Typedefs. -typedef IR_iRepo_i *IR_iRepo_i_ptr; -typedef IR_iRepo_i_ptr IR_iRepo_i_ref; -typedef IR_Simple_i *IR_Simple_i_ptr; -typedef IR_Simple_i_ptr IR_Simple_i_ref; - -class IR_iRepo_i : public POA_Implementation_Repository -{ - // = TITLE - // Implementation Repository - // - // = DESCRIPTION - // This provides the interface to communicate directly with the - // Implementation Repository. -public: - // = Constructor and destructor - IR_iRepo_i (void); - ~IR_iRepo_i (void); - - // = Interface methods -// virtual void register_server (const char *server, -// const Implementation_Repository::Process_Options &options, -// CORBA::Environment &_tao_environment); - - virtual void server_is_running (const char *server, - CORBA::Object_ptr &obj, - const Implementation_Repository::INET_Addr &addr, - CORBA::Environment &_tao_environment); - - // = Other methods - - int init (int argc, char **argv, CORBA::Environment& env); - // Initialize the Server state - parsing arguments and waiting - - int run (CORBA::Environment& env); - // Run the orb - - void start (const char *server); - // Starts the program registered as <server> - -private: - IR_Simple_i *server_impl_; - - int parse_args (void); - // Parses the commandline arguments. - - int read_ior (char *filename); - // Reads the IOR of the real server from the file - - TAO_ORB_Manager orb_manager_; - // The ORB manager. - - FILE *ior_output_file_; - // File where the IOR of the server object is stored. - - char *server_key_; - // Key of the obj ref of the server. - - char *server_input_file_; - // Copy of the filename for the server output file. - - int argc_; - // Number of command line arguments. - - char **argv_; - // The command line arguments. -}; - -class IR_Adapter_Activator : public POA_PortableServer::AdapterActivator -{ - // = TITLE - // Implementation Repository Adapter Activator - // - // = DESCRIPTION - // Part of the Default Servant/DSI combination that forwards - // arbitrary requests. This allows for the setting up of child POAs - // with default servants. -public: - // Constructor - IR_Adapter_Activator (PortableServer::Servant servant); - - virtual CORBA::Boolean unknown_adapter (PortableServer::POA_ptr parent, - const char *name, - CORBA_Environment &_env = CORBA_Environment::default_environment ()); -private: - PortableServer::Servant &servant_; -}; - - -class IR_Simple_i: public POA_simple_object -{ - // = TITLE - // Simple Object Implementation - // - // = DESCRIPTION - // Implementation of a simple object that has two methods, one that - // returns the cube of a long, another that shuts down the server. -public: - // = Constructor and Destructor - IR_Simple_i (CORBA::ORB_ptr orb_ptr, - PortableServer::POA_ptr poa_ptr, - IR_iRepo_i *ir_impl); - - ~IR_Simple_i (void); - - // = Interface methods - virtual CORBA::Long simple_method (CORBA::Long l, - CORBA::Environment &env); - // Just cubes the long parameter - - virtual void shutdown (CORBA::Environment &env); - // Shutdown routine. - - // = Other methods - void forward_to (CORBA::Object_ptr forward_to_ptr); - // Sets the ior of the forward to ptr) - -private: - int forward (CORBA::Environment &env); - - class IR_iRepo_i *ir_impl_; - - CORBA::ORB_var orb_var_; - PortableServer::POA_var poa_var_; - CORBA::Object_var forward_to_var_; -}; - - -#endif /* IR_IMPLREPO_IMPL_H */ diff --git a/TAO/orbsvcs/tests/ImplRepo/ir_server.cpp b/TAO/orbsvcs/tests/ImplRepo/ir_server.cpp deleted file mode 100644 index 48773fb1b36..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/ir_server.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// $Id$ - -#include "ir_implrepo_impl.h" - -ACE_RCSID(ImplRepo, ir_server, "$Id$") - -int -main (int argc, char *argv[]) -{ - IR_iRepo_i server; - - ACE_DEBUG ((LM_DEBUG, "\n\tImplementation Repository\n\n")); - TAO_TRY - { - if (server.init (argc, argv, TAO_TRY_ENV) == -1) - return 1; - else - { - server.run (TAO_TRY_ENV); - TAO_CHECK_ENV; - } - } - TAO_CATCH (CORBA::SystemException, sysex) - { - ACE_UNUSED_ARG (sysex); - TAO_TRY_ENV.print_exception ("System Exception"); - return -1; - } - TAO_CATCH (CORBA::UserException, userex) - { - ACE_UNUSED_ARG (userex); - TAO_TRY_ENV.print_exception ("User Exception"); - return -1; - } - TAO_ENDTRY; - return 0; -} diff --git a/TAO/orbsvcs/tests/ImplRepo/ir_server_impl.cpp b/TAO/orbsvcs/tests/ImplRepo/ir_server_impl.cpp deleted file mode 100644 index 7b5c084faad..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/ir_server_impl.cpp +++ /dev/null @@ -1,146 +0,0 @@ -// $Id$ - -#include "ir_server_impl.h" -#include "ace/Get_Opt.h" -#include "ace/Read_Buffer.h" - -ACE_RCSID(ImplRepo, ir_server_impl, "$Id$") - -IR_Server_i::IR_Server_i (void) - : ior_output_file_ (0), - server_key_ (0), - server_impl_ (0) -{ -} - -// Reads the Server factory ior from a file - -int -IR_Server_i::read_ior (char *filename) -{ - // Open the file for reading. - ACE_HANDLE f_handle_ = ACE_OS::open (filename, 0); - - if (f_handle_ == ACE_INVALID_HANDLE) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to open %s for writing: %p\n", - filename), - -1); - ACE_Read_Buffer ior_buffer (f_handle_); - this->server_key_ = ior_buffer.read (); - - if (this->server_key_ == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to allocate memory to read ior: %p\n"), - -1); - - ACE_OS::close (filename); - return 0; -} - -int -IR_Server_i::parse_args (void) -{ - ACE_Get_Opt get_opts (this->argc_, this->argv_, "df:o:"); - int c; - int result; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'd': // debug flag. - TAO_debug_level++; - break; - case 'o': // output the IOR to a file. - this->ior_output_file_ = ACE_OS::fopen (get_opts.optarg, "w"); - if (this->ior_output_file_ == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to open %s for writing: %p\n", - get_opts.optarg), -1); - break; - case 'f': // read the IOR from the file. - result = this->read_ior (get_opts.optarg); - if (result < 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to read ior from %s : %p\n", - get_opts.optarg), - -1); - break; - case '?': // display help for use of the server. - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s" - " [-d]" - " [-f] <server_ior_file>" - " [-o] <ior_output_file>" - "\n", - argv_ [0]), - 1); - } - - // Indicates successful parsing of command line. - return 0; -} - -int -IR_Server_i::init (int argc, char** argv, CORBA::Environment& env) -{ - // Call the init of <TAO_ORB_Manager> to initialize the ORB and - // create a child POA under the root POA. - if (this->orb_manager_.init_child_poa (argc, argv, "child_poa", env) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "init_child_poa"), -1); - - TAO_CHECK_ENV_RETURN (env, -1); - - this->argc_ = argc; - this->argv_ = argv; - - int retval = this->parse_args (); - - if (retval != 0) - return retval; - - CORBA::Object_var server_object = - this->orb_manager_.orb ()->string_to_object (this->server_key_, env); -/* - this->server_ = simple_object::_narrow (server_object.in(), env); - - if (CORBA::is_nil (server_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "invalid server key <%s>\n", - this->server_key_), - -1); -*/ - - this->server_impl_ = new IR_Simple_i (this->orb_manager_.orb (), - this->orb_manager_.child_poa (), - server_object.in ()); - - CORBA::String_var str = - this->orb_manager_.activate_under_child_poa ("server", - this->server_impl_, - env); - ACE_DEBUG ((LM_DEBUG, "The IOR is: <%s>\n", str.in ())); - - if (this->ior_output_file_) - { - ACE_OS::fprintf (this->ior_output_file_, "%s", str.in ()); - ACE_OS::fclose (this->ior_output_file_); - } - - return 0; -} - -int -IR_Server_i::run (CORBA::Environment& env) -{ - if (this->orb_manager_.run (env) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "IR_Server_i::run"), -1); - return 0; -} - -IR_Server_i::~IR_Server_i (void) -{ - if (this->server_impl_ != 0) - delete server_impl_; -} diff --git a/TAO/orbsvcs/tests/ImplRepo/ir_server_impl.h b/TAO/orbsvcs/tests/ImplRepo/ir_server_impl.h deleted file mode 100644 index 6da5fd7fc5c..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/ir_server_impl.h +++ /dev/null @@ -1,73 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Simple -// -// = FILENAME -// ir_server_impl.h -// -// = DESCRIPTION -// Class which implements a CORBA server which sets up the simple object -// implementation and the orb. -// -// = AUTHORS -// Darrell Brunsch <brunsch@cs.wustl.edu> -// -// ============================================================================ - -#if !defined (IR_SERVER_IMPL_H) -#define IR_SERVER_IMPL_H - -#include "ir_simple_object_impl.h" -#include "tao/TAO.h" - -class IR_Server_i -{ - // = TITLE - // CORBA Server Implementation - // - // = DESCRIPTION - // -public: - // = Initialization and termination methods. - IR_Server_i (void); - // Default constructor - - ~IR_Server_i (void); - // Destructor - - int init (int argc, char **argv, CORBA::Environment& env); - // Initialize the Server state - parsing arguments and waiting - - int run (CORBA::Environment& env); - // Run the orb - -private: - IR_Simple_i *server_impl_; - - int parse_args (void); - // Parses the commandline arguments. - - int read_ior (char *filename); - // Reads the IOR of the real server from the file - - TAO_ORB_Manager orb_manager_; - // The ORB manager. - - FILE *ior_output_file_; - // File where the IOR of the server object is stored. - - char *server_key_; - // Key of the obj ref of the server. - - int argc_; - // Number of command line arguments. - - char **argv_; - // The command line arguments. -}; - -#endif /* IR_SERVER_IMPL_H */ diff --git a/TAO/orbsvcs/tests/ImplRepo/ir_simple_object_impl.cpp b/TAO/orbsvcs/tests/ImplRepo/ir_simple_object_impl.cpp deleted file mode 100644 index e7fdf7a1446..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/ir_simple_object_impl.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// $Id$ - -#include "ir_simple_object_impl.h" -#include "tao/corba.h" - -ACE_RCSID(ImplRepo, ir_simple_object_impl, "$Id$") - -// Constructor -IR_Simple_i::IR_Simple_i (CORBA::ORB_ptr orb_ptr, - PortableServer::POA_ptr poa_ptr, - CORBA::Object_ptr forward_to_ptr) - : orb_var_ (CORBA::ORB::_duplicate (orb_ptr)), - poa_var_ (PortableServer::POA::_duplicate (poa_ptr)), - forward_to_var_ (CORBA::Object::_duplicate (forward_to_ptr)) -{ - if (CORBA::is_nil (this->forward_to_var_)) - ACE_DEBUG ((LM_DEBUG, "Forward_to is nil!\n")); -} - -// Destructor - -IR_Simple_i::~IR_Simple_i (void) -{ -} - -// Cube a long - -CORBA::Long -IR_Simple_i::simple_method (CORBA::Long l, CORBA::Environment &env) -{ - if (!CORBA::is_nil (this->forward_to_var_.in ())) - { - ACE_DEBUG ((LM_DEBUG, "Forwarding...\n")); - - PortableServer::ObjectId_var oid = - this->poa_var_->servant_to_id (this, env); - - if (env.exception () != 0) - return -1; - - PortableServer::Servant servant = this->poa_var_->_servant (); - if (servant == 0) - { -// CORBA::Exception *exception = new Foo::Cannot_Forward; -// env.exception (exception); - return -1; - } - - void *ptr = servant->_downcast ("IDL:PortableServer/POA:1.0"); - POA_PortableServer::POA *poa = (POA_PortableServer::POA *) ptr; - TAO_POA *tao_poa = ACE_dynamic_cast (TAO_POA *, poa); - - tao_poa->forward_object (oid.in (), - this->forward_to_var_.in (), - env); - } - else - { - ACE_DEBUG ((LM_DEBUG, "Forward_to refenence is nil.\n")); -// CORBA::Exception *exception = new Foo::Cannot_Forward; -// env.exception (exception); - return -1; - } - return 0; -} - -// Shutdown. - -void IR_Simple_i::shutdown (CORBA::Environment &env) -{ - ACE_UNUSED_ARG (env); - - ACE_DEBUG ((LM_DEBUG, "%s\n", "IR_Simple_i is shutting down")); - - TAO_ORB_Core_instance ()->orb ()->shutdown (); -} - diff --git a/TAO/orbsvcs/tests/ImplRepo/ir_simple_object_impl.h b/TAO/orbsvcs/tests/ImplRepo/ir_simple_object_impl.h deleted file mode 100644 index 53d178751b7..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/ir_simple_object_impl.h +++ /dev/null @@ -1,62 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Simple -// -// = FILENAME -// simple_object_impl.h -// -// = DESCRIPTION -// This class implements the Simple Object object. -// -// = AUTHOR -// Darrell Brunsch <brunsch@cs.wustl.edu> -// -// ============================================================================ - -#if !defined (IR_SIMPLE_OBJECT_IMPL_H) -#define IR_SIMPLE_OBJECT_IMPL_H - -#include "Impl_RepoS.h" - -// Forward declarations. -class IR_Simple_i; - -// Typedefs. -typedef IR_Simple_i *IR_Simple_i_ptr; -typedef IR_Simple_i_ptr IR_Simple_i_ref; - -class IR_Simple_i: public POA_simple_object -{ - // = TITLE - // Simple Object Implementation - // - // = DESCRIPTION - // Implementation of a simple object that has two methods, one that - // returns the cube of a long, another that shuts down the server. -public: - IR_Simple_i (CORBA::ORB_ptr orb_ptr, - PortableServer::POA_ptr poa_ptr, - CORBA::Object_ptr forward_to_ptr); - // Constructor - - ~IR_Simple_i (void); - // Destructor - - virtual CORBA::Long simple_method (CORBA::Long l, - CORBA::Environment &env); - // Just cubes the long parameter - - virtual void shutdown (CORBA::Environment &env); - // Shutdown routine. - - CORBA::ORB_var orb_var_; - PortableServer::POA_var poa_var_; - CORBA::Object_var forward_to_var_; -}; - - -#endif /* IR_SIMPLE_OBJECT_IMPL_H */ diff --git a/TAO/orbsvcs/tests/ImplRepo/server.cpp b/TAO/orbsvcs/tests/ImplRepo/server.cpp deleted file mode 100644 index 741e14b9996..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/server.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// $Id$ - -#include "server_impl.h" - -ACE_RCSID(ImplRepo, server, "$Id$") - -int -main (int argc, char *argv[]) -{ - Server_i server; - - ACE_DEBUG ((LM_DEBUG, "\n\tSimple_Server\n\n")); - TAO_TRY - { - if (server.init (argc, argv, TAO_TRY_ENV) == -1) - return 1; - else - { - server.run (TAO_TRY_ENV); - TAO_CHECK_ENV; - } - } - TAO_CATCH (CORBA::SystemException, sysex) - { - ACE_UNUSED_ARG (sysex); - TAO_TRY_ENV.print_exception ("System Exception"); - return -1; - } - TAO_CATCH (CORBA::UserException, userex) - { - ACE_UNUSED_ARG (userex); - TAO_TRY_ENV.print_exception ("User Exception"); - return -1; - } - TAO_ENDTRY; - return 0; -} diff --git a/TAO/orbsvcs/tests/ImplRepo/server.dsp b/TAO/orbsvcs/tests/ImplRepo/server.dsp deleted file mode 100644 index 2a908c8ade0..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/server.dsp +++ /dev/null @@ -1,223 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ImplRepoTest Server" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=ImplRepoTest Server - Win32 Release
-!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 "server.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 "server.mak" CFG="ImplRepoTest Server - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ImplRepoTest Server - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "ImplRepoTest Server - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "ImplRepoTest Server - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir ".\server\Release"
-# PROP BASE Intermediate_Dir ".\server\Release"
-# PROP BASE Target_Dir ".\server"
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ".\Release"
-# PROP Intermediate_Dir ".\Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ".\server"
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\\" /I "..\..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
-# SUBTRACT CPP /YX
-# 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 ace.lib TAO.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
-
-!ELSEIF "$(CFG)" == "ImplRepoTest Server - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ".\server\Debug"
-# PROP BASE Intermediate_Dir ".\server\Debug"
-# PROP BASE Target_Dir ".\server"
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
-# PROP Intermediate_Dir ".\Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ".\server"
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\\" /I "..\..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
-# SUBTRACT CPP /YX
-# 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
-# ADD LINK32 aced.lib TAOd.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "ImplRepoTest Server - Win32 Release"
-# Name "ImplRepoTest Server - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\Impl_RepoC.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Impl_RepoS.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\server.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\server_impl.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\simple_object_impl.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Simple_ObjectC.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Simple_ObjectS.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
-# Begin Source File
-
-SOURCE=.\server.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\server_impl.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\simple_object_impl.h
-# End Source File
-# End Group
-# Begin Group "IDL Files"
-
-# PROP Default_Filter ".idl"
-# Begin Source File
-
-SOURCE=.\Simple_Object.idl
-
-!IF "$(CFG)" == "ImplRepoTest Server - Win32 Release"
-
-USERDEP__SIMPL="..\..\..\..\bin\Release\tao_idl.exe"
-# Begin Custom Build - Invoking TAO_IDL Compiler
-InputPath=.\Simple_Object.idl
-InputName=Simple_Object
-
-BuildCmds= \
- tao_idl $(InputName).idl
-
-"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ImplRepoTest Server - Win32 Debug"
-
-USERDEP__SIMPL="..\..\..\..\bin\tao_idl.exe"
-# Begin Custom Build - Invoking TAO_IDL Compiler
-InputPath=.\Simple_Object.idl
-InputName=Simple_Object
-
-BuildCmds= \
- tao_idl $(InputName).idl
-
-"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/TAO/orbsvcs/tests/ImplRepo/server_impl.cpp b/TAO/orbsvcs/tests/ImplRepo/server_impl.cpp deleted file mode 100644 index 282212ebc2b..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/server_impl.cpp +++ /dev/null @@ -1,152 +0,0 @@ -// $Id$ - -#include "server_impl.h" -#include "Impl_RepoC.h" -#include "ace/Get_Opt.h" -#include "ace/Read_Buffer.h" - -ACE_RCSID(ImplRepo, server_impl, "$Id$") - -Server_i::Server_i (void) - : ior_output_file_ (0) -{ -} - -int -Server_i::parse_args (void) -{ - ACE_Get_Opt get_opts (this->argc_, this->argv_, "do:f:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'd': // debug flag. - TAO_debug_level++; - break; - case 'o': // output the IOR to a file. - this->ior_output_file_ = ACE_OS::fopen (get_opts.optarg, "w"); - if (this->ior_output_file_ == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to open %s for writing: %p\n", - get_opts.optarg), -1); - break; - case '?': // display help for use of the server. - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s" - " [-d]" - " [-o] <ior_output_file>" - "\n", - argv_ [0]), - 1); - } - - // Indicates successful parsing of command line. - return 0; -} - -int -Server_i::init (int argc, char** argv, CORBA::Environment& env) -{ - TAO_TRY - { - // Call the init of <TAO_ORB_Manager> to initialize the ORB and - // create a child POA under the root POA. - if (this->orb_manager_.init_child_poa (argc, argv, "child_poa", TAO_TRY_ENV) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "init_child_poa"), -1); - - TAO_CHECK_ENV; - - this->argc_ = argc; - this->argv_ = argv; - - int retval = this->parse_args (); - - if (retval != 0) - return retval; - - CORBA::String_var str = - this->orb_manager_.activate_under_child_poa ("server", - &this->server_impl, - TAO_TRY_ENV); - TAO_CHECK_ENV; - - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "The IOR is: <%s>\n", str.in ())); - - // Talk to the Implementation Repository - - this->read_ir_ior (); - - CORBA::Object_var implrepo_object = - this->orb_manager_.orb ()->string_to_object (this->ir_server_key_, TAO_TRY_ENV); - TAO_CHECK_ENV; - - Implementation_Repository *ImplRepo = - Implementation_Repository::_narrow (implrepo_object.in(), TAO_TRY_ENV); - TAO_CHECK_ENV; - - if (CORBA::is_nil (implrepo_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "invalid implrepo key <%s>\n", - this->ir_server_key_), - -1); - - Implementation_Repository::INET_Addr addr; - - CORBA::Object_var server_object = - this->orb_manager_.orb ()->string_to_object (str, env); - - ImplRepo->server_is_running ("Simple_Server", server_object, addr, TAO_TRY_ENV); - - if (this->ior_output_file_) - { - ACE_OS::fprintf (this->ior_output_file_, "%s", server_object.in ()); - ACE_OS::fclose (this->ior_output_file_); - } - - } - TAO_CATCHANY - { - TAO_TRY_ENV.print_exception ("Server_i::init"); - return -1; - } - TAO_ENDTRY; - - return 0; -} - -int -Server_i::run (CORBA::Environment& env) -{ - if (this->orb_manager_.run (env) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "Server_i::run"), -1); - return 0; -} - -Server_i::~Server_i (void) -{ -} - -int -Server_i::read_ir_ior (void) -{ - // Open the file for reading. - ACE_HANDLE f_handle_ = ACE_OS::open ("implrepo.ior", 0); - - if (f_handle_ == ACE_INVALID_HANDLE) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to open %s for writing: implrepo.ior\n"), - -1); - ACE_Read_Buffer ior_buffer (f_handle_); - this->ir_server_key_ = ior_buffer.read (); - - if (this->ir_server_key_ == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to allocate memory to read ior: %p\n"), - -1); - - ACE_OS::close (f_handle_); - return 0; -} diff --git a/TAO/orbsvcs/tests/ImplRepo/server_impl.h b/TAO/orbsvcs/tests/ImplRepo/server_impl.h deleted file mode 100644 index a87424cff4a..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/server_impl.h +++ /dev/null @@ -1,71 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Simple -// -// = FILENAME -// server_impl.h -// -// = DESCRIPTION -// Class which implements a CORBA server which sets up the simple object -// implementation and the orb. -// -// = AUTHORS -// Darrell Brunsch <brunsch@cs.wustl.edu> -// -// ============================================================================ - -#if !defined (SERVER_IMPL_H) -#define SERVER_IMPL_H - -#include "simple_object_impl.h" -#include "tao/TAO.h" - -class Server_i -{ - // = TITLE - // CORBA Server Implementation - // - // = DESCRIPTION - // -public: - // = Initialization and termination methods. - Server_i (void); - // Default constructor - - ~Server_i (void); - // Destructor - - int init (int argc, char **argv, CORBA::Environment& env); - // Initialize the Server state - parsing arguments and waiting - - int run (CORBA::Environment& env); - // Run the orb - -private: - Simple_i server_impl; - - int read_ir_ior (void); - - int parse_args (void); - // Parses the commandline arguments. - - TAO_ORB_Manager orb_manager_; - // The ORB manager. - - char *ir_server_key_; - - FILE *ior_output_file_; - // File where the IOR of the server object is stored. - - int argc_; - // Number of command line arguments. - - char **argv_; - // The command line arguments. -}; - -#endif /* SERVER_IMPL_H */ diff --git a/TAO/orbsvcs/tests/ImplRepo/simple_object_impl.cpp b/TAO/orbsvcs/tests/ImplRepo/simple_object_impl.cpp deleted file mode 100644 index 4d92ba290fd..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/simple_object_impl.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// $Id$ - -#include "simple_object_impl.h" -#include "tao/corba.h" - -ACE_RCSID(ImplRepo, simple_object_impl, "$Id$") - -// Constructor - -Simple_i::Simple_i (const char *) -{ -} - - -// Destructor - -Simple_i::~Simple_i (void) -{ -} - -// Cube a long - -CORBA::Long -Simple_i::simple_method (CORBA::Long l, CORBA::Environment &env) -{ - ACE_DEBUG ((LM_DEBUG, "Simple Method\n")); - ACE_UNUSED_ARG (env); - TAO_ORB_Core_instance ()->orb ()->shutdown (); - return l * l * l; -} - -// Shutdown. - -void Simple_i::shutdown (CORBA::Environment &env) -{ - ACE_UNUSED_ARG (env); - - ACE_DEBUG ((LM_DEBUG, "%s\n", "Simple_i is shutting down")); - - TAO_ORB_Core_instance ()->orb ()->shutdown (); -} - diff --git a/TAO/orbsvcs/tests/ImplRepo/simple_object_impl.h b/TAO/orbsvcs/tests/ImplRepo/simple_object_impl.h deleted file mode 100644 index 59bf4106b7b..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/simple_object_impl.h +++ /dev/null @@ -1,56 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Simple -// -// = FILENAME -// simple_object_impl.h -// -// = DESCRIPTION -// This class implements the Simple Object object. -// -// = AUTHOR -// Darrell Brunsch <brunsch@cs.wustl.edu> -// -// ============================================================================ - -#if !defined (SIMPLE_OBJECT_IMPL_H) -#define SIMPLE_OBJECT_IMPL_H - -#include "Simple_ObjectS.h" - -// Forward declarations. -class Simple_i; - -// Typedefs. -typedef Simple_i *Simple_i_ptr; -typedef Simple_i_ptr Simple_i_ref; - -class Simple_i: public POA_simple_object -{ - // = TITLE - // Simple Object Implementation - // - // = DESCRIPTION - // Implementation of a simple object that has two methods, one that - // returns the cube of a long, another that shuts down the server. -public: - Simple_i (const char *obj_name = 0); - // Constructor - - ~Simple_i (void); - // Destructor - - virtual CORBA::Long simple_method (CORBA::Long l, - CORBA::Environment &env); - // Just cubes the long parameter - - virtual void shutdown (CORBA::Environment &env); - // Shutdown routine. -}; - - -#endif /* SIMPLE_OBJECT_IMPL_H */ diff --git a/TAO/orbsvcs/tests/ImplRepo/svc.conf b/TAO/orbsvcs/tests/ImplRepo/svc.conf deleted file mode 100644 index e983d040980..00000000000 --- a/TAO/orbsvcs/tests/ImplRepo/svc.conf +++ /dev/null @@ -1,49 +0,0 @@ -# $Id$ -# -# This file contains a sample ACE_Service_Config configuration -# file specifying the strategy factories utilized by an application -# using TAO. There are currently only two possible factories: -# Client_Strategy_Factory and Server_Strategy_Factory. These names -# must be used as the second argument to their corresponding line, -# because that's what the ORB uses to find the desired factory. -# -# Note that there are two unordinary characteristics of the way *this* -# file is set up: -# - both client and server strategies are specified in the same -# file, which would only make sense for co-located clients & servers -# - both of the factories are actually sourced out of libTAO.so -# (TAO.DLL on Win32), and they would normally be in a separate -# dll from the TAO ORB Core. -# -# The options which can be passed to the Resource Factory are: -# -# -ORBresources <which> -# where <which> can be 'global' to specify globally-held resources, -# or 'tss' to specify thread-specific resources. -# -# The options which can be passed to the Client are: -# <none currently> -# -# The options which can be passed to the Server are: -# -# -ORBconcurrency <which> -# where <which> can be 'thread-per-connection' to specify -# use of the ACE_Threaded_Strategy concurrency strategy, -# or 'reactive' to specify use of the ACE_Reactive_Strategy -# concurrency strategy. -# -# -ORBthreadflags <flags> -# specifies the default thread flags to use, where <flags> is a -# logical OR'ing of the flags THR_DETACHED, THR_BOUND, THR_NEW_LWP, -# THR_SUSPENDED, or THR_DAEMON. Note that not every flag may be valid -# on every platform. -# -# -ORBdemuxstrategy <which> -# where <which> can be one of 'dynamic', 'linear', 'active', or 'user', -# and specifies the type of object lookup strategy used internally. -# -ORBtablesize <unsigned> -# specifies the size of the object table -# -dynamic Resource_Factory Service_Object * TAO:_make_TAO_Resource_Factory() "-ORBresources tss" -dynamic Client_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Client_Strategy_Factory() -dynamic Server_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Server_Strategy_Factory() "-ORBconcurrency thread-per-connection -ORBdemuxstrategy dynamic -ORBtablesize 128" |