01: /*
02: * CoadunationClient: The client libraries for Coadunation. (RMI/CORBA)
03: * Copyright (C) 2006 Rift IT Contracting
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
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;
30: import org.omg.PortableInterceptor.ORBInitInfo;
31: import org.omg.PortableInterceptor.ORBInitializer;
32: import org.omg.PortableInterceptor.ClientRequestInterceptor;
33: import org.omg.PortableInterceptor.ServerRequestInterceptor;
34:
35: /**
36: * This object is responsible for initializing the Client interceptors.
37: *
38: * @author Brett Chaldecott
39: */
40: public class ClientInterceptorIntializer extends LocalObject implements
41: ORBInitializer {
42:
43: /**
44: * Creates a new instance of ClientInterceptorIntializer
45: */
46: public ClientInterceptorIntializer() {
47: }
48:
49: /**
50: * Called during ORB initialization.
51: *
52: * @param info The object to add the interceptors to
53: */
54: public void pre_init(ORBInitInfo info) {
55:
56: }
57:
58: /**
59: * Called during ORB initialization.
60: *
61: * @param info The object to add the interceptors to
62: */
63: public void post_init(ORBInitInfo info) {
64: try {
65: info
66: .add_client_request_interceptor((ClientRequestInterceptor) new ClientPasswordInterceptor());
67: } catch (Exception ex) {
68: System.out.println("Failed to initialize the interceptor");
69: ex.printStackTrace(System.out);
70: }
71: }
72: }
|