01: /*
02: * JacORB - a free Java ORB
03: *
04: * Copyright (C) 1999-2004 Gerald Brose
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Library General Public
08: * License as published by the Free Software Foundation; either
09: * version 2 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Library General Public License for more details.
15: *
16: * You should have received a copy of the GNU Library General Public
17: * License along with this library; if not, write to the Free
18: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19: *
20: */
21:
22: package org.jacorb.notification.container;
23:
24: import org.picocontainer.ComponentAdapter;
25: import org.picocontainer.MutablePicoContainer;
26: import org.picocontainer.PicoContainer;
27: import org.picocontainer.PicoInitializationException;
28: import org.picocontainer.PicoIntrospectionException;
29: import org.picocontainer.defaults.AssignabilityRegistrationException;
30: import org.picocontainer.defaults.DecoratingComponentAdapter;
31: import org.picocontainer.defaults.DefaultPicoContainer;
32:
33: /**
34: * @author Alphonse Bendt
35: * @version $Id: LocalParameterComponentAdapter.java,v 1.3 2006/07/03 12:51:42 alphonse.bendt Exp $
36: */
37: public class LocalParameterComponentAdapter extends
38: DecoratingComponentAdapter {
39: private static final long serialVersionUID = 1L;
40: private final ComponentAdapter[] helperCAs_;
41:
42: public LocalParameterComponentAdapter(ComponentAdapter delegate,
43: ComponentAdapter[] helpers)
44: throws AssignabilityRegistrationException {
45: super (delegate);
46:
47: helperCAs_ = helpers;
48: }
49:
50: public Object getComponentInstance(PicoContainer container)
51: throws PicoInitializationException,
52: PicoIntrospectionException {
53: final MutablePicoContainer _helperContainer = new DefaultPicoContainer(
54: container);
55: for (int i = 0; i < helperCAs_.length; ++i) {
56: _helperContainer.registerComponent(helperCAs_[i]);
57: }
58:
59: return super .getComponentInstance(_helperContainer);
60: }
61:
62: public void verify(PicoContainer container)
63: throws PicoIntrospectionException {
64: // empty
65: }
66: }
|