01: /*****************************************************************************
02: * Copyright (C) NanoContainer Organization. All rights reserved. *
03: * ------------------------------------------------------------------------- *
04: * The software in this package is published under the terms of the BSD *
05: * style license a copy of which has been included with this distribution in *
06: * the LICENSE.txt file. *
07: * *
08: * Original code by James Strachan *
09: *****************************************************************************/package org.nanocontainer.script.groovy.buildernodes;
10:
11: import java.util.Map;
12:
13: import org.nanocontainer.NanoContainer;
14: import org.nanocontainer.DefaultNanoContainer;
15:
16: /**
17: * @author Paul Hammant
18: * @version $Revision: 2695 $
19: */
20: public class ClassLoaderNode extends AbstractBuilderNode {
21:
22: public static final String NODE_NAME = "classLoader";
23:
24: public ClassLoaderNode() {
25: super (NODE_NAME);
26: }
27:
28: public Object createNewNode(Object current, Map attributes) {
29:
30: NanoContainer nanoContainer = (NanoContainer) current;
31: return new DefaultNanoContainer(nanoContainer
32: .getComponentClassLoader(), nanoContainer.getPico());
33: }
34:
35: }
|