2 //=============================================================================
4 * @file FT_TestReplica.idl
6 * This file defines an interface used to test Fault Tolerant CORBA.
8 * @author Dale Wilson <wilson_d@ociweb.com>
10 //=============================================================================
12 #ifndef FT_TESTREPLICA_IDL
13 #define FT_TESTREPLICA_IDL
15 #include
"orbsvcs/FT_Replica.idl"
20 * A FT_TEST::Replica provides a test target for a FT::FaultDetector
21 * It is Updateable (and therefore Checkpointable)
23 * It declares a simple counter that can be set, incremented, and read
24 * via method calls. The counter is also exposed as a property.
26 interface TestReplica
: ::FT
::Updateable
, ::FT
::PullMonitorable
, ::PortableGroup
::TAO_UpdateObjectGroup
29 * set the counter to an specific value.
30 * @param value is the number to be set.
32 void set
(in long value
);
35 * add delta to the counter.
36 * @param delta is the number to be added: (delta may be positive, negative or zero).
37 * @returns the new value of the counter.
39 long increment
(in long delta
);
42 * retrieve the current counter.
43 * @returns the value of the counter.
49 * enumerate the points at which
50 * the test replica might be convinced to die.
54 NOT_YET
, // normal state, also used to revoke a previous request
55 RIGHT_NOW
, // fault immediately during the die() call
56 WHILE_IDLE
, // fault while not processing a request
57 // FT_TestReplica interface:
58 BEFORE_STATE_CHANGE
, // after receiving request
59 BEFORE_REPLICATION
, // after state change
60 BEFORE_REPLY
, // after state replication
61 // FT::PullMonitorable interface:
64 // FT::Updatable interface:
68 // FT::Checkpointable interface:
73 CLEAN_EXIT
// reserved for use by shutdown
79 * @param when is an arbitrary code to indicate how and when to die.
81 void die
(in Bane when
);
87 oneway
void shutdown
();
90 * provide direct access to the counter.
91 * Suports the same functionality as set and get.
92 * Can you say "Encapsulization???" this is a test, remember.
94 attribute
long counter
;
97 interface ReplicaFactory
: ::PortableGroup
::GenericFactory
, ::FT
::PullMonitorable
102 oneway
void shutdown
();
105 ///////////////////////
106 // roles for unit tests
107 // A TestReplica can act as a...
109 // typedef TestReplica Hobbit;
110 // typedef TestReplica Elf;
111 // typedef TestReplica Human;
115 #endif
// for #ifndef FT_TESTREPLICA_IDL