KickJava   Java API By Example, From Geeks To Geeks.

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


1 package test.interceptor.client_flow;
2
3 import org.jacorb.orb.portableInterceptor.*;
4 import org.omg.PortableInterceptor.*;
5 import java.io.*;
6 /**
7  * ClientInitializer.java
8  *
9  *
10  * Created: Fri Oct 26 10:58:29 2001
11  *
12  * @author Nicolas Noffke
13  * @version $Id: ClientInitializer.java,v 1.1 2001/12/21 10:54:47 nicolas Exp $
14  */

15
16 public class ClientInitializer
17     extends org.jacorb.orb.LocalityConstrainedObject
18     implements ORBInitializer
19 {
20     public ClientInitializer()
21     {
22     }
23
24     // implementation of org.omg.PortableInterceptor.ORBInitializerOperations interface
25

26     /**
27      *
28      * @param param1 <description>
29      */

30     public void pre_init(ORBInitInfo info)
31     {
32     }
33
34     /**
35      *
36      * @param param1 <description>
37      */

38     public void post_init(ORBInitInfo info)
39     {
40         try
41         {
42             info.add_client_request_interceptor( new ClientInterceptorA() );
43
44             BufferedReader br =
45                 new BufferedReader( new FileReader( info.arguments()[0] ));
46
47             // get object reference from command-line argument file
48
org.omg.CORBA.Object JavaDoc obj =
49                ((ORBInitInfoImpl) info).getORB().string_to_object( br.readLine() );
50
51             br.close();
52
53             info.add_client_request_interceptor( new ClientInterceptorB( obj ) );
54         }
55         catch( Exception JavaDoc e )
56         {
57             e.printStackTrace();
58         }
59     }
60 }// ClientInitializer
61

62
Popular Tags