summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1998-04-24 15:38:45 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1998-04-24 15:38:45 +0000
commitbba6eb8a5b991de45001380590fb226dba22897c (patch)
tree174089ddb3126aafb2178dc6f7bbb49f2bdc146d
parent0a8ca3780bda36fe1894365d65fee23049a24d66 (diff)
downloadATCD-bba6eb8a5b991de45001380590fb226dba22897c.tar.gz
*** empty log message ***
-rw-r--r--TAO/tests/Quoter/Factory_Finder.cpp24
-rw-r--r--TAO/tests/Quoter/Factory_Finder.h2
-rw-r--r--TAO/tests/Quoter/Factory_Finder_Impl.cpp119
-rw-r--r--TAO/tests/Quoter/Factory_Finder_Impl.h2
-rw-r--r--TAO/tests/Quoter/Generic_Factory.cpp44
-rw-r--r--TAO/tests/Quoter/Generic_Factory.h14
-rw-r--r--TAO/tests/Quoter/Generic_Factory_Impl.cpp138
-rw-r--r--TAO/tests/Quoter/Generic_Factory_Impl.h14
8 files changed, 183 insertions, 174 deletions
diff --git a/TAO/tests/Quoter/Factory_Finder.cpp b/TAO/tests/Quoter/Factory_Finder.cpp
index a91e0be781d..477f3e7d6dd 100644
--- a/TAO/tests/Quoter/Factory_Finder.cpp
+++ b/TAO/tests/Quoter/Factory_Finder.cpp
@@ -17,15 +17,13 @@
#include "tao/corba.h"
#include "Factory_Finder.h"
+static const char usage [] = "[-? |\n[-O[RBport] ORB port number]]";
-static const char usage [] =
-"[-? |\n[-O[RBport] ORB port number]]";
-
-Quoter_Factory_Finder_Server::Quoter_Factory_Finder_Server ()
+Quoter_Factory_Finder_Server::Quoter_Factory_Finder_Server (void)
{
}
-Quoter_Factory_Finder_Server::~Quoter_Factory_Finder_Server ()
+Quoter_Factory_Finder_Server::~Quoter_Factory_Finder_Server (void)
{
TAO_TRY
{
@@ -100,7 +98,7 @@ Quoter_Factory_Finder_Server::init (int argc, char *argv[], CORBA::Environment&
if (CORBA::is_nil (namingObj_var.in ()))
ACE_ERROR ((LM_ERROR,
- " (%P|%t) Unable get the Naming Service.\n"));
+ " (%P|%t) Unable get the Naming Service.\n"));
// Narrow the object reference to a Naming Context.
CosNaming::NamingContext_var namingContext_var =
@@ -122,7 +120,8 @@ Quoter_Factory_Finder_Server::init (int argc, char *argv[], CORBA::Environment&
CosNaming::NamingContext::_narrow (quoterNamingObj_var.in (),
TAO_TRY_ENV);
- ACE_DEBUG ((LM_DEBUG,"Have a proper reference to the Quoter Naming Context.\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "Have a proper reference to the Quoter Naming Context.\n"));
// Bind the QuoterFactory Finder to the IDL_Quoter naming
// context.
@@ -131,10 +130,11 @@ Quoter_Factory_Finder_Server::init (int argc, char *argv[], CORBA::Environment&
quoter_Factory_Finder_Name_[0].id = CORBA::string_dup ("Quoter_Factory_Finder");
quoterNamingContext_var_->bind (quoter_Factory_Finder_Name_,
- this->quoter_Factory_Finder_Impl_ptr_->_this(TAO_TRY_ENV),
- TAO_TRY_ENV);
+ this->quoter_Factory_Finder_Impl_ptr_->_this(TAO_TRY_ENV),
+ TAO_TRY_ENV);
TAO_CHECK_ENV;
- ACE_DEBUG ((LM_DEBUG,"Bound the Quoter Factory Finder to the Quoter Naming Context.\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "Bound the Quoter Factory Finder to the Quoter Naming Context.\n"));
}
TAO_CATCHANY
{
@@ -160,8 +160,8 @@ Quoter_Factory_Finder_Server::run (CORBA::Environment& env)
// Function get_options.
-unsigned int
-Quoter_Factory_Finder_Server::parse_args ()
+u_
+Quoter_Factory_Finder_Server::parse_args (void)
{
// We need the 'O' in get_opt () because we also want to have ORB
// parameters, they all start with 'O'.
diff --git a/TAO/tests/Quoter/Factory_Finder.h b/TAO/tests/Quoter/Factory_Finder.h
index 76ed650e31f..2dc0aa7d92f 100644
--- a/TAO/tests/Quoter/Factory_Finder.h
+++ b/TAO/tests/Quoter/Factory_Finder.h
@@ -38,7 +38,7 @@ public:
int run (CORBA::Environment& env);
// Run the orb
- unsigned int parse_args ();
+ u_ parse_args (void);
// parse the passed parameters
private:
diff --git a/TAO/tests/Quoter/Factory_Finder_Impl.cpp b/TAO/tests/Quoter/Factory_Finder_Impl.cpp
index 16f6fadbcad..2954bbfd366 100644
--- a/TAO/tests/Quoter/Factory_Finder_Impl.cpp
+++ b/TAO/tests/Quoter/Factory_Finder_Impl.cpp
@@ -19,8 +19,7 @@
#include "Factory_Finder_Impl.h"
#include "QuoterC.h"
-static const char usage [] =
-"[-? |\n[-O[RBport] ORB port number]]";
+static const char usage [] = "[-? |\n[-O[RBport] ORB port number]]";
// Constructor
Quoter_Factory_Finder_Impl::Quoter_Factory_Finder_Impl (void)
@@ -40,33 +39,34 @@ Quoter_Factory_Finder_Impl::find_factories (const CosLifeCycle::Key &factory_key
CORBA::Environment env_here;
// fill in the name of the Quoter Factory
- CosNaming::Name factoryName (1); // max = 1
- factoryName.length (1);
- factoryName[0].id = CORBA::string_dup ("quoter_factory");
+ CosNaming::Name factoryName (1); // max = 1
+ factoryName.length (1);
+ factoryName[0].id = CORBA::string_dup ("quoter_factory");
// or
// Get a reference to the ORB.
CORBA::ORB_ptr orb_ptr = TAO_ORB_Core_instance ()->orb ();
- // Get the Naming Service object reference.
- CORBA::Object_var namingObj_var =
- orb_ptr->resolve_initial_references ("NameService");
+ // Get the Naming Service object reference.
+ CORBA::Object_var namingObj_var =
+ orb_ptr->resolve_initial_references ("NameService");
if (CORBA::is_nil (namingObj_var.in ()))
- ACE_ERROR ((LM_ERROR,
- " (%P|%t) Unable get the Naming Service.\n"));
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable get the Naming Service.\n"));
// Narrow the object reference to a Naming Context.
CosNaming::NamingContext_var namingContext_var =
CosNaming::NamingContext::_narrow (namingObj_var.in (),
env_here);
- // see if there is an exception, if yes then throw the NoFactory exception
+ // See if there is an exception, if yes then throw the NoFactory
+ // exception.
if (env_here.exception () != 0) // throw a NoFactory exception
- {
- _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
- return 0;
- }
+ {
+ _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
+ return 0;
+ }
// Get the IDL_Quoter naming context.
CosNaming::Name quoterContextName (1); // max = 1
@@ -76,23 +76,24 @@ Quoter_Factory_Finder_Impl::find_factories (const CosLifeCycle::Key &factory_key
CORBA::Object_var quoterNamingObj_var =
namingContext_var->resolve (quoterContextName, env_here);
- // see if there is an exception, if yes then throw the NoFactory exception
+ // see if there is an exception, if yes then throw the NoFactory
+ // exception.
if (env_here.exception () != 0) // throw a NoFactory exception
- {
- _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
- return 0;
- }
+ {
+ _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
+ return 0;
+ }
CosNaming::NamingContext_var quoterNamingContext_var =
CosNaming::NamingContext::_narrow (quoterNamingObj_var.in (),
- env_here);
+ env_here);
// see if there is an exception, if yes then throw the NoFactory exception
if (env_here.exception () != 0) // throw a NoFactory exception
- {
- _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
- return 0;
- }
+ {
+ _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
+ return 0;
+ }
// ** now a proper reference to the quoter naming context is available
@@ -106,47 +107,49 @@ Quoter_Factory_Finder_Impl::find_factories (const CosLifeCycle::Key &factory_key
// see if there is an exception, if yes then throw the NoFactory exception
if (env_here.exception () != 0) // throw a NoFactory exception
- {
- _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
- return 0;
- }
+ {
+ _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
+ return 0;
+ }
// were able to get a reference to Quoter Factory
// Check if it is a valid Quoter Factory reference
if (CORBA::is_nil (quoterFactoryObject_var.in()))
- { // throw a NoFactory exception
- _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
- return 0;
- }
- else {
-
- // create a sequence of factories object
- CosLifeCycle::Factories *factories_ptr = new CosLifeCycle::Factories (1);
-
- // See if there is an exception, if yes then throw the NoFactory
- // exception.
- if (env_here.exception () != 0)
- {
- // Throw a NoFactory exception.
+ { // throw a NoFactory exception
_env_there.exception (new CosLifeCycle::NoFactory (factory_key));
return 0;
}
+ else
+ {
- // using the Naming Service only one reference is available
- factories_ptr->length (1);
-
- // Check if it is a valid Quoter Factory reference.
- if (CORBA::is_nil (quoterFactoryObject_var.in ())) // throw a NoFactory exception.
- {
- _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
- return 0;
+ // create a sequence of factories object
+ CosLifeCycle::Factories *factories_ptr = new CosLifeCycle::Factories (1);
+
+ // See if there is an exception, if yes then throw the NoFactory
+ // exception.
+ if (env_here.exception () != 0)
+ {
+ // Throw a NoFactory exception.
+ _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
+ return 0;
+ }
+
+ // using the Naming Service only one reference is available
+ factories_ptr->length (1);
+
+ // Check if it is a valid Quoter Factory reference.
+ if (CORBA::is_nil (quoterFactoryObject_var.in ())) // throw a NoFactory exception.
+ {
+ _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
+ return 0;
+ }
+
+ // insert the object reference
+ (*factories_ptr)[0] = CORBA::Object::_duplicate (quoterFactoryObject_var.ptr());
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Have reference to a Quoter Factory.\n"));
+ return factories_ptr;
}
-
- // insert the object reference
- (*factories_ptr)[0] = CORBA::Object::_duplicate (quoterFactoryObject_var.ptr());
-
- ACE_DEBUG ((LM_DEBUG,"Have reference to a Quoter Factory.\n"));
- return factories_ptr;
- }
}
diff --git a/TAO/tests/Quoter/Factory_Finder_Impl.h b/TAO/tests/Quoter/Factory_Finder_Impl.h
index c92289832d1..74e347a232b 100644
--- a/TAO/tests/Quoter/Factory_Finder_Impl.h
+++ b/TAO/tests/Quoter/Factory_Finder_Impl.h
@@ -28,7 +28,7 @@ public:
Quoter_Factory_Finder_Impl (void);
~Quoter_Factory_Finder_Impl (void);
- virtual CosLifeCycle::Factories * find_factories (const CosLifeCycle::Key & factory_key,
+ virtual CosLifeCycle::Factories * find_factories (const CosLifeCycle::Key &factory_key,
CORBA::Environment &_tao_environment);
// Returns a squence of Factories if factories matching the
// factory_key were found. If no factory was found, then the
diff --git a/TAO/tests/Quoter/Generic_Factory.cpp b/TAO/tests/Quoter/Generic_Factory.cpp
index 3b57047faec..244bfa1c0c3 100644
--- a/TAO/tests/Quoter/Generic_Factory.cpp
+++ b/TAO/tests/Quoter/Generic_Factory.cpp
@@ -16,15 +16,13 @@
#include "tao/corba.h"
#include "Generic_Factory.h"
+static const char usage [] = "[-? |\n[-O[RBport] ORB port number]]";
-static const char usage [] =
-"[-? |\n[-O[RBport] ORB port number]]";
-
-Quoter_Generic_Factory_Server::Quoter_Generic_Factory_Server ()
+Quoter_Generic_Factory_Server::Quoter_Generic_Factory_Server (void)
{
}
-Quoter_Generic_Factory_Server::~Quoter_Generic_Factory_Server ()
+Quoter_Generic_Factory_Server::~Quoter_Generic_Factory_Server (void)
{
TAO_TRY
{
@@ -49,7 +47,9 @@ Quoter_Generic_Factory_Server::~Quoter_Generic_Factory_Server ()
TAO_ENDTRY;
}
-Quoter_Generic_Factory_Server::init (int argc, char *argv[], CORBA::Environment& env)
+Quoter_Generic_Factory_Server::init (int argc,
+ char *argv[],
+ CORBA::Environment& env)
{
if (this->orb_manager_.init (argc,
argv,
@@ -87,10 +87,11 @@ Quoter_Generic_Factory_Server::init (int argc, char *argv[], CORBA::Environment&
"The IOR is: <%s>\n",
str.in ()));
- // Register the Quoter GenericFactory with the Naming Service
+ // Register the Quoter GenericFactory with the Naming Service.
TAO_TRY
{
- ACE_DEBUG ((LM_DEBUG,"Trying to get a reference to the Naming Service.\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "Trying to get a reference to the Naming Service.\n"));
// Get the Naming Service object reference.
CORBA::Object_var namingObj_var =
@@ -112,7 +113,8 @@ Quoter_Generic_Factory_Server::init (int argc, char *argv[], CORBA::Environment&
TAO_CHECK_ENV;
- ACE_DEBUG ((LM_DEBUG,"Have a proper reference to the Naming Service.\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "Have a proper reference to the Naming Service.\n"));
// Get the IDL_Quoter naming context.
CosNaming::Name quoterContextName (1); // max = 1
@@ -120,14 +122,16 @@ Quoter_Generic_Factory_Server::init (int argc, char *argv[], CORBA::Environment&
quoterContextName[0].id = CORBA::string_dup ("IDL_Quoter");
CORBA::Object_var quoterNamingObj_var =
- namingContext_var->resolve (quoterContextName, TAO_TRY_ENV);
+ namingContext_var->resolve (quoterContextName,
+ TAO_TRY_ENV);
TAO_CHECK_ENV;
quoterNamingContext_var_ =
CosNaming::NamingContext::_narrow (quoterNamingObj_var.in (),
TAO_TRY_ENV);
- ACE_DEBUG ((LM_DEBUG,"Have a proper reference to the Quoter Naming Context.\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "Have a proper reference to the Quoter Naming Context.\n"));
// Bind the Quoter GenericFactory to the IDL_Quoter naming
// context.
@@ -136,10 +140,11 @@ Quoter_Generic_Factory_Server::init (int argc, char *argv[], CORBA::Environment&
quoter_Generic_Factory_Name_[0].id = CORBA::string_dup ("Quoter_Generic_Factory");
quoterNamingContext_var_->bind (quoter_Generic_Factory_Name_,
- this->quoter_Generic_Factory_Impl_ptr_->_this(TAO_TRY_ENV),
- TAO_TRY_ENV);
+ this->quoter_Generic_Factory_Impl_ptr_->_this(TAO_TRY_ENV),
+ TAO_TRY_ENV);
TAO_CHECK_ENV;
- ACE_DEBUG ((LM_DEBUG,"Bound the Quoter GenericFactory to the Quoter Naming Context.\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "Bound the Quoter GenericFactory to the Quoter Naming Context.\n"));
}
TAO_CATCHANY
{
@@ -162,11 +167,10 @@ Quoter_Generic_Factory_Server::run (CORBA::Environment& env)
return 0;
}
-
// Function get_options.
-unsigned int
-Quoter_Generic_Factory_Server::parse_args ()
+u_int
+Quoter_Generic_Factory_Server::parse_args (void)
{
// We need the 'O' in get_opt () because we also want to have ORB
// parameters, they all start with 'O'.
@@ -202,10 +206,12 @@ main (int argc, char *argv [])
Quoter_Generic_Factory_Server quoter_Generic_Factory_Server;
ACE_DEBUG ((LM_DEBUG,
- "\n\tIDL_Quoter: Quoter_Generic_Factory_Server \n \n"));
+ "\n\tIDL_Quoter: Quoter_Generic_Factory_Server \n\n"));
TAO_TRY
{
- if (quoter_Generic_Factory_Server.init (argc,argv,TAO_TRY_ENV) == -1)
+ if (quoter_Generic_Factory_Server.init (argc,
+ argv,
+ TAO_TRY_ENV) == -1)
return 1;
else
{
diff --git a/TAO/tests/Quoter/Generic_Factory.h b/TAO/tests/Quoter/Generic_Factory.h
index 5288344af70..0e26b94f413 100644
--- a/TAO/tests/Quoter/Generic_Factory.h
+++ b/TAO/tests/Quoter/Generic_Factory.h
@@ -32,24 +32,26 @@ public:
~Quoter_Generic_Factory_Server (void);
// Destructor
- int init (int argc, char *argv[], CORBA::Environment& env);
+ 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
+ // Run the orb.
- unsigned int parse_args ();
- // parse the passed parameters
+ u_int parse_args (void);
+ // Parse the passed parameters.
private:
TAO_ORB_Manager orb_manager_;
// instance of the ORB Manager
Quoter_Generic_Factory_Impl *quoter_Generic_Factory_Impl_ptr_;
- // instance of the Quoter Generic Factory
+ // Instance of the Quoter Generic Factory.
CosNaming::NamingContext_var quoterNamingContext_var_;
- // reference to the Quoter naming context
+ // Reference to the Quoter naming context.
int argc_;
// Number of commandline arguments.
diff --git a/TAO/tests/Quoter/Generic_Factory_Impl.cpp b/TAO/tests/Quoter/Generic_Factory_Impl.cpp
index c340164b61e..438a4f6a287 100644
--- a/TAO/tests/Quoter/Generic_Factory_Impl.cpp
+++ b/TAO/tests/Quoter/Generic_Factory_Impl.cpp
@@ -19,8 +19,7 @@
#include "Generic_Factory_Impl.h"
#include "QuoterC.h"
-static const char usage [] =
-"[-? |\n[-O[RBport] ORB port number]]";
+static const char usage [] = "[-? |\n[-O[RBport] ORB port number]]";
// Constructor
Quoter_Generic_Factory_Impl::Quoter_Generic_Factory_Impl (void)
@@ -34,7 +33,7 @@ Quoter_Generic_Factory_Impl::~Quoter_Generic_Factory_Impl (void)
CORBA::Boolean
-Quoter_Generic_Factory_Impl::supports (const CosLifeCycle::Key & factory_key,
+Quoter_Generic_Factory_Impl::supports (const CosLifeCycle::Key &factory_key,
CORBA::Environment &_env_there)
{
ACE_UNUSED_ARG (factory_key);
@@ -43,8 +42,8 @@ Quoter_Generic_Factory_Impl::supports (const CosLifeCycle::Key & factory_key,
}
CORBA::Object_ptr
-Quoter_Generic_Factory_Impl::create_object (const CosLifeCycle::Key & factory_key,
- const CosLifeCycle::Criteria & the_criteria,
+Quoter_Generic_Factory_Impl::create_object (const CosLifeCycle::Key &factory_key,
+ const CosLifeCycle::Criteria &the_criteria,
CORBA::Environment &_env_there)
{
ACE_UNUSED_ARG (the_criteria);
@@ -54,13 +53,13 @@ Quoter_Generic_Factory_Impl::create_object (const CosLifeCycle::Key & factory_ke
// Get a reference to the ORB.
CORBA::ORB_ptr orb_ptr = TAO_ORB_Core_instance ()->orb ();
- // Get the Naming Service object reference.
- CORBA::Object_var namingObj_var =
- orb_ptr->resolve_initial_references ("NameService");
+ // Get the Naming Service object reference.
+ CORBA::Object_var namingObj_var =
+ orb_ptr->resolve_initial_references ("NameService");
if (CORBA::is_nil (namingObj_var.in ()))
- ACE_ERROR ((LM_ERROR,
- " (%P|%t) Unable get the Naming Service.\n"));
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable get the Naming Service.\n"));
// Narrow the object reference to a Naming Context.
CosNaming::NamingContext_var namingContext_var =
@@ -69,10 +68,10 @@ Quoter_Generic_Factory_Impl::create_object (const CosLifeCycle::Key & factory_ke
// see if there is an exception, if yes then throw the NoFactory exception
if (env_here.exception () != 0) // throw a NoFactory exception
- {
- _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
- return 0;
- }
+ {
+ _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
+ return 0;
+ }
// Get the IDL_Quoter naming context.
CosNaming::Name quoterContextName (1); // max = 1
@@ -84,95 +83,94 @@ Quoter_Generic_Factory_Impl::create_object (const CosLifeCycle::Key & factory_ke
// see if there is an exception, if yes then throw the NoFactory exception
if (env_here.exception () != 0) // throw a NoFactory exception
- {
- _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
- return 0;
- }
+ {
+ _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
+ return 0;
+ }
CosNaming::NamingContext_var quoterNamingContext_var =
CosNaming::NamingContext::_narrow (quoterNamingObj_var.in (),
- env_here);
+ env_here);
- // see if there is an exception, if yes then throw the NoFactory exception
+ // see if there is an exception, if yes then throw the NoFactory
+ // exception.
if (env_here.exception () != 0) // throw a NoFactory exception
- {
- _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
- return 0;
- }
-
+ {
+ _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
+ return 0;
+ }
// ** now a proper reference to the quoter naming context is available
-
- // fill in the name of the Quoter Factory
+ // Fill in the name of the Quoter Factory.
CosNaming::Name factory_Name (1); // max = 1
factory_Name.length (1);
factory_Name[0].id = CORBA::string_dup ("Quoter_Factory");
- // or
- // Take the key supplied to search for a Quoter Factory
+ // or Take the key supplied to search for a Quoter Factory
//CosNaming::Name factoryName = (CosNaming::Name) factory_key;
// Try to get a reference to a Quoter Factory
CORBA::Object_var quoterFactoryObject_var =
quoterNamingContext_var->resolve (factory_Name, env_here);
- // see if there is an exception, if yes then throw the NoFactory exception
+ // see if there is an exception, if yes then throw the NoFactory
+ // exception.
if (env_here.exception () != 0) // throw a NoFactory exception
- {
- _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
- return 0;
- }
+ {
+ _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
+ return 0;
+ }
- // were able to get a reference to Quoter Factory
+ // Were able to get a reference to Quoter Factory.
// Check if it is a valid Quoter Factory reference
if (CORBA::is_nil (quoterFactoryObject_var.in()))
- { // throw a NoFactory exception
- _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
- return 0;
- }
- else {
-
-
- // Check if it is a valid Quoter Factory reference.
- if (CORBA::is_nil (quoterFactoryObject_var.in ())) // throw a NoFactory exception.
- {
+ { // throw a NoFactory exception
_env_there.exception (new CosLifeCycle::NoFactory (factory_key));
return 0;
}
-
-
- Stock::Quoter_Factory_var factory_var =
+ else
+ {
+ // Check if it is a valid Quoter Factory reference.
+ if (CORBA::is_nil (quoterFactoryObject_var.in ())) // throw a NoFactory exception.
+ {
+ _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
+ return 0;
+ }
+
+ Stock::Quoter_Factory_var factory_var =
Stock::Quoter_Factory::_narrow (quoterFactoryObject_var.in (),
env_here);
- // see if there is an exception, if yes then throw the NoFactory exception
- if (env_here.exception () != 0) // throw a NoFactory exception
- {
- _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
- return 0;
- }
+ // see if there is an exception, if yes then throw the NoFactory exception
+ if (env_here.exception () != 0) // throw a NoFactory exception
+ {
+ _env_there.exception (new CosLifeCycle::NoFactory (factory_key));
+ return 0;
+ }
-
- if (CORBA::is_nil (factory_var.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,"invalid factory.\n"),
- 0);
+ if (CORBA::is_nil (factory_var.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "invalid factory.\n"),
+ 0);
- ACE_DEBUG ((LM_DEBUG, "Factory reference OK.\n"));
+ ACE_DEBUG ((LM_DEBUG, "Factory reference OK.\n"));
- // Now retrieve the Quoter obj ref corresponding to the key.
- Stock::Quoter_var quoter_var = factory_var->create_quoter ("test",
- _env_there);
+ // Now retrieve the Quoter obj ref corresponding to the key.
+ Stock::Quoter_var quoter_var = factory_var->create_quoter ("test",
+ _env_there);
- ACE_DEBUG ((LM_DEBUG, "Quoter Created\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "Quoter Created\n"));
- if (CORBA::is_nil (quoter_var))
- ACE_ERROR_RETURN ((LM_ERROR,
- "null quoter objref returned by factory\n"),
- 0);
+ if (CORBA::is_nil (quoter_var))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "null quoter objref returned by factory\n"),
+ 0);
- ACE_DEBUG ((LM_DEBUG,"Return a object reference to a new object.\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "Return a object reference to a new object.\n"));
- return CORBA::Object::_duplicate (quoter_var.ptr());
- }
+ return CORBA::Object::_duplicate (quoter_var.ptr());
+ }
}
diff --git a/TAO/tests/Quoter/Generic_Factory_Impl.h b/TAO/tests/Quoter/Generic_Factory_Impl.h
index d3e1c5935a4..8bbed60bf6a 100644
--- a/TAO/tests/Quoter/Generic_Factory_Impl.h
+++ b/TAO/tests/Quoter/Generic_Factory_Impl.h
@@ -28,17 +28,17 @@ public:
Quoter_Generic_Factory_Impl (void);
~Quoter_Generic_Factory_Impl (void);
- CORBA::Boolean supports (const CosLifeCycle::Key & factory_key,
+ CORBA::Boolean supports (const CosLifeCycle::Key &factory_key,
CORBA::Environment &_env_there);
- // returns true if the Generic Factory is able to forward a request for
- // creating an objct described by k
+ // Returns true if the Generic Factory is able to forward a request
+ // for creating an object described by the <factory_key>.
CORBA::Object_ptr create_object (const CosLifeCycle::Key &factory_key,
- const CosLifeCycle::Criteria & the_criteria,
+ const CosLifeCycle::Criteria &the_criteria,
CORBA::Environment &_env_there);
- // Returns an object reference to a newly created object, though the
- // Generic Factory itself cannot create objects, it will forward the request to
- // a more concrete Factory.
+ // Returns an object reference to a newly created object, though the
+ // Generic Factory itself cannot create objects, it will forward the
+ // request to a more concrete Factory.
};
#endif /* QUOTER_GENERIC_FACTORY_IMPL_H */