Package org.eweb4j.ioc.config.bean

Examples of org.eweb4j.ioc.config.bean.IOCConfigBean


      LogFactory.getIOCLogger("INFO").write(info);
    }
  }

  public static IOCConfigBean get(String beanID) {
    IOCConfigBean o = null;
    if (ht.containsKey(beanID))
      o = ht.get(beanID);

    return o;
  }
View Full Code Here


    return o;
  }

  public static IOCConfigBean get(Class<?> clazz) {
    IOCConfigBean o = null;
    if (ht.containsKey(clazz))
      o = ht.get(clazz);

    return o;
  }
View Full Code Here

      log.debug(info);
    }
  }

  public static IOCConfigBean get(String beanID) {
    IOCConfigBean o = null;
    if (ht.containsKey(beanID))
      o = ht.get(beanID);

    return o;
  }
View Full Code Here

    return o;
  }

  public static IOCConfigBean get(Class<?> clazz) {
    IOCConfigBean o = null;
    if (ht.containsKey(clazz))
      o = ht.get(clazz);

    return o;
  }
View Full Code Here

                        Class<?>[] args = null;
                        List<Object> initargList = new ArrayList<Object>();
                        List<Class<?>> argList = new ArrayList<Class<?>>();
                        // 遍历配置文件,找出beanID的bean
                        if (IOCConfigBeanCache.containsKey(beanID)) {
                                IOCConfigBean iocBean = IOCConfigBeanCache.get(beanID);
                                // 取出该bean的类型,便于最后使用反射调用构造方法实例化
                                Class<T> clazz = (Class<T>) Class.forName(iocBean.getClazz());
                                // 判断该bean的生命周期
                                if (IOCConfigConstant.SINGLETON_SCOPE.equalsIgnoreCase(iocBean
                                                .getScope())) {
                                        // 如果是单件,就从单件缓存池中取
                                        if (SingleBeanCache.containsKey(beanID)) {
                                                t = (T) SingleBeanCache.get(beanID);
                                                return t;
                                        }
                                }
                                // 如果单件缓存池中没有,就创建新的对象
                                t = clazz.newInstance();
                                // 添加到单件缓存池中 t这个引用会在下面重新实例化
                                SingleBeanCache.add(beanID, t);

                                // 遍历每个bean的注入配置
                                for (Iterator<Injection> it = iocBean.getInject().iterator(); it
                                                .hasNext();) {
                                        Injection inj = it.next();
                                        String ref = inj.getRef();
                                        if (ref != null && !"".equals(ref)) {
                                                // 如果ref不为空,说明注入的是对象类型,后面需要进入递归
View Full Code Here

      Class<?>[] args = null;
      List<Object> initargList = new ArrayList<Object>();
      List<Class<?>> argList = new ArrayList<Class<?>>();
      // 遍历配置文件,找出beanID的bean
      if (IOCConfigBeanCache.containsKey(beanID)) {
        IOCConfigBean iocBean = IOCConfigBeanCache.get(beanID);
        // 取出该bean的类型,便于最后使用反射调用构造方法实例化
        Class<T> clazz = (Class<T>) Class.forName(iocBean.getClazz());
        // 判断该bean的生命周期
        if (IOCConfigConstant.SINGLETON_SCOPE.equalsIgnoreCase(iocBean
            .getScope())) {
          // 如果是单件,就从单件缓存池中取
          if (SingleBeanCache.containsKey(beanID)) {
            t = (T) SingleBeanCache.get(beanID);
            return t;
          }
        }
        // 如果单件缓存池中没有,就创建新的对象
        t = clazz.newInstance();
        // 添加到单件缓存池中 t这个引用会在下面重新实例化
        SingleBeanCache.add(beanID, t);

        // 遍历每个bean的注入配置
        for (Iterator<Injection> it = iocBean.getInject().iterator(); it
            .hasNext();) {
          Injection inj = it.next();
          String ref = inj.getRef();
          if (ref != null && !"".equals(ref)) {
            // 如果ref不为空,说明注入的是对象类型,后面需要进入递归
View Full Code Here

* @since v1.a.0
*
*/
public class IOCConfigBeanCreator {
  public static IOCConfigBean getIOCBean(){
    IOCConfigBean iocBean = null;
    iocBean = new IOCConfigBean();
    List<Injection> list = new ArrayList<Injection>();
    Injection depen = new Injection();
    list.add(depen);
    iocBean.setInject(list);
    return iocBean;
  }
View Full Code Here

TOP

Related Classes of org.eweb4j.ioc.config.bean.IOCConfigBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.