1 package org.codehaus.plexus.spring;
\r
4 * Licensed to the Apache Software Foundation (ASF) under one
\r
5 * or more contributor license agreements. See the NOTICE file
\r
6 * distributed with this work for additional information
\r
7 * regarding copyright ownership. The ASF licenses this file
\r
8 * to you under the Apache License, Version 2.0 (the
\r
9 * "License"); you may not use this file except in compliance
\r
10 * with the License. You may obtain a copy of the License at
\r
12 * http://www.apache.org/licenses/LICENSE-2.0
\r
14 * Unless required by applicable law or agreed to in writing,
\r
15 * software distributed under the License is distributed on an
\r
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
\r
17 * KIND, either express or implied. See the License for the
\r
18 * specific language governing permissions and limitations
\r
19 * under the License.
\r
22 import java.io.IOException;
\r
24 import org.springframework.beans.BeansException;
\r
25 import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
\r
26 import org.springframework.context.ApplicationContext;
\r
27 import org.springframework.context.support.ClassPathXmlApplicationContext;
\r
30 * A custom ClassPathXmlApplicationContext to support plexus
\r
31 * <tr>components.xml</tt> descriptors in Spring, with no changes required
\r
32 * to neither plexus nor spring beans.
\r
34 * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
\r
36 public class PlexusClassPathXmlApplicationContext
\r
37 extends ClassPathXmlApplicationContext
\r
40 // TODO enable Field injection...
\r
41 // @see http://forum.springframework.org/showthread.php?t=50181
\r
43 public PlexusClassPathXmlApplicationContext( String path, Class clazz )
\r
44 throws BeansException
\r
46 super( path, clazz );
\r
49 public PlexusClassPathXmlApplicationContext( String configLocation )
\r
50 throws BeansException
\r
52 super( configLocation );
\r
55 public PlexusClassPathXmlApplicationContext( String[] configLocations, ApplicationContext parent )
\r
56 throws BeansException
\r
58 super( configLocations, parent );
\r
61 public PlexusClassPathXmlApplicationContext( String[] configLocations, boolean refresh, ApplicationContext parent )
\r
62 throws BeansException
\r
64 super( configLocations, refresh, parent );
\r
67 public PlexusClassPathXmlApplicationContext( String[] configLocations, boolean refresh )
\r
68 throws BeansException
\r
70 super( configLocations, refresh );
\r
73 public PlexusClassPathXmlApplicationContext( String[] paths, Class clazz, ApplicationContext parent )
\r
74 throws BeansException
\r
76 super( paths, clazz, parent );
\r
79 public PlexusClassPathXmlApplicationContext( String[] paths, Class clazz )
\r
80 throws BeansException
\r
82 super( paths, clazz );
\r
85 public PlexusClassPathXmlApplicationContext( String[] configLocations )
\r
86 throws BeansException
\r
88 super( configLocations );
\r
94 * @see org.springframework.context.support.AbstractXmlApplicationContext#loadBeanDefinitions(org.springframework.beans.factory.xml.XmlBeanDefinitionReader)
\r
96 protected void loadBeanDefinitions( XmlBeanDefinitionReader reader )
\r
97 throws BeansException, IOException
\r
99 reader.setDocumentReaderClass( PlexusBeanDefinitionDocumentReader.class );
\r
100 reader.setValidationMode( XmlBeanDefinitionReader.VALIDATION_NONE );
\r
101 super.loadBeanDefinitions( reader );
\r