BeanFactoryResourceLocator.java :  » Workflow-Engines » osbl-1_0 » org » concern » controller » spring » Java Open Source

Java Open Source » Workflow Engines » osbl 1_0 
osbl 1_0 » org » concern » controller » spring » BeanFactoryResourceLocator.java
/*
 * $Id: BeanFactoryResourceLocator.java 525 2005-09-20 15:48:12Z hengels $
 * (c) Copyright 2004 con:cern development team.
 *
 * This file is part of con:cern (http://concern.org).
 *
 * con:cern is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1
 * of the License, or (at your option) any later version.
 *
 * Please see COPYING for the complete licence.
 */
package org.concern.controller.spring;

import org.concern.controller.ResourceLocator;

import org.concern.controller.Controller;
import org.springframework.beans.factory.BeanFactory;

public class BeanFactoryResourceLocator
    implements ResourceLocator
{
    private BeanFactory beanFactory;

    public BeanFactoryResourceLocator() {
    }

    public BeanFactoryResourceLocator(BeanFactory beanFactory) {
        this.beanFactory = beanFactory;
    }

    public Object lookup(String name) {
        if ("beanFactory".equals(name))
            return beanFactory;
        return beanFactory.getBean(name);
    }

    public void setController(Controller controller) {
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.