Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / FT_App / FT_TestReplica.idl
blob4200b16b299d09a5232e8afe7bce00087cd8c11d
1 /* -*- IDL -*- */
2 //=============================================================================
3 /**
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>
9 */
10 //=============================================================================
12 #ifndef FT_TESTREPLICA_IDL
13 #define FT_TESTREPLICA_IDL
15 #include "orbsvcs/FT_Replica.idl"
17 module FT_TEST
19 /**
20 * A FT_TEST::Replica provides a test target for a FT::FaultDetector
21 * It is Updateable (and therefore Checkpointable)
22 * and PullMonitorable
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
28 /**
29 * set the counter to an specific value.
30 * @param value is the number to be set.
32 void set(in long value);
34 /**
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);
41 /**
42 * retrieve the current counter.
43 * @returns the value of the counter.
45 long get();
48 /**
49 * enumerate the points at which
50 * the test replica might be convinced to die.
52 enum Bane
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:
62 DURING_IS_ALIVE,
63 DENY_IS_ALIVE,
64 // FT::Updatable interface:
65 DURING_GET_UPDATE,
66 BEFORE_SET_UPDATE,
67 AFTER_SET_UPDATE,
68 // FT::Checkpointable interface:
69 DURING_GET_STATE,
70 BEFORE_SET_STATE,
71 AFTER_SET_STATE,
72 // Reserved
73 CLEAN_EXIT // reserved for use by shutdown
77 /**
78 * die a horrid death.
79 * @param when is an arbitrary code to indicate how and when to die.
81 void die(in Bane when);
84 /**
85 * die a clean death.
87 oneway void shutdown();
89 /**
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
99 /**
100 * die a clean death.
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