summaryrefslogtreecommitdiff
path: root/trunk/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp')
-rw-r--r--trunk/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/trunk/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp b/trunk/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp
new file mode 100644
index 00000000000..59c96439de0
--- /dev/null
+++ b/trunk/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp
@@ -0,0 +1,34 @@
+//
+// $Id$
+//
+
+#include "StockFactory.h"
+#include "ace/streams.h"
+
+StockFactory::StockFactory (CORBA::ORB_ptr orb, int number)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ rhat_ ("RHAT", "RedHat, Inc.", 210),
+ msft_ ("MSFT", "Microsoft, Inc.", 91),
+ number_ (number)
+{
+}
+
+Test::Stock_ptr
+StockFactory::get_stock (const char *symbol)
+ throw (Test::Invalid_Stock_Symbol)
+{
+ cout << "Server Number is " << number_ << endl;
+ if (strcmp (symbol, "RHAT") == 0) {
+ return this->rhat_._this ();
+ } else if (strcmp (symbol, "MSFT") == 0) {
+ return this->msft_._this ();
+ }
+ throw Test::Invalid_Stock_Symbol ();
+}
+
+void
+StockFactory::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}