Package net.infopeers.restrant

Examples of net.infopeers.restrant.ResourceNotFoundException


     
      return method;
    }
   
    if(defaultMethod == null){
      throw new ResourceNotFoundException("Method not found: " + cls.getName() + "#" + methodName);
    }
   
    return defaultMethod;
  }
View Full Code Here


    Params params = pm.getSelectedParam();
    PatternParser selectedParser = pm.getSelectedParser();
    logger.log(Level.FINE, "selectedParser: " + selectedParser);

    if (params == null) {
      throw new ResourceNotFoundException(path + "に対応するフォーマットがありません");
    }

    String controllerName = params.get(CONTROLLER_PLACEHOLDER_LABEL);
    if (controllerName == null) {
      throw new RuntimeException(selectedParser + "でコントローラが取得できません");
    }

    String actionName = params.get(ACTION_PLACEHOLDER_LABEL);
    if (actionName == null) {
      throw new RuntimeException(selectedParser + "でアクションが取得できません");
    }

    String fullClassName = getFullControllerClassName(controllerName, rootPackage);

    try {
      Class<?> clazz = Class.forName(fullClassName);
      Controller controller = (Controller) clazz.newInstance();
      return new ReflectInvoker(servlet, controller, actionName, params);

    } catch (ClassNotFoundException e) {
      throw new RuntimeException(path + "に対応する" + fullClassName
          + "クラスが見つかりません", e);
    } catch (IllegalAccessException e) {
      throw new RuntimeException(e);
    } catch (InstantiationException e) {
      throw new RuntimeException(e);
    } catch (ResourceNotFoundException e){
      throw new ResourceNotFoundException("Resource not found for " + selectedParser, e);
    }
  }
View Full Code Here

TOP

Related Classes of net.infopeers.restrant.ResourceNotFoundException

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.