Package org.eweb4j.mvc.config.bean

Examples of org.eweb4j.mvc.config.bean.InterConfigBean


            if (interList == null || interList.isEmpty()) {
              error = rebuildXmlFile(configFile, ConfigErrCons.CANNOT_READ_CONFIG_INFO);
            } else {
              for (Iterator<InterConfigBean> it = interList.iterator(); it.hasNext();) {
                InterConfigBean inter = it.next();
                String error1 = CheckConfigBean.checkMVCInterceptor(inter, filePath);
                if (error1 != null) {
                  if (error != null) {
                    error += error1;
                  } else {
                    error = error1;
                  }
                }

              }

              if (error == null) {
                for (Iterator<InterConfigBean> it = interList.iterator(); it.hasNext();) {
                  InterConfigBean inter = it.next();
                  if (!"".equals(inter.getClazz())) {
                    InterConfigBeanCache.add(inter);
                  }
                }

              }
View Full Code Here


    // 按优先级从高到低排序
    Collections.sort(list, new InterPriorityComparator());
   
    final int listSize = list.size();
    for (int index = 0; index < listSize;index++) {
      InterConfigBean inter = list.get(index);
      String _interType = inter.getType();
      if (!interType.equals(_interType))
        continue;
      String uri = this.context.getUri();
      if (uri.length() == 0)
        uri = " ";
     
      if (inter.getExcept().contains(uri))
        continue;
     
      String policy = inter.getPolicy();
      boolean isOR = "or".equalsIgnoreCase(policy) ? true : false;

      List<Uri> uris = inter.getUri();
      final int size = uris.size();
      int result = 1;
     
      for (int i = 0; i < size; i++) {
        Uri u = uris.get(i);
View Full Code Here

  }
 
  public static void main(String[] args){
    List<InterConfigBean> list = new ArrayList<InterConfigBean>();
   
    InterConfigBean i1 = new InterConfigBean();
    i1.setPriority("1");
    list.add(i1);
   
    InterConfigBean i2 = new InterConfigBean();
    i2.setPriority("5");
    list.add(i2);
   
    InterConfigBean i3 = new InterConfigBean();
    i3.setPriority("2");
    list.add(i3);
   
    InterConfigBean i4 = new InterConfigBean();
    i4.setPriority("7");
    list.add(i4);
   
    System.out.println(list);
   
    Collections.sort(list, new InterPriorityComparator());
View Full Code Here

   
    return mvcBean;
  }
 
  public static InterConfigBean getInterBean(){
    InterConfigBean icb = new InterConfigBean();
    List<Uri> urls = new ArrayList<Uri>();
    Uri url = new Uri();
    urls.add(url);
    icb.setUri(urls);
    List<String> excepts = new ArrayList<String>();
    excepts.add("");
    icb.setExcept(excepts);
    return icb;
  }
View Full Code Here

              error = rebuildXmlFile(configFile,
                  "InterConfig.class : 读取不了任何配置文件信息!已经重写了配置文件,请重新填写完整,然后启动框架。");
            } else {
              for (Iterator<InterConfigBean> it = interList
                  .iterator(); it.hasNext();) {
                InterConfigBean inter = it.next();
                String error1 = CheckConfigBean
                    .checkMVCInterceptor(inter, filePath);
                if (error1 != null) {
                  if (error != null) {
                    error += error1;
                  } else {
                    error = error1;
                  }
                }

              }

              if (error == null) {
                for (Iterator<InterConfigBean> it = interList
                    .iterator(); it.hasNext();) {
                  InterConfigBean inter = it.next();
                  if (!"".equals(inter.getClazz())) {
                    InterConfigBeanCache.add(inter);
                  }
                }

              }
View Full Code Here

        return false;
      Uri[] uris = interAnn.uri();
      if (uris == null || uris.length == 0)
        return false;
     
      InterConfigBean inter = new InterConfigBean();
      String name = "".equals(interAnn.name()) ? cls.getSimpleName() : interAnn.name();
      inter.setName(name);
      inter.setClazz(cls.getName());
      inter.setMethod(interAnn.method());
      String[] except = interAnn.except();
      if (except != null && except.length > 0){
        List<String> list = Arrays.asList(except);
        inter.setExcept(new ArrayList<String>(list));
      }
     
      inter.setPolicy(interAnn.policy());
      inter.setType(interAnn.type());
      inter.setPriority(String.valueOf(interAnn.priority()));
      Singleton sin = cls.getAnnotation(Singleton.class);
      if (sin != null)
        inter.setScope("singleton");
      else
        inter.setScope("prototype");
     
      List<org.eweb4j.mvc.config.bean.Uri> uriList = new ArrayList<org.eweb4j.mvc.config.bean.Uri>();
      for (Uri u : uris){
        org.eweb4j.mvc.config.bean.Uri uri = new org.eweb4j.mvc.config.bean.Uri();
        uri.setType(u.type());
        uri.setValue(u.value());
        uriList.add(uri);
      }
      inter.setUri(uriList);
      InterConfigBeanCache.add(inter);
    catch (Error er) {
      log.debug("the interceptor class new instance failued -> " + clsName + " | " + er.toString());
      return false;
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.eweb4j.mvc.config.bean.InterConfigBean

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.