1 /*2 * Beans.java3 *4 * Created on Antradienis, 2004, Rugsėjo 28, 17.555 */6 7 package albel.tags.table.utils;8 9 /**10 *11 * @author Albertas Laurinav12 */13 import org.springframework.beans.factory.BeanFactory;14 import org.springframework.context.support.ClassPathXmlApplicationContext;15 import org.springframework.beans.factory.BeanFactory;16 public class Beans {17 18 private static Beans beans;19 private ClassPathXmlApplicationContext cpx;20 /** Creates a new instance of Beans */21 private Beans() {22 cpx=new ClassPathXmlApplicationContext("TableTagContext.xml");23 }24 public BeanFactory getFactory()25 {26 return (BeanFactory)cpx;27 }28 public static Object getBean(String id)29 {30 if(beans==null)31 beans=new Beans();32 Object bean=beans.getFactory().getBean(id);33 return bean;34 }35 }36