Package jodd.madvoc

Examples of jodd.madvoc.MadvocException


      // checks

      if (inout != null) {
        if (in != null || out != null) {
          throw new MadvocException("@InOut can not be used with @In or @Out: " + pd.getClassDescriptor().getClass() + '#' + pd.getName());
        }
      }


      // inspect all
View Full Code Here


    try {
      Constructor ctor = type.getDeclaredConstructor(null);
      ctor.setAccessible(true);
      value = ctor.newInstance();
    } catch (Exception ex) {
      throw new MadvocException(ex);
    }
  }
View Full Code Here

    String fileName = madvocConfig.getRoutesFileName();

    URL url = ClassLoaderUtil.getResourceUrl("/" + fileName);

    if (url == null) {
      throw new MadvocException("Routes file not found: " + fileName);
    }

    InputStream in = null;
    String routes;
    try {
      in = url.openStream();

      char[] chars = StreamUtil.readChars(in, StringPool.UTF_8);
      routes = new String(chars);
    }
    catch (IOException ioex) {
      throw new MadvocException(ioex);
    }
    finally {
      StreamUtil.close(in);
    }

    try {
      parse(routes);
    } catch (Exception ex) {
      throw new MadvocException(ex);
    }
  }
View Full Code Here

        if (ReflectUtil.isTypeOf(chunkClass, ActionWrapper.class)) {
          wrappers = ArraysUtil.append(wrappers, chunkClass);
          continue;
        }

        throw new MadvocException("Unsupported type: " + chunk);
      }

      // http method
      if chunk.equals(Action.GET) ||
          chunk.equals(Action.HEAD) ||
          chunk.equals(Action.POST) ||
          chunk.equals(Action.PUT) ||
          chunk.equals(Action.DELETE) ||
          chunk.equals(Action.TRACE) ||
          chunk.equals(Action.OPTIONS) ||
          chunk.equals(Action.CONNECT) ||
          chunk.equals(Action.PATCH)
        ) {

        action.httpMethod(chunk);
        continue;
      }

      // last remaining unprocessed chunk is an alias
      action.alias(chunk);
    }

    // process wrappers

    if (wrappers.length == 0) {
      wrappers = currentWrappers;
    }


    for (Class<? extends ActionWrapper> wrapper : wrappers) {
      if (ReflectUtil.isTypeOf(wrapper, ActionInterceptor.class)) {
        action.interceptBy((Class<? extends ActionInterceptor>) wrapper);
      }
      else if (ReflectUtil.isTypeOf(wrapper, ActionFilter.class)) {
        action.filterBy((Class<? extends ActionFilter>) wrapper);
      }
      else {
        throw new MadvocException("Invalid wrapper: " + wrapper.getName());
      }
    }

    if (action.isSet()) {
      action.bind();
View Full Code Here

    rulesEntries.smartMode();

    try {
      scanPaths(classpath);
    } catch (Exception ex) {
      throw new MadvocException("Scan classpath error", ex);
    }
    elapsed = System.currentTimeMillis() - elapsed;
    log.info("Madvoc configured in " + elapsed + " ms. Total actions: " + actionsManager.getActionsCount());
  }
View Full Code Here

    String entryName = entryData.getName();
    if (entryName.endsWith(actionClassSuffix) == true) {
      try {
        onActionClass(entryName);
      } catch (ClassNotFoundException cnfex) {
        throw new MadvocException("Invalid Madvoc action class: " + entryName, cnfex);
      }
    } else if (entryName.endsWith(resultClassSuffix) == true) {
      try {
        onResultClass(entryName);
      } catch (ClassNotFoundException cnfex) {
        throw new MadvocException("Invalid Madvoc result class: " + entryName, cnfex);
      }
    }
  }
View Full Code Here

TOP

Related Classes of jodd.madvoc.MadvocException

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.