2 //=============================================================================
6 * @author Carlos O'Ryan
8 //=============================================================================
19 class Peer_Handler_i
: public POA_AMI_PeerHandler
23 Peer_Handler_i (Peer_i
*peer
);
25 virtual void request (CORBA::Long retval
);
27 virtual void request_excep (::Messaging::ExceptionHolder
* excep_holder
);
29 virtual void start ();
31 virtual void shutdown ();
34 /// The real implementation
38 class Peer_i
: public POA_Peer
47 void init (CORBA::ORB_ptr orb
,
48 Progress_ptr progress
,
49 const ACE_Time_Value
&delay
);
51 /// Used by the Reply_Handler to indicate that a reply has been
53 void reply (CORBA::Long result
);
55 // = See test.idl for an explanation of these methods.
56 CORBA::Long
request (CORBA::Long id
);
58 void start (const PeerSet
& the_peers
,
59 CORBA::Long iterations
);
65 Peer_Handler_i reply_handler_
;
70 /// The interface to report back progress.
71 Progress_var progress_
;
73 /// The delay on each request
74 ACE_Time_Value delay_
;
76 /// The id assigned by the progress interface
83 * Run a "start" request on a separate thread.
85 class Peer_Task
: public ACE_Task_Base
88 Peer_Task (const PeerSet
& the_peers
,
89 CORBA::Long iterations
,
90 Progress_ptr progress
,
91 AMI_PeerHandler_ptr handler
,
94 /// The thread entry point
101 /// The number of iterations
102 CORBA::Long iterations_
;
104 /// To report progress
105 Progress_var progress_
;
107 /// To issue async requests
108 AMI_PeerHandler_var handler_
;
114 #endif /* PEER_I_H */