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),
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 ();
26 StockFactory::shutdown ()
28 this->orb_
->shutdown (false);