Java tutorial
/** * This file is part of JFileQueueManager. * JFileQueueManager is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JFileQueueManager is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with JFileQueueManager. If not, see <http://www.gnu.org/licenses/>. * * ( ? JFileQueueManager. * * JFileQueueManager - ?? : ??? / * ? ?? ? GNU , * ? ??; * ? 3 , ( ) * ?. * * JFileQueueManager ????? , , * ???; ? ?? ? * ? ?? . ?. * ? GNU. * * ? GNU * ? ? ? . ? ? , ?. * <http://www.gnu.org/licenses/>.) */ package org.bitbucket.ab.jfqm.config; import java.util.List; import org.bitbucket.ab.jfqm.task.ITaskInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.support.ClassPathXmlApplicationContext; /** * @author Dmitry Myasnikov <saver_is_not@bk.ru> * @author Victor Letovaltsev <Z_U_B_R_U_S@mail.ru> * */ @Deprecated public class ConfigBean implements IConfigBean { List<ITaskInfo> tasks; private static IConfigBean config = null; @Autowired public List<ITaskInfo> getTasks() { // TODO Auto-generated method stub return tasks; } @Autowired public void setTasks(List<ITaskInfo> tasks) { // TODO Auto-generated method stub this.tasks = tasks; } private ConfigBean() { } synchronized static public IConfigBean getInstance() { if (config == null) { ClassPathXmlApplicationContext beanFactory = new ClassPathXmlApplicationContext("config.xml"); config = (IConfigBean) beanFactory.getBean("configTaskList"); } return config; } }