summaryrefslogtreecommitdiff
path: root/ACE/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp')
-rw-r--r--ACE/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/ACE/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp b/ACE/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp
new file mode 100644
index 00000000000..8953bb542ac
--- /dev/null
+++ b/ACE/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp
@@ -0,0 +1,32 @@
+//
+// $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)
+{
+ cout << "Server Number is " << number_ << endl;
+ if (ACE_OS::strcmp (symbol, "RHAT") == 0) {
+ return this->rhat_._this ();
+ } else if (ACE_OS::strcmp (symbol, "MSFT") == 0) {
+ return this->msft_._this ();
+ }
+ throw Test::Invalid_Stock_Symbol ();
+}
+
+void
+StockFactory::shutdown (void)
+{
+ this->orb_->shutdown (0);
+}