summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-09 20:11:14 +0000
committerbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-09 20:11:14 +0000
commit687c5111edfc180ed7b6610a9d8a1f92805f2a88 (patch)
tree573cc7d97e2639c32cc238829c4a31974fb36906
parent993f28ffbdce8f4b3bac5964411f603f7189193c (diff)
downloadATCD-687c5111edfc180ed7b6610a9d8a1f92805f2a88.tar.gz
Changed the filenames
-rw-r--r--TAO/tests/Quoter/Quoter.idl70
-rw-r--r--TAO/tests/Quoter/Quoter_Client.cpp417
-rw-r--r--TAO/tests/Quoter/Quoter_Client.dsp166
-rw-r--r--TAO/tests/Quoter/Quoter_Client.h108
-rw-r--r--TAO/tests/Quoter/Quoter_Impl.cpp157
-rw-r--r--TAO/tests/Quoter/Quoter_Impl.h87
-rw-r--r--TAO/tests/Quoter/Quoter_Server.cpp209
-rw-r--r--TAO/tests/Quoter/Quoter_Server.dsp178
-rw-r--r--TAO/tests/Quoter/Quoter_Server.h98
9 files changed, 1490 insertions, 0 deletions
diff --git a/TAO/tests/Quoter/Quoter.idl b/TAO/tests/Quoter/Quoter.idl
new file mode 100644
index 00000000000..e83b42534b1
--- /dev/null
+++ b/TAO/tests/Quoter/Quoter.idl
@@ -0,0 +1,70 @@
+// $Id$
+// ============================================================================
+//
+// = FILENAME
+// quoter.idl
+//
+// = DESCRIPTION
+// Quoter example uses the POA and CosLifeCycle interfaces
+//
+// = AUTHOR
+// Darrell Brunsch (brunsch@cs.wustl.edu)
+// Michael Kircher (mk1@cs.wustl.edu)
+//
+
+#include "../../orbsvcs/orbsvcs/CosLifeCycle.idl"
+
+module Stock
+{
+ exception Invalid_Stock {};
+ exception Invalid_Quoter {};
+
+ interface Quoter : CosLifeCycle::LifeCycleObject
+ {
+ // = TITLE
+ // Access Stock information.
+
+ long get_quote (in string stock_name)
+ raises (Invalid_Stock, Invalid_Quoter);
+ // Returns the current stock value or throws and exception.
+
+ void destroy ();
+ // Destroy a Quoter session and release resources.
+
+ // LifeCycleObject copy(in FactoryFinder there,
+ // in Criteria the_criteria)
+ // raises(NoFactory, NotCopyable, InvalidCriteria, CannotMeetCriteria);
+ // copies this object to a location "there" using the "the_criteria"
+
+ // void move(in FactoryFinder there,
+ // in Criteria the_criteria)
+ // raises(NoFactory, NotMovable, InvalidCriteria, CannotMeetCriteria);
+ // moves this object to a location "there" using the "the_criteria"
+
+ // void remove()
+ // raises(NotRemovable);
+ // removes/deletes this object
+
+ };
+
+ interface Quoter_Factory
+ {
+ // = TITLE
+ // Manage the lifecycle of a Quoter object.
+ Quoter create_quoter (in string name)
+ raises (Invalid_Quoter);
+ // Returns a new Quoter selected by name e.g., "Dow Jones,"
+ // "Reuters,", etc
+ };
+
+
+ interface QuoterFactoryFinder : CosLifeCycle::FactoryFinder
+ {
+ // = TITLE
+ // Wrapper for the CosLifeCycle FactoryFinder
+ //
+ // inherits:
+ // Factories find_factories(in Key factory_key) raises(NoFactory);
+ };
+};
+
diff --git a/TAO/tests/Quoter/Quoter_Client.cpp b/TAO/tests/Quoter/Quoter_Client.cpp
new file mode 100644
index 00000000000..173a0b4c704
--- /dev/null
+++ b/TAO/tests/Quoter/Quoter_Client.cpp
@@ -0,0 +1,417 @@
+// $Id$
+
+//#include "ace/Profile_Timer.h"
+//#include "ace/Env_Value_T.h"
+#include "ace/Read_Buffer.h"
+#include "quoter_client.h"
+#include "orbsvcs/CosNamingC.h"
+
+Quoter_Task::Quoter_Task (int argc, char **argv)
+ : argc_(argc), argv_(argv)
+{
+ // Nothing
+}
+
+int
+Quoter_Task::svc (void)
+{
+ if (this->quoter_client.init (this->argc_, this->argv_) == -1)
+ return 1;
+ else
+ return this->quoter_client.run ();
+
+/* Stock::Quoter_Factory_var factory_;
+
+ TAO_TRY
+ {
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService");
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to resolve the Name Service.\n"),
+ -1);
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in (), TAO_TRY_ENV);
+
+ TAO_CHECK_ENV;
+
+ CosNaming::Name quoter_factory_name (2);
+ quoter_factory_name.length (2);
+ quoter_factory_name[0].id = CORBA::string_dup ("Quoter");
+ quoter_factory_name[1].id = CORBA::string_dup ("quoter_factory");
+ CORBA::Object_var factory_obj =
+ naming_context->resolve (quoter_factory_name,TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ Stock::Quoter_Factory_var factory_ =
+ Stock::Quoter_Factory::_narrow (factory_obj.in (),TAO_TRY_ENV);
+
+ TAO_CHECK_ENV;
+
+ if (CORBA::is_nil (factory_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " could not resolve quoter factory in Naming service <%s>\n"),
+ -1);
+
+ ACE_DEBUG ((LM_DEBUG, "Factory received OK\n"));
+
+ // Now retrieve the Quoter obj ref corresponding to the key.
+ Stock::Quoter_ptr quoter_ =
+ factory_->create_quoter (ACE_OS::strdup ("key0"), TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ if (CORBA::is_nil (quoter_))
+ ACE_ERROR_RETURN ((LM_ERROR, "null quoter objref returned by factory\n"), -1);
+
+ CORBA::Long q = quoter_->get_quote ("ACE Hardware", this->env_);
+ if (this->env_.exception () != 0)
+ {
+ this->env_.print_exception ("with get_quote");
+ return -1;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "ACE Hardware = %i\n", q));
+ return q;
+ }
+ }
+ TAO_CATCHANY
+ {
+ TAO_TRY_ENV.print_exception ("Quoter_svc");
+ return -1;
+ }
+ TAO_ENDTRY;
+ return 0;*/
+}
+
+// Constructor.
+Quoter_Client::Quoter_Client (void)
+ : quoter_factory_key_ (0),
+ quoter_key_ (ACE_OS::strdup ("key0")),
+ shutdown_ (0),
+ quoter_ (Stock::Quoter::_nil ()),
+ quoter_factory_ior_file_ (0),
+ f_handle_ (ACE_INVALID_HANDLE),
+ use_naming_service_ (1)
+{
+}
+
+// Reads the Quoter factory ior from a file
+
+int
+Quoter_Client::read_ior (char *filename)
+{
+ // Open the file for reading.
+ this->f_handle_ = ACE_OS::open (filename,0);
+
+ if (this->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 (this->f_handle_);
+ this->quoter_factory_key_ = ior_buffer.read ();
+
+ if (this->quoter_factory_key_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to allocate memory to read ior: %p\n"),
+ -1);
+ return 0;
+}
+
+// Parses the command line arguments and returns an error status.
+
+int
+Quoter_Client::parse_args (void)
+{
+ ACE_Get_Opt get_opts (argc_, argv_, "dn:f:k:xs");
+ int c;
+ int result;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag
+ TAO_debug_level++;
+ 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 'k': // read the quoter IOR from the command-line.
+ this->quoter_factory_key_ =
+ ACE_OS::strdup (get_opts.optarg);
+ break;
+ case 'x':
+ this->shutdown_ = 1;
+ break;
+ case 's': // Don't use the TAO Naming Service.
+ this->use_naming_service_ = 0;
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-d]"
+ " [-f quoter_factory-obj-ref-key-file]"
+ " [-k quoter-obj-ref-key]"
+ " [-x]"
+ " [-s]"
+ "\n",
+ this->argv_ [0]),
+ -1);
+ }
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+int
+Quoter_Client::run (void)
+{
+ CORBA::Long q = this->quoter_->get_quote ("ACE Hardware", this->env_);
+ if (this->env_.exception () != 0)
+ {
+ this->env_.print_exception ("with get_quote");
+ return -1;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "ACE Hardware = %i\n", q));
+ return q;
+ }
+}
+
+Quoter_Client::~Quoter_Client (void)
+{
+ // Free resources
+ // Close the ior files
+ if (this->quoter_factory_ior_file_)
+ ACE_OS::fclose (this->quoter_factory_ior_file_);
+ if (this->f_handle_ != ACE_INVALID_HANDLE)
+ ACE_OS::close (this->f_handle_);
+
+ CORBA::release (this->quoter_);
+
+ if (this->quoter_factory_key_ != 0)
+ ACE_OS::free (this->quoter_factory_key_);
+ if (this->quoter_key_ != 0)
+ ACE_OS::free (this->quoter_key_);
+}
+
+int
+Quoter_Client::init_naming_service (void)
+{
+ TAO_TRY
+ {
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService");
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to resolve the Name Service.\n"),
+ -1);
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in (), TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ CosNaming::Name quoter_factory_name (2);
+ quoter_factory_name.length (2);
+ quoter_factory_name[0].id = CORBA::string_dup ("IDL_Quoter");
+ quoter_factory_name[1].id = CORBA::string_dup ("quoter_factory");
+ CORBA::Object_var factory_obj =
+ naming_context->resolve (quoter_factory_name,TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ this->factory_ =
+ Stock::Quoter_Factory::_narrow (factory_obj.in (),TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ if (CORBA::is_nil (this->factory_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " could not resolve quoter factory in Naming service <%s>\n"),
+ -1);
+ }
+ TAO_CATCHANY
+ {
+ TAO_TRY_ENV.print_exception ("Quoter::init_naming_service");
+ return -1;
+ }
+ TAO_ENDTRY;
+
+ return 0;
+}
+
+int
+Quoter_Client::init (int argc, char **argv)
+{
+ int naming_result;
+ 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->use_naming_service_) {
+ naming_result = this->init_naming_service ();
+ if (naming_result < 0)
+ return naming_result;
+ }
+ else {
+ if (this->quoter_factory_key_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s: no quoter factory key specified\n",
+ this->argv_[0]),
+ -1);
+
+
+ CORBA::Object_var factory_object =
+ this->orb_->string_to_object (this->quoter_factory_key_,
+ TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ this->factory_ =
+ Stock::Quoter_Factory::_narrow (factory_object.in(), TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ if (CORBA::is_nil (this->factory_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "invalid factory key <%s>\n",
+ this->quoter_factory_key_),
+ -1);
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "Factory received OK\n"));
+
+ // Now retrieve the Quoter obj ref corresponding to the key.
+ this->quoter_ =
+ this->factory_->create_quoter (this->quoter_key_,
+ TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ if (CORBA::is_nil (this->quoter_))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "null quoter objref returned by factory\n"),
+ -1);
+ }
+ TAO_CATCHANY
+ {
+ TAO_TRY_ENV.print_exception ("Quoter::init");
+ return -1;
+ }
+ TAO_ENDTRY;
+
+ return 0;
+}
+
+/*
+Quoter_Client::init (int argc, char **argv)
+{
+ int naming_result;
+ 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->use_naming_service_)
+ {
+ naming_result = this->init_naming_service ();
+ if (naming_result < 0)
+ return naming_result;
+ }
+ else
+ {
+ if (this->quoter_factory_key_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s: no quoter factory key specified\n",
+ this->argv_[0]),
+ -1);
+
+
+ CORBA::Object_var factory_object =
+ this->orb_->string_to_object (this->quoter_factory_key_,
+ TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ this->factory_ =
+ Stock::Quoter_Factory::_narrow (factory_object.in(), TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ if (CORBA::is_nil (this->factory_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "invalid factory key <%s>\n",
+ this->quoter_factory_key_),
+ -1);
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "Factory received OK\n"));
+
+ // Now retrieve the Quoter obj ref corresponding to the key.
+ this->quoter_ =
+ this->factory_->create_quoter (this->quoter_key_,
+ TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ if (CORBA::is_nil (this->quoter_))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "null quoter objref returned by factory\n"),
+ -1);
+ }
+ TAO_CATCHANY
+ {
+ TAO_TRY_ENV.print_exception ("Quoter::init");
+ return -1;
+ }
+ TAO_ENDTRY;
+
+ return 0;
+}*/
+
+// This function runs the test.
+
+int
+main (int argc, char **argv)
+{
+/* Quoter_Client quoter_client;
+
+ ACE_DEBUG ((LM_DEBUG,"\n \t IDL_Quoter: client \n\n"));
+
+ if (quoter_client.init (argc, argv) == -1)
+ return 1;
+ else
+ return quoter_client.run ();*/
+
+ ACE_Thread_Manager thr_mgr;
+
+ Quoter_Task client1 (argc, argv); //this->quoter_);
+ Quoter_Task client2 (argc, argv); //this->quoter_);
+ Quoter_Task client3 (argc, argv); //this->quoter_);
+
+ client1.activate (THR_BOUND | ACE_SCHED_FIFO, 1, 0, ACE_DEFAULT_THREAD_PRIORITY);
+ client2.activate (THR_BOUND | ACE_SCHED_FIFO, 1, 0, ACE_DEFAULT_THREAD_PRIORITY);
+//client3.activate (THR_BOUND | ACE_SCHED_FIFO, 1, 0, ACE_DEFAULT_THREAD_PRIORITY);
+
+ return ACE_Thread_Manager::instance ()->wait ();
+}
+
diff --git a/TAO/tests/Quoter/Quoter_Client.dsp b/TAO/tests/Quoter/Quoter_Client.dsp
new file mode 100644
index 00000000000..59fc1be4922
--- /dev/null
+++ b/TAO/tests/Quoter/Quoter_Client.dsp
@@ -0,0 +1,166 @@
+# Microsoft Developer Studio Project File - Name="quoter_client" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=quoter_client - 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 "quoter_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 "quoter_client.mak" CFG="quoter_client - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "quoter_client - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "quoter_client - 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)" == "quoter_client - 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)" == "quoter_client - 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 ""
+# 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 "..\..\\" /I "..\..\orbsvcs" /I "..\..\orbsvcs\orbsvcs" /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 orbsvcs.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\ace" /libpath:"..\..\tao" /libpath:"..\..\orbsvcs\orbsvcs"
+
+!ENDIF
+
+# Begin Target
+
+# Name "quoter_client - Win32 Release"
+# Name "quoter_client - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;idl"
+# Begin Source File
+
+SOURCE=.\quoter.idl
+
+!IF "$(CFG)" == "quoter_client - Win32 Release"
+
+!ELSEIF "$(CFG)" == "quoter_client - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\quoter.idl
+
+BuildCmds= \
+ ..\..\tao_idl\tao_idl quoter.idl
+
+"quoterC.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"quoterC.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"quoterC.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"quoterS.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"quoterS.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"quoterS.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\quoter_client.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\quoterC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\quoterS.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h"
+# Begin Source File
+
+SOURCE=.\quoter_client.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\quoterC.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\quoterS.h
+# End Source File
+# End Group
+# Begin Group "Include Files"
+
+# PROP Default_Filter "i"
+# Begin Source File
+
+SOURCE=.\quoterC.i
+# End Source File
+# Begin Source File
+
+SOURCE=.\quoterS.i
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/TAO/tests/Quoter/Quoter_Client.h b/TAO/tests/Quoter/Quoter_Client.h
new file mode 100644
index 00000000000..c259ed4b5dd
--- /dev/null
+++ b/TAO/tests/Quoter/Quoter_Client.h
@@ -0,0 +1,108 @@
+// $Id$
+// -*- C++ -*-
+
+#if !defined (QUOTER_CLIENT_H)
+#define QUOTER_CLIENT_H
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/Quoter
+//
+// = FILENAME
+// quoter_client.h
+//
+// = DESCRIPTION
+// @@@ Write this
+//
+// = AUTHORS
+// Darrell Brunsch
+//
+// ============================================================================
+
+#include "ace/Get_Opt.h"
+#include "ace/Task.h"
+#include "ace/Thread_Manager.h"
+#include "tao/corba.h"
+#include "quoterC.h"
+
+class Quoter_Client
+{
+ // = TITLE
+ // @@@ Write this
+ //
+ // = DESCRIPTION
+ // @@@ Write this
+public:
+ // = Constructor and destructor.
+ Quoter_Client (void);
+ ~Quoter_Client (void);
+
+ int run (void);
+ // Execute client example code.
+
+ int init (int argc, char **argv);
+ // Initialize the client communication endpoint with server.
+
+private:
+ int init_naming_service (void);
+ // Function to initialize the naming service.
+
+ int read_ior (char *filename);
+ // Function to read the Quoter factory ior from a file.
+
+ int parse_args (void);
+ // Parses the arguments passed on the command line.
+
+ int argc_;
+ // # of arguments on the command line.
+
+ char **argv_;
+ // arguments from command line.
+
+ char *quoter_factory_key_;
+ // Key of factory obj ref.
+
+ char *quoter_key_;
+ // Key of the obj ref to be retrieved via the factory.
+
+ int shutdown_;
+ // Flag to tell server to shutdown.
+
+ Stock::Quoter_Factory_var factory_;
+ // factory pointer for cubit.
+
+ CORBA::Environment env_;
+ // Environment variable.
+
+ Stock::Quoter_ptr quoter_;
+ // Quoter obj ref.
+
+ CORBA::ORB_var orb_;
+ // Remember our orb.
+
+ FILE *quoter_factory_ior_file_;
+ // File from which to obtain the IOR.
+
+ ACE_HANDLE f_handle_;
+ // File handle to read the IOR.
+
+ int use_naming_service_;
+ // Flag to tell client not to use Namingservice to find the cubit
+ // Factory.
+};
+
+class Quoter_Task : public ACE_Task<ACE_SYNCH>
+{
+public:
+ Quoter_Task (int argc, char **argv);
+
+ virtual int svc (void);
+
+private:
+ Quoter_Client quoter_client;
+ int argc_;
+ char **argv_;
+};
+
+#endif /* QUOTER_CLIENT_H */ \ No newline at end of file
diff --git a/TAO/tests/Quoter/Quoter_Impl.cpp b/TAO/tests/Quoter/Quoter_Impl.cpp
new file mode 100644
index 00000000000..8809a3ff7ff
--- /dev/null
+++ b/TAO/tests/Quoter/Quoter_Impl.cpp
@@ -0,0 +1,157 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/Quoter
+//
+// = FILENAME
+// quoter_impl.cpp
+//
+// = AUTHOR
+// Darrell Brunsch
+//
+// ============================================================================
+
+#include "tao/corba.h"
+//#include "ace/Auto_Ptr.h"
+#include "quoter_impl.h"
+#include "quoterC.h"
+
+// Constructor
+
+Quoter_Factory_Impl::Quoter_Factory_Impl (void)
+{
+}
+
+// Destructor
+
+Quoter_Factory_Impl::~Quoter_Factory_Impl (void)
+{
+}
+
+Stock::Quoter_ptr
+Quoter_Factory_Impl::create_quoter (const char *name,
+ CORBA::Environment &env)
+{
+ ACE_UNUSED_ARG (name);
+ return my_quoter_._this (env);
+}
+
+
+// Constructor
+
+Quoter_Impl::Quoter_Impl (const char *)
+{
+}
+
+// Destructor
+
+Quoter_Impl::~Quoter_Impl (void)
+{
+}
+
+Quoter_Impl::get_quote (char const *stock_name, class CORBA_Environment &env)
+{
+ ACE_UNUSED_ARG (stock_name);
+ ACE_UNUSED_ARG (env);
+
+ return 42;
+}
+
+// Shutdown.
+
+void Quoter_Impl::destroy (CORBA::Environment &env)
+{
+ ACE_UNUSED_ARG (env);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "%s",
+ "I have been asked to shut down "));
+
+ TAO_ORB_Core_instance ()->orb ()->shutdown ();
+}
+
+
+
+CosLifeCycle::LifeCycleObject_ptr
+Quoter_Impl::copy (CosLifeCycle::FactoryFinder_ptr there,
+ const CosLifeCycle::Criteria & the_criteria,
+ CORBA::Environment &_env_there) {
+
+ TAO_TRY {
+ // The name of the Quoter Factory
+ CosLifeCycle::Key factoryKey (1); // max = 1
+ factoryKey.length(1);
+ factoryKey[0].id = CORBA::string_dup ("quoter_factory");
+
+ // Find an appropriate factory over there
+ CosLifeCycle::Factories_ptr factories_ptr =
+ there->find_factories (factoryKey,_env_there);
+
+ // Only a NoFactory exception might have occured, so if it occured,
+ // then go immediately back.
+ if (_env_there.exception() != 0) {
+ // _env_there contains already the exception
+ return CosLifeCycle::LifeCycleObject::_nil();
+ }
+
+ // now it is known that there is at least one factory
+ Stock::Quoter_var quoter_var;
+ for (unsigned int i = 0; i < factories_ptr->length (); i++) {
+
+ // get the first object reference to a factory
+ CORBA::Object_var quoter_FactoryObj_var = (*factories_ptr)[i];
+
+ // narrow it to a Quoter Factory
+ Stock::Quoter_Factory_var quoter_Factory_var =
+ Stock::Quoter_Factory::_narrow (quoter_FactoryObj_var.in (),
+ TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ // try to get a Quoter created by this factory
+ quoter_var = quoter_Factory_var->create_quoter ("quoter_copied", TAO_TRY_ENV);
+ // @@ mk1: The create_quoter should return an exception
+ TAO_CHECK_ENV;
+
+ if (CORBA::is_nil (quoter_var.in ())) {
+
+ // if we had already our last chance, then give up
+ if (i == factories_ptr->length ()) {
+ _env_there.exception (new CosLifeCycle::NoFactory (factoryKey));
+ return CosLifeCycle::LifeCycleObject::_nil();
+ }
+ else {
+ ACE_ERROR((LM_ERROR,"Quoter::copy: Factory did not create the Quoter properly.\n"));
+ // else tell what's wrong and try the next factory
+ }
+ }
+ else {
+ break;
+ // if succeeded in creating a new Quoter over there, then stop trying
+ }
+ }
+
+ // return an object reference to the newly created Quoter
+ return (CosLifeCycle::LifeCycleObject_ptr) quoter_var;
+ }
+ TAO_CATCHANY
+ {
+ TAO_TRY_ENV.print_exception ("SYS_EX");
+ return CosLifeCycle::LifeCycleObject::_nil();
+ }
+ TAO_ENDTRY;
+ return CosLifeCycle::LifeCycleObject::_nil();
+}
+
+void
+Quoter_Impl::move (CosLifeCycle::FactoryFinder_ptr there,
+ const CosLifeCycle::Criteria & the_criteria,
+ CORBA::Environment &_tao_environment) {
+
+}
+
+void
+Quoter_Impl::remove (CORBA::Environment &_tao_environment) {
+
+}
diff --git a/TAO/tests/Quoter/Quoter_Impl.h b/TAO/tests/Quoter/Quoter_Impl.h
new file mode 100644
index 00000000000..3993c8c5a6a
--- /dev/null
+++ b/TAO/tests/Quoter/Quoter_Impl.h
@@ -0,0 +1,87 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/Quoter
+//
+// = FILENAME
+// quoter_impl.h
+//
+// = AUTHOR
+// Darrell Brunsch
+//
+// ============================================================================
+
+#if !defined (QUOTER_IMPL_H)
+#define QUOTER_IMPL_H
+
+#include "quoterS.h"
+
+// Forward declarations.
+class Quoter_Impl;
+
+// Typedefs.
+typedef Quoter_Impl *Quoter_Impl_ptr;
+typedef Quoter_Impl_ptr Quoter_Impl_ref;
+
+class Quoter_Impl: public POA_Stock::Quoter
+{
+ // = TITLE
+ // @@@@ Write
+ //
+ // = DESCRIPTION
+ // @@@@ Write
+public:
+ Quoter_Impl (const char *obj_name = 0);
+ // Constructor
+
+ ~Quoter_Impl (void);
+ // Destructor
+
+ virtual CORBA::Long get_quote (const char *stock_name,
+ CORBA::Environment &env);
+
+ virtual void destroy (CORBA_Environment &env);
+
+ virtual CosLifeCycle::LifeCycleObject_ptr copy (
+ CosLifeCycle::FactoryFinder_ptr there,
+ const CosLifeCycle::Criteria & the_criteria,
+ CORBA::Environment &_tao_environment);
+
+ virtual void move (
+ CosLifeCycle::FactoryFinder_ptr there,
+ const CosLifeCycle::Criteria & the_criteria,
+ CORBA::Environment &_tao_environment);
+
+ virtual void remove (
+ CORBA::Environment &_tao_environment);
+};
+
+class Quoter_Factory_Impl;
+
+typedef Quoter_Factory_Impl *Quoter_Factory_Impl_ptr;
+
+class Quoter_Factory_Impl: public POA_Stock::Quoter_Factory
+{
+ // = TITLE
+ // Quoter_Factory_Impl
+ //
+ // = DESCRIPTION
+ // Factory object returning the quoter_impl objrefs
+public:
+ Quoter_Factory_Impl (void);
+ // Constructor.
+
+ ~Quoter_Factory_Impl (void);
+ // Destructor.
+
+ virtual Stock::Quoter_ptr create_quoter (const char *name,
+ CORBA::Environment &env);
+ // Return the quoter by the id <name>
+
+private:
+ Quoter_Impl my_quoter_;
+};
+
+#endif /* QUOTER_IMPL_H */
diff --git a/TAO/tests/Quoter/Quoter_Server.cpp b/TAO/tests/Quoter/Quoter_Server.cpp
new file mode 100644
index 00000000000..55beda6e71d
--- /dev/null
+++ b/TAO/tests/Quoter/Quoter_Server.cpp
@@ -0,0 +1,209 @@
+// $Id$
+
+#include "quoter_server.h"
+
+Quoter_Server::Quoter_Server (void)
+ :num_of_objs_ (1),
+ use_naming_service_ (1),
+ ior_output_file_ (0)
+{
+}
+
+int
+Quoter_Server::parse_args (void)
+{
+ ACE_Get_Opt get_opts (argc_, argv_, "dn:o:s");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag.
+ TAO_debug_level++;
+ break;
+ case 'n': // number of Quoter objects we export
+ this->num_of_objs_ = ACE_OS::atoi (get_opts.optarg);
+ 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 's': // Don't use the TAO Naming Service.
+ this->use_naming_service_=0;
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-d]"
+ " [-n] <num of Quoter objects>"
+ " [-o] <ior_output_file>"
+ " [-s]"
+ "\n",
+ argv_ [0]),
+ 1);
+ }
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+int
+Quoter_Server::init (int argc,
+ char** argv,
+ CORBA::Environment& env)
+{
+ // Call the init of TAO_ORB_Manager to create a child POA
+ // under the root POA.
+ this->init_child_poa (argc,
+ argv,
+ "child_poa",
+ env);
+
+ TAO_CHECK_ENV_RETURN (env,-1);
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ this->parse_args ();
+
+ CORBA::String_var str =
+ this->activate_under_child_poa ("factory",
+ &this->factory_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_);
+ }
+
+ if (this->use_naming_service_)
+ return this->init_naming_service (env);
+
+ return 0;
+}
+
+// Initialisation of Naming Service and register IDL_Quoter Context and
+// Quoter_factory object.
+
+int
+Quoter_Server::init_naming_service (CORBA::Environment& env)
+{
+ int result;
+ result = this->my_name_server_.init (this->orb_,
+ this->child_poa_);
+ if (result < 0)
+ return result;
+ factory = this->factory_impl_._this (env);
+ TAO_CHECK_ENV_RETURN (env,-1);
+
+ CosNaming::Name quoter_context_name (1);
+ quoter_context_name.length (1);
+ quoter_context_name[0].id = CORBA::string_dup ("IDL_Quoter");
+ this->quoter_context_ =
+ this->my_name_server_->bind_new_context (quoter_context_name,
+ env);
+ TAO_CHECK_ENV_RETURN (env,-1);
+
+ //Register the quoter_factory name with the IDL_quoter Naming
+ //Context...
+ CosNaming::Name factory_name (1);
+ factory_name.length (1);
+ factory_name[0].id = CORBA::string_dup ("quoter_factory");
+ this->quoter_context_->bind (factory_name,
+ factory.in (),
+ env);
+ TAO_CHECK_ENV_RETURN (env,-1);
+ return 0;
+}
+
+int
+Quoter_Server::run (CORBA::Environment& env)
+{
+ this->poa_manager_->activate (env);
+ TAO_CHECK_ENV_RETURN (env,1);
+
+ if (this->orb_->run () == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "run"),
+ -1);
+ return 0;
+}
+
+Quoter_Server::~Quoter_Server (void)
+{
+ TAO_TRY
+ {
+ // Unbind quoter factory context and name.
+ CosNaming::Name factory_name (2);
+ factory_name.length (2);
+ factory_name[0].id = CORBA::string_dup ("IDL_Quoter");
+ factory_name[1].id = CORBA::string_dup ("quoter_factory");
+ // this->naming_context_->unbind (factory_name,TAO_TRY_ENV);
+ this->my_name_server_->unbind (factory_name,TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+ factory_name.length (1);
+ // this->naming_context_->unbind
+ // (factory_name,TAO_TRY_ENV);
+ this->my_name_server_->unbind (factory_name,TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+ // Destroy all the POAs.
+// this->root_poa_->destroy (CORBA::B_TRUE,
+// CORBA::B_TRUE,
+// TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+ }
+ TAO_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_UNUSED_ARG (sysex);
+ TAO_TRY_ENV.print_exception ("System Exception");
+ }
+ TAO_CATCH (CORBA::UserException, userex)
+ {
+ ACE_UNUSED_ARG (userex);
+ TAO_TRY_ENV.print_exception ("User Exception");
+ }
+ TAO_ENDTRY;
+}
+
+int
+main (int argc, char *argv[])
+{
+ Quoter_Server quoter_server;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\n \t IDL_Quoter:SERVER \n \n"));
+ TAO_TRY
+ {
+ if (quoter_server.init (argc,argv,TAO_TRY_ENV) == -1)
+ return 1;
+ else
+ {
+ quoter_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/tests/Quoter/Quoter_Server.dsp b/TAO/tests/Quoter/Quoter_Server.dsp
new file mode 100644
index 00000000000..a1297b36793
--- /dev/null
+++ b/TAO/tests/Quoter/Quoter_Server.dsp
@@ -0,0 +1,178 @@
+# Microsoft Developer Studio Project File - Name="quoter_server" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=quoter_server - 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 "quoter_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 "quoter_server.mak" CFG="quoter_server - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "quoter_server - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "quoter_server - 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)" == "quoter_server - 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 Ignore_Export_Lib 0
+# 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 /I "..\..\..\\" /I "..\..\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /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:"..\..\..\ace" /libpath:"..\..\tao"
+
+!ELSEIF "$(CFG)" == "quoter_server - 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 ""
+# 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 "..\..\\" /I "..\..\orbsvcs" /I "..\..\orbsvcs\orbsvcs" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /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 /pdbtype:sept
+# ADD LINK32 aced.lib tao.lib orbsvcs.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\ace" /libpath:"..\..\tao" /libpath:"..\..\orbsvcs\orbsvcs"
+# SUBTRACT LINK32 /nodefaultlib
+
+!ENDIF
+
+# Begin Target
+
+# Name "quoter_server - Win32 Release"
+# Name "quoter_server - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;idl"
+# Begin Source File
+
+SOURCE=.\quoter.idl
+
+!IF "$(CFG)" == "quoter_server - Win32 Release"
+
+!ELSEIF "$(CFG)" == "quoter_server - Win32 Debug"
+
+# Begin Custom Build - Compiling IDL
+InputPath=.\quoter.idl
+
+BuildCmds= \
+ ..\..\tao_idl\tao_idl quoter.idl
+
+"quoterC.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"quoterC.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"quoterC.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"quoterS.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"quoterS.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"quoterS.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\quoter_impl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\quoter_server.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\quoterC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\quoterS.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h"
+# Begin Source File
+
+SOURCE=.\quoter_impl.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\quoter_server.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\quoterC.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\quoterS.h
+# End Source File
+# End Group
+# Begin Group "Include Files"
+
+# PROP Default_Filter "i"
+# Begin Source File
+
+SOURCE=.\quoterC.i
+# End Source File
+# Begin Source File
+
+SOURCE=.\quoterS.i
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/TAO/tests/Quoter/Quoter_Server.h b/TAO/tests/Quoter/Quoter_Server.h
new file mode 100644
index 00000000000..7130a3ac5d4
--- /dev/null
+++ b/TAO/tests/Quoter/Quoter_Server.h
@@ -0,0 +1,98 @@
+// $Id$
+// -*- C++ -*-
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/Quoter
+//
+// = FILENAME
+// quoter_server.h
+//
+// = DESCRIPTION
+// @@@ Working on it
+//
+// = AUTHORS
+// Darrell Brunsch
+//
+// ============================================================================
+
+#if !defined (QUOTER_SERVER_H)
+#define QUOTER_SERVER_H
+
+#include "ace/Get_Opt.h"
+#include "ace/Log_Msg.h"
+#include "orbsvcs/CosNamingC.h"
+#include "quoter_impl.h"
+#include "quoterC.h"
+#include "orbsvcs/Naming/Naming_Utils.h"
+#include "tao/tao.h"
+
+
+
+class Quoter_Server : public TAO_ORB_Manager
+{
+ // =TITLE
+ // Defines a Quoter Server class that implements the functionality
+ // of a server process as an object.
+ //
+ // =DESCRIPTION
+ // The interface is quite simple. A server program has to call
+ // init to initialize the quoter_server's state and then call run
+ // to run the orb.
+public:
+
+ Quoter_Server (void);
+ // Default constructor
+
+ ~Quoter_Server (void);
+ // Destructor
+
+ int init (int argc, char **argv, CORBA::Environment& env);
+ // Initialize the Quoter_Server state - parsing arguments and ...
+
+ int run (CORBA::Environment& env);
+ // Run the orb
+
+private:
+ int parse_args (void);
+ // Parses the commandline arguments.
+
+ int init_naming_service (CORBA::Environment &env);
+ // Initialises the name server and registers cubit factory with the
+ // name server.
+
+ int num_of_objs_;
+ // Number of cubit objects we export.
+
+ int use_naming_service_;
+ //Flag to tell server not to use the TAO Naming Service to register
+ //the cubit factory.
+
+ FILE* ior_output_file_;
+ // File to output the cubit factory IOR.
+
+ TAO_Naming_Server my_name_server_;
+ // An instance of the name server used for registering the factory
+ // objects.
+
+ Quoter_Factory_Impl factory_impl_;
+ // Implementation object of the cubit factory.
+
+ Stock::Quoter_Factory_var factory;
+ // Factory_var to register with NamingService.
+
+ CosNaming::NamingContext_var quoter_context_;
+ // Naming context for the cubit_factory.
+
+ CosNaming::NamingContext_var naming_context_;
+ // Naming context for the Naming Service.
+
+ int argc_;
+ // Number of commandline arguments.
+
+ char **argv_;
+ // commandline arguments.
+};
+
+#endif /* QUOTER_SERVER_H */