2 //=============================================================================
6 * Quoter example that illustrate the use of the global POA and
7 * the CosLifeCycle service.
10 * @author Darrell Brunsch (brunsch@cs.wustl.edu) Michael Kircher (mk1@cs.wustl.edu)
12 //=============================================================================
15 #include
"orbsvcs/CosLifeCycle.idl"
19 exception Invalid_Stock
{};
20 exception Invalid_Quoter
{};
22 interface Quoter
: CosLifeCycle
::LifeCycleObject
25 // Access Stock information.
27 // Returns the current stock value or throws an exception.
28 long get_quote
(in string stock_name
)
29 raises
(Invalid_Stock
, Invalid_Quoter
);
31 // LifeCycleObject copy(in FactoryFinder there,
32 // in Criteria the_criteria)
33 // raises(NoFactory, NotCopyable, InvalidCriteria, CannotMeetCriteria);
34 // copies this object to a location "there" using the "the_criteria"
36 // void move(in FactoryFinder there,
37 // in Criteria the_criteria)
38 // raises(NoFactory, NotMovable, InvalidCriteria, CannotMeetCriteria);
39 // moves this object to a location "there" using the "the_criteria"
42 // raises(NotRemovable);
43 // removes/deletes this object
47 interface Quoter_Factory
50 // Creation of Quoter objects
52 Quoter create_quoter
(in string name
)
53 raises
(Invalid_Quoter
);
54 // Returns a new Quoter selected by name e.g., "Dow Jones,"
58 interface Quoter_Factory_Finder
: CosLifeCycle
::FactoryFinder
61 // Wrapper for the CosLifeCycle FactoryFinder
64 // Factories find_factories(in Key factory_key) raises(NoFactory);
67 interface Quoter_Generic_Factory
: CosLifeCycle
::GenericFactory
70 // Wrapper for the CosLifeCycle GenericFactory
73 // boolean supports(in Key k);
74 // Object create_object(in Key k, in Criteria the_criteria)
75 // raises (NoFactory, InvalidCriteria, CannotMeetCriteria);
78 interface Quoter_Life_Cycle_Service
: CosLifeCycle
::GenericFactory
81 // Wrapper for the CosLifeCycle GenericFactory
84 // boolean supports(in Key k);
85 // Object create_object(in Key k, in Criteria the_criteria)
86 // raises (NoFactory, InvalidCriteria, CannotMeetCriteria);
88 void register_factory
(in string name
,
90 in string description
,
92 // provide an method for registering factories with their properties
95 interface Criteria_Evaluator
101 // Interface description for an evaluator of CosLifeCycle
102 // Criterias. It is mainly a wrapper, which should make
105 typedef sequence
<CosLifeCycle
::NameValuePair
> SeqNamedValuePair
;
107 typedef CosLifeCycle
::Criteria Criteria
;
109 exception NotAvailable
{ string reason
; };
110 // raised if the questioned configuration is not available
112 SeqNamedValuePair getInitialization
();
113 // get the initialization
116 // get a filter string
118 SeqNamedValuePair getLogicalLocation
();
119 // get the logical location
121 string getPreferences
();
122 // get the preferences, not implemented
124 void setCriteria
(in Criteria criteria_
);
125 // set the Criteria which is searched for keywords