Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / examples / LoadBalancing / StockFactory.cpp
blobadfb7e71d9af4424e508030da1f3105eb1b95937
2 #include "StockFactory.h"
3 #include "ace/streams.h"
5 StockFactory::StockFactory (CORBA::ORB_ptr orb, int number)
6 : orb_ (CORBA::ORB::_duplicate (orb)),
7 rhat_ ("RHAT", "RedHat, Inc.", 210),
8 msft_ ("MSFT", "Microsoft, Inc.", 91),
9 number_ (number)
13 Test::Stock_ptr
14 StockFactory::get_stock (const char *symbol)
16 cout << "Server Number is " << number_ << endl;
17 if (ACE_OS::strcmp (symbol, "RHAT") == 0) {
18 return this->rhat_._this ();
19 } else if (ACE_OS::strcmp (symbol, "MSFT") == 0) {
20 return this->msft_._this ();
22 throw Test::Invalid_Stock_Symbol ();
25 void
26 StockFactory::shutdown (void)
28 this->orb_->shutdown (0);