01: package org.jacorb.orb.standardInterceptors;
02:
03: /*
04: * JacORB - a free Java ORB
05: *
06: * Copyright (C) 1999-2004 Gerald Brose
07: *
08: * This library is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU Library General Public
10: * License as published by the Free Software Foundation; either
11: * version 2 of the License, or (at your option) any later version.
12: *
13: * This library is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: * Library General Public License for more details.
17: *
18: * You should have received a copy of the GNU Library General Public
19: * License along with this library; if not, write to the Free
20: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21: *
22: */
23:
24: import org.apache.avalon.framework.logger.*;
25:
26: import org.omg.CORBA.INTERNAL;
27: import org.omg.PortableInterceptor.*;
28:
29: import org.jacorb.orb.*;
30: import org.jacorb.config.Configuration;
31:
32: /**
33: * This class initializes the default IOR interceptors
34: * used by JacORB.
35: *
36: * @author Nicolas Noffke
37: * @version $Id: IORInterceptorInitializer.java,v 1.21 2006/07/14 12:02:41 nick.cross Exp $
38: */
39:
40: public class IORInterceptorInitializer extends
41: org.omg.CORBA.LocalObject implements ORBInitializer {
42: /**
43: * Adds the CodeSetInfoInterceptor
44: * to the set of IORInterceptors.
45: *
46: * @param info the info object.
47: */
48: public void post_init(ORBInitInfo info) {
49: final ORB orb = ((org.jacorb.orb.portableInterceptor.ORBInitInfoImpl) info)
50: .getORB();
51: final Configuration config = orb.getConfiguration();
52: final Logger logger = config
53: .getNamedLogger("org.jacorb.interceptors.ior_init");
54:
55: try {
56: int giop_minor = config.getAttributeAsInteger(
57: "jacorb.giop_minor_version", 2);
58:
59: if (giop_minor > 0) {
60: info
61: .add_ior_interceptor(new CodeSetInfoInterceptor(
62: orb));
63: }
64: } catch (Exception e) {
65: logger.error("unexpected exception", e);
66: throw new INTERNAL(e.toString());
67: }
68: }
69:
70: public void pre_init(ORBInitInfo info) {
71: // do nothing
72: }
73:
74: } // IORInterceptorInitializer
|