Examples of IocBy


Examples of org.nutz.mvc.annotation.IocBy

    return makers;
  }

  private void createIoc(NutConfig config, Class<?> mainModule) throws Exception {
    IocBy ib = mainModule.getAnnotation(IocBy.class);
    if (null != ib) {
      if (log.isDebugEnabled())
        log.debugf("@IocBy(%s)", ib.type().getName());

      Ioc ioc = Mirror.me(ib.type()).born().create(config, ib.args());
      // 如果是 Ioc2 的实现,增加新的 ValueMaker
      if (ioc instanceof Ioc2) {
        ((Ioc2) ioc).addValueProxyMaker(new ServletValueProxyMaker(config.getServletContext()));
      }
      // 保存 Ioc 对象
View Full Code Here

Examples of org.nutz.mvc.annotation.IocBy

        return makers;
    }

    private void createIoc(NutConfig config, Class<?> mainModule) throws Exception {
        IocBy ib = mainModule.getAnnotation(IocBy.class);
        if (null != ib) {
            if (log.isDebugEnabled())
                log.debugf("@IocBy(%s)", ib.type().getName());

            Ioc ioc = Mirror.me(ib.type()).born().create(config, ib.args());
            // 如果是 Ioc2 的实现,增加新的 ValueMaker
            if (ioc instanceof Ioc2) {
                ((Ioc2) ioc).addValueProxyMaker(new ServletValueProxyMaker(config.getServletContext()));
            }
            // 保存 Ioc 对象
View Full Code Here

Examples of org.nutz.mvc.annotation.IocBy

  }

  @SuppressWarnings("unchecked")
  public void initIoc() {
    // 检查Ioc支持
    IocBy iocBy = (IocBy) mirror.getAnnotation(IocBy.class);
    if (iocBy != null)
      ioc = Mirror.me(iocBy.type()).born().create(null, iocBy.args());
    else
      ioc = null;
    // 打印调试信息
    if (log.isDebugEnabled()) {
      if (ioc == null)
View Full Code Here

Examples of org.nutz.mvc.annotation.IocBy

        log.warn("No Ioc found!!");
        throw new RuntimeException("NutIoc not found!!");
    }
   
    public static void makeIoc(String mainModule) throws ClassNotFoundException {
        IocBy ib = Class.forName(mainModule).getAnnotation(IocBy.class);
        if (ib == null)
            throw new IllegalArgumentException("Need IocBy!!");
        if (log.isDebugEnabled())
            log.debugf("@IocBy(%s)", ib.type().getName());

        makeIoc(ib.type(), ib.args());
    }
View Full Code Here

Examples of org.nutz.mvc.annotation.IocBy

        return makers;
    }

    protected Ioc createIoc(NutConfig config, Class<?> mainModule) throws Exception {
        IocBy ib = mainModule.getAnnotation(IocBy.class);
        if (null != ib) {
            if (log.isDebugEnabled())
                log.debugf("@IocBy(type=%s, args=%s)", ib.type().getName(), Json.toJson(ib.args()));

            Ioc ioc = Mirror.me(ib.type()).born().create(config, ib.args());
            // 如果是 Ioc2 的实现,增加新的 ValueMaker
            if (ioc instanceof Ioc2) {
                ((Ioc2) ioc).addValueProxyMaker(new ServletValueProxyMaker(config.getServletContext()));
            }
            // 保存 Ioc 对象
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.