KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > rift > coad > client > interceptor > iiop > ClientInterceptorIntializer


1 /*
2  * CoadunationClient: The client libraries for Coadunation. (RMI/CORBA)
3  * Copyright (C) 2006 Rift IT Contracting
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * ClientInterceptorIntializer.java
20  *
21  * This object is responsible for initializing the Client interceptors.
22  *
23  * Revision: $ID
24  */

25
26 package com.rift.coad.client.interceptor.iiop;
27
28 // imports
29
import org.omg.CORBA.LocalObject JavaDoc;
30 import org.omg.PortableInterceptor.ORBInitInfo JavaDoc;
31 import org.omg.PortableInterceptor.ORBInitializer JavaDoc;
32 import org.omg.PortableInterceptor.ClientRequestInterceptor JavaDoc;
33 import org.omg.PortableInterceptor.ServerRequestInterceptor JavaDoc;
34
35
36 /**
37  * This object is responsible for initializing the Client interceptors.
38  *
39  * @author Brett Chaldecott
40  */

41 public class ClientInterceptorIntializer extends LocalObject JavaDoc implements
42         ORBInitializer JavaDoc {
43     
44     /**
45      * Creates a new instance of ClientInterceptorIntializer
46      */

47     public ClientInterceptorIntializer() {
48     }
49     
50     
51     /**
52      * Called during ORB initialization.
53      *
54      * @param info The object to add the interceptors to
55      */

56     public void pre_init(ORBInitInfo JavaDoc info) {
57         
58     }
59     
60     
61     /**
62      * Called during ORB initialization.
63      *
64      * @param info The object to add the interceptors to
65      */

66     public void post_init(ORBInitInfo JavaDoc info) {
67         try {
68             info.add_client_request_interceptor(
69                     (ClientRequestInterceptor JavaDoc)new ClientPasswordInterceptor());
70         } catch (Exception JavaDoc ex) {
71             System.out.println("Failed to initialize the interceptor");
72             ex.printStackTrace(System.out);
73         }
74     }
75 }
76
Popular Tags