01: package org.jacorb.orb.portableInterceptor;
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.omg.PortableInterceptor.*;
25: import org.omg.CORBA.UserException;
26: import org.jacorb.orb.standardInterceptors.CodeSetInfoInterceptor;
27: import org.apache.avalon.framework.logger.Logger;
28:
29: /**
30: * IORInterceptorIterator.java
31: *
32: * Created: Mon Apr 17 09:53:33 2000
33: *
34: * @author Nicolas Noffke
35: * $Id: IORInterceptorIterator.java,v 1.12 2006/07/14 12:02:41 nick.cross Exp $
36: */
37:
38: public class IORInterceptorIterator extends AbstractInterceptorIterator {
39: private IORInfoImpl info = null;
40: private int[] profile_tags = null;
41: private final Logger logger;
42:
43: public IORInterceptorIterator(Logger logger,
44: Interceptor[] interceptors) {
45: super (interceptors);
46: this .logger = logger;
47: }
48:
49: public IORInterceptorIterator(Logger logger,
50: Interceptor[] interceptors, int[] ptags) {
51: super (interceptors);
52: profile_tags = ptags;
53: this .logger = logger;
54: }
55:
56: public void iterate(IORInfoImpl info) throws UserException {
57:
58: this .info = info;
59:
60: iterate();
61: }
62:
63: protected void invoke(Interceptor interceptor) throws UserException {
64: try {
65: if (interceptor instanceof CodeSetInfoInterceptor) {
66: ((CodeSetInfoInterceptor) interceptor)
67: .establish_components(info, profile_tags);
68: } else {
69: ((IORInterceptor) interceptor)
70: .establish_components(info);
71: }
72: } catch (Exception e) {
73: logger.error("unexpected exception during invoke", e);
74: }
75: }
76: } // IORInterceptorIterator
|