KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > interceptor > client_flow > ClientInterceptorB


1 package test.interceptor.client_flow;
2
3 import org.omg.PortableInterceptor.*;
4
5 /**
6  * ClientInterceptor.java
7  *
8  *
9  * Created: Fri Oct 26 11:04:19 2001
10  *
11  * @author Nicolas Noffke
12  * @version $Id: ClientInterceptorB.java,v 1.1 2001/12/21 10:54:48 nicolas Exp $
13  */

14
15 public class ClientInterceptorB
16     extends org.jacorb.orb.LocalityConstrainedObject
17     implements ClientRequestInterceptor
18 {
19     private org.omg.CORBA.Object JavaDoc forward = null;
20     private boolean triggered = false;
21
22     public ClientInterceptorB( org.omg.CORBA.Object JavaDoc forward )
23     {
24         this.forward = forward;
25     }
26
27     public String JavaDoc name()
28     {
29         return "B";
30     }
31
32     public void destroy()
33     {
34     }
35
36     public void send_request( ClientRequestInfo ri )
37         throws ForwardRequest
38     {
39         System.out.println("ClientInterceptor B: send_request");
40         
41         if( ! triggered )
42         {
43             triggered = true;
44
45             System.out.println("ClientInterceptor B: throwing ForwardRequest");
46          
47             throw new ForwardRequest( forward,
48                                       false );
49         }
50     }
51
52     public void send_poll(ClientRequestInfo ri)
53     {
54     }
55
56     public void receive_reply(ClientRequestInfo ri)
57     {
58     }
59
60     public void receive_exception(ClientRequestInfo ri)
61         throws ForwardRequest
62     {
63     }
64
65     public void receive_other(ClientRequestInfo ri)
66         throws ForwardRequest
67     {
68         System.out.println("ClientInterceptor B: receive_other");
69     }
70 }// ClientInterceptor
71
Popular Tags