Package org.ocpsoft.rewrite.exception

Examples of org.ocpsoft.rewrite.exception.RewriteException


      if (this.context == null)
      {
         Context context = (Context) request.getAttribute(RewriteLifecycleContext.LIFECYCLE_CONTEXT_KEY);
         if (context == null)
         {
            throw new RewriteException("RewriteContext was null. Something is seriously wrong, " +
                     "or you are attempting to access this event outside of the Rewrite lifecycle.");
         }
         this.context = context;
      }
      return this.context;
View Full Code Here


         }

         if (parameter instanceof ParameterConfiguration)
            ((ParameterConfiguration<?>) parameter).convertedBy(converter);
         else
            throw new RewriteException("Cannot add @" + Convert.class.getSimpleName() + " to [" + field
                     + "] of class [" + field.getDeclaringClass() + "] because the parameter ["
                     + parameter.getName() + "] is not writable.");

         if (log.isTraceEnabled()) {
            log.trace("Attached converter to field [{}] of class [{}]: ", new Object[] {
View Full Code Here

         }

         if (parameter instanceof ParameterConfiguration)
            ((ParameterConfiguration<?>) parameter).validatedBy(validator);
         else
            throw new RewriteException("Cannot add @" + Validate.class.getSimpleName() + " to [" + field
                     + "] of class [" + field.getDeclaringClass() + "] because the parameter ["
                     + parameter.getName() + "] is not writable.");

         if (log.isTraceEnabled()) {
            log.trace("Attached validator to field [{}] of class [{}]: ", new Object[] {
View Full Code Here

                        ruleBuilder.withPriority(provider.priority());
                  }
               }
            }
            else
               throw new RewriteException("@" + RewriteConfiguration.class.getSimpleName() + " type [" + type.getName()
                        + "] cannot handle context of type [" + configurationContext + "]");
         }
         else if (enriched.size() < 1)
            throw new RewriteException("No service of type [" + type.getName()
                     + "] was found while loading configuration.");
         else if (enriched.size() > 1)
            throw new RewriteException("More than one service of type [" + type.getName()
                     + "] was found while loading configuration.");
      }
      else
      {
         throw new RewriteException("Class [" + type.getName() + "] annotated with @"
                  + RewriteConfiguration.class.getSimpleName()
                  + " must implement [" + ConfigurationProvider.class.getName() + "]");
      }
      chain.proceed();
   }
View Full Code Here

      }

      for (Exception exception : exceptions) {
         log.error("DEFERRED EXCEPTION", exception);
      }
      throw new RewriteException("No registered " + ExpressionLanguageProvider.class.getName()
               + " could handle the Expression [" + providerCallable.getExpression() + "]");
   }
View Full Code Here

      @Override
      public Object retrieve(final Rewrite event, final EvaluationContext context)
      {
         if (!supportsRetrieval())
            throw new RewriteException("Method binding expression supports submission only [" + setExpression
                     + "], no value retrieval expression was defined");

         return executeProviderCallable(event, context, new ProviderCallable<Object>() {
            @Override
            public Object call(Rewrite event, EvaluationContext context, ExpressionLanguageProvider provider)
View Full Code Here

      @Override
      public Object submit(final Rewrite event, final EvaluationContext context, final Object value)
      {
         if (!supportsSubmission())
            throw new RewriteException("Method binding expression supports retrieval only [" + getExpression
                     + "], no value submission expression was defined");

         return executeProviderCallable(event, context, new ProviderCallable<Object>() {
            @Override
            public Object call(Rewrite event, EvaluationContext context, ExpressionLanguageProvider provider)
View Full Code Here

            {
               responseContent = toString(entity.getContent());
            }
         }
         catch (Exception e) {
            throw new RewriteException("Could not stringify response InputStream", e);
         }
      }
      return responseContent;
   }
View Full Code Here

            try {
               if (value != null)
                  event.getResponse().getWriter().write(value.toString());
            }
            catch (IOException e) {
               throw new RewriteException("Could not write value [" + value + "] to response stream.", e);
            }
         }

         @Override
         public String toString()
View Full Code Here

         {
            try {
               Streams.copy(stream, event.getResponse().getOutputStream());
            }
            catch (IOException e) {
               throw new RewriteException("Could not write stream [" + stream + "] to response stream.", e);
            }
         }

         @Override
         public String toString()
View Full Code Here

TOP

Related Classes of org.ocpsoft.rewrite.exception.RewriteException

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.