Package com.softwarementors.extjs.djn.config

Examples of com.softwarementors.extjs.djn.config.ApiConfigurationException


  /* package */ void scanAndRegisterApiConfiguration(ApiConfiguration api) {
    assert api != null;
   
    if( this.registry.hasApi( api.getName() )) {
      ApiConfigurationException ex = ApiConfigurationException.forApiAlreadyRegistered( api.getName());
      logger.fatal( ex.getMessage(), ex );
      throw ex;
    }
   
    RegisteredApi registeredApi = this.registry.addApi( api.getName(), api.getApiFile(), api.getFullApiFileName(), api.getApiNamespace(), api.getActionsNamespace());
   
View Full Code Here


    List<RegisteredAction> actions = new ArrayList<RegisteredAction>();
    for( String actionName : actionNames ) {
      if( this.registry.hasAction( actionName ) ) {
        RegisteredAction existingAction = this.registry.getAction( actionName );
        ApiConfigurationException ex = ApiConfigurationException.forActionAlreadyRegistered(actionName, actionClass, existingAction.getActionClass());
        logger.fatal( ex.getMessage(), ex );
        throw ex;
      }
      RegisteredAction action = api.addAction( actionClass, actionName );
      actions.add( action );
    }
View Full Code Here

        isPollMethod = method.getName().startsWith( POLL_METHOD_NAME_PREFIX );
      }
     
      // Check that a method is just of only one kind of method
      if( isStandardMethod && isFormPostMethod ) {
        ApiConfigurationException ex = ApiConfigurationException.forMethodCantBeStandardAndFormPostMethodAtTheSameTime(actionTemplate, method);
        logger.fatal( ex.getMessage(), ex );
        throw ex;
      }
      if( (methodAnnotation != null || postMethodAnnotation != null) && isPollMethod) {
        ApiConfigurationException ex = ApiConfigurationException.forPollMethodCantBeStandardOrFormPostMethodAtTheSameTime(actionTemplate, method);
        logger.fatal( ex.getMessage(), ex );
        throw ex;
      }

      // Process standard and form post methods together, as they are very similar
      if( isStandardMethod || isFormPostMethod) {
       
        String methodName = "";
        if( isStandardMethod ) {
          methodName = getStandardMethodName(method, methodAnnotation);
        }
        else {
          methodName = getFormPostMethodName( method, postMethodAnnotation);
        }       
        if( actionTemplate.hasStandardMethod(methodName)  ) {
          ApiConfigurationException ex = ApiConfigurationException.forMethodAlreadyRegisteredInAction(methodName, actionTemplate.getName());
          logger.fatal( ex.getMessage(), ex );
          throw ex;
        }
       
        if( isFormPostMethod && !RegisteredStandardMethod.isValidFormHandlingMethod(method)) {
          ApiConfigurationException ex = ApiConfigurationException.forMethodHasWrongParametersForAFormHandler( actionTemplate.getName(), methodName );
          logger.fatal( ex.getMessage(), ex );
          throw ex;
        }

        for( RegisteredAction actionToRegister : actions ) {
          actionToRegister.addStandardMethod( methodName, method, isFormPostMethod );
View Full Code Here

    assert method != null;
   
    String eventName = getEventName(method, pollMethodAnnotation);
       
    if( this.registry.hasPollMethod(eventName)) {
      ApiConfigurationException ex = ApiConfigurationException.forPollEventAlreadyRegistered( eventName );
      logger.fatal( ex.getMessage(), ex );
      throw ex;
    }
   
    if( !RegisteredPollMethod.isValidPollMethod(method)) {
      ApiConfigurationException ex = ApiConfigurationException.forMethodHasWrongParametersForAPollHandler( method );
      logger.fatal( ex.getMessage(), ex );
      throw ex;
    }
   
    RegisteredPollMethod poll = action.addPollMethod( eventName, method);
    return poll;   
View Full Code Here

TOP

Related Classes of com.softwarementors.extjs.djn.config.ApiConfigurationException

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.