001/*
002 * Copyright 2002-2012 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.context.access;
018
019import org.springframework.beans.FatalBeanException;
020import org.springframework.beans.factory.access.BeanFactoryLocator;
021
022/**
023 * A factory class to get a default ContextSingletonBeanFactoryLocator instance.
024 *
025 * @author Colin Sampaleanu
026 * @see org.springframework.context.access.ContextSingletonBeanFactoryLocator
027 */
028public class DefaultLocatorFactory {
029
030        /**
031         * Return an instance object implementing BeanFactoryLocator. This will normally
032         * be a singleton instance of the specific ContextSingletonBeanFactoryLocator class,
033         * using the default resource selector.
034         */
035        public static BeanFactoryLocator getInstance() throws FatalBeanException {
036                return ContextSingletonBeanFactoryLocator.getInstance();
037        }
038
039        /**
040         * Return an instance object implementing BeanFactoryLocator. This will normally
041         * be a singleton instance of the specific ContextSingletonBeanFactoryLocator class,
042         * using the specified resource selector.
043         * @param selector a selector variable which provides a hint to the factory as to
044         * which instance to return.
045         */
046        public static BeanFactoryLocator getInstance(String selector) throws FatalBeanException {
047                return ContextSingletonBeanFactoryLocator.getInstance(selector);
048        }
049}