Package org.nutz.mvc.annotation

Examples of org.nutz.mvc.annotation.IocBy.type()


  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()));
View Full Code Here


    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

    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()));
View Full Code Here

        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

  @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

    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());
    }
   
    public static void makeIoc(Class<? extends IocProvider> clazz, String[] args) {
View Full Code Here

        if (ib == null)
            throw new IllegalArgumentException("Need IocBy!!");
        if (log.isDebugEnabled())
            log.debugf("@IocBy(%s)", ib.type().getName());

        makeIoc(ib.type(), ib.args());
    }
   
    public static void makeIoc(Class<? extends IocProvider> clazz, String[] args) {
        final ServletContext context = Mvcs.getServletContext();
        NutConfig config = new AbstractNutConfig(context) {
View Full Code Here

    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()));
View Full Code Here

        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.