Package org.apache.hadoop.gateway.filter.rewrite.spi

Examples of org.apache.hadoop.gateway.filter.rewrite.spi.UrlRewriteFunctionProcessor


  @SuppressWarnings("unchecked")
  private void initializeFunctions( UrlRewriteRulesDescriptor rules ) {
    for( String name : UrlRewriteFunctionDescriptorFactory.getNames() ) {
      try {
        UrlRewriteFunctionDescriptor descriptor = rules.getFunction( name );
        UrlRewriteFunctionProcessor processor = UrlRewriteFunctionProcessorFactory.create( name, descriptor );
        processor.initialize( environment, descriptor );
        functions.put( name, processor );
      } catch( Exception e ) {
        // Ignore it and it won't be available as a function.
        LOG.failedToInitializeRewriteFunctions( e );
      }
View Full Code Here


  private class ContextEvaluator implements Evaluator {

    @Override
    public List<String> evaluate( String function, List<String> parameters ) {
      List<String> results = null;
      UrlRewriteFunctionProcessor processor = functions.get( function );
      if( processor != null ) {
        try {
          results = processor.resolve( UrlRewriteContextImpl.this, parameters );
        } catch( Exception e ) {
          LOG.failedToInvokeRewriteFunction( function, e );
          results = null;
        }
      }
View Full Code Here

  @SuppressWarnings("unchecked")
  private void initializeFunctions( UrlRewriteRulesDescriptor rules ) {
    for( String name : UrlRewriteFunctionDescriptorFactory.getNames() ) {
      try {
        UrlRewriteFunctionDescriptor descriptor = rules.getFunction( name );
        UrlRewriteFunctionProcessor processor = UrlRewriteFunctionProcessorFactory.create( name, descriptor );
        processor.initialize( environment, descriptor );
        functions.put( name, processor );
      } catch( Exception e ) {
        //TODO: Proper i18n stack trace logging.
        e.printStackTrace();
        // Ignore it and it won't be available as a function.
View Full Code Here

  private UrlRewriteFunctionProcessorFactory() {
  }

  public static UrlRewriteFunctionProcessor create( String name, UrlRewriteFunctionDescriptor descriptor )
      throws IllegalAccessException, InstantiationException {
    UrlRewriteFunctionProcessor processor;
    if( descriptor == null ) {
      descriptor = UrlRewriteFunctionDescriptorFactory.create( name );
    }
    Map<String,Class<? extends UrlRewriteFunctionProcessor>> typeMap;
    typeMap = MAP.get( descriptor.getClass() );
View Full Code Here

TOP

Related Classes of org.apache.hadoop.gateway.filter.rewrite.spi.UrlRewriteFunctionProcessor

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.