1. /*
  2. * Created on Jan 26, 2004
  3. *
  4. * To change the template for this generated file go to
  5. * Window - Preferences - Java - Code Generation - Code and Comments
  6. */
  7. /*
  8. * Copyright 2002-2004 the original author or authors.
  9. *
  10. * Licensed under the Apache License, Version 2.0 (the "License");
  11. * you may not use this file except in compliance with the License.
  12. * You may obtain a copy of the License at
  13. *
  14. * http://www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an "AS IS" BASIS,
  18. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. * See the License for the specific language governing permissions and
  20. * limitations under the License.
  21. */
  22. package org.springframework.context.access;
  23. import org.springframework.beans.BeansException;
  24. import org.springframework.beans.factory.access.BeanFactoryReference;
  25. import org.springframework.beans.factory.access.JndiBeanFactoryLocator;
  26. import org.springframework.context.support.ClassPathXmlApplicationContext;
  27. /**
  28. * Subclass of JndiBeanFactoryLocator which creates a
  29. * ClassPathXmlApplicationContext instead of a BeanFactory.
  30. * @author Colin Sampaleanu
  31. * @version $Id: ContextJndiBeanFactoryLocator.java,v 1.2 2004/03/18 02:46:13 trisberg Exp $
  32. */
  33. public class ContextJndiBeanFactoryLocator extends JndiBeanFactoryLocator {
  34. protected BeanFactoryReference createBeanFactory(String[] resources) throws BeansException {
  35. return new ContextBeanFactoryReference(new ClassPathXmlApplicationContext(resources));
  36. }
  37. }