Examples of Interceptor


Examples of br.com.caelum.vraptor.interceptor.Interceptor

      accepts = getAcceptor().accepts(method);
    } catch (NullPointerException e) {
      throw new InterceptionException("StaticInterceptors should not use constructor parameters inside the accepts method", e);
    }
    if (accepts) {
      Interceptor interceptor = container.instanceFor(type);
      if (interceptor == null) {
        throw new InterceptionException("Unable to instantiate interceptor for " + type.getName()
            + ": the container returned null.");
      }
      logger.debug("Invoking interceptor {}", interceptor.getClass().getSimpleName());
      interceptor.intercept(stack, method, resourceInstance);
    } else {
      stack.next(method, resourceInstance);
    }

  }
View Full Code Here

Examples of ch.softappeal.yass.core.Interceptor

          } catch (final InvocationTargetException e) {
            throw e.getCause();
          }
        }
      };
      final Interceptor interceptor = Interceptors.composite(invocationInterceptor, serviceInterceptor);
      @Nullable final Object value;
      try {
        value = interceptor.invoke(method, arguments, invocation);
      } catch (final Throwable t) {
        return new ExceptionReply(t);
      }
      return new ValueReply(value);
    }
View Full Code Here

Examples of com.dotmarketing.business.Interceptor

  }
 
  private void setUpHooks(String pluginId) throws InstantiationException, IllegalAccessException, ClassNotFoundException, DotDataException{

    PluginAPI pluginAPI = APILocator.getPluginAPI();
    Interceptor conI = (Interceptor)APILocator.getContentletAPIntercepter();
    String conPreHooks = pluginAPI.loadPluginConfigProperty(pluginId, "contentletapi.prehooks");
    String conPostHooks = pluginAPI.loadPluginConfigProperty(pluginId, "contentletapi.posthooks");
    if(UtilMethods.isSet(conPreHooks)){
      String[] pres = conPreHooks.split(",");
      for (String string : pres) {
        conI.addPreHook(string);
      }
    }
    if(UtilMethods.isSet(conPostHooks)){
      String[] post = conPostHooks.split(",");
      for (String string : post) {
        conI.addPostHook(string);
      }
    }
  }
View Full Code Here

Examples of com.dyuproject.web.rest.Interceptor

    }
   
    public static void handle(Controller controller, String mime, HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException
    {
        Interceptor interceptor = controller.getInterceptor();
        if(interceptor==null)
        {
            controller.handle(mime, request, response);
            return;
        }
        boolean success = false;
        try
        {
            success = interceptor.preHandle(getCurrentRequestContext());
        }
        finally
        {           
            if(success)
            {
                try
                {
                    controller.handle(mime, request, response);
                }
                finally
                {
                    interceptor.postHandle(true, getCurrentRequestContext());
                }
            }
            else
                interceptor.postHandle(false, getCurrentRequestContext());
        }      
    }
View Full Code Here

Examples of com.elibom.jogger.middleware.router.interceptor.Interceptor

        return;
      }

      // retrieve the interceptor and increase the index
      Interceptor interceptor = interceptors.get(index);
      index++;

      // execute the interceptor - notice that the interceptor can eventually call the proceed() method recursively.
      interceptor.intercept(request, response, this);
    }
View Full Code Here

Examples of com.firefly.annotation.Interceptor

    if (controller != null && controller.value().length() > 0)
      ret.add(controller.value());
    Component component = c.getAnnotation(Component.class);
    if (component != null && component.value().length() > 0)
      ret.add(component.value());
    Interceptor interceptor = c.getAnnotation(Interceptor.class);
    if (interceptor != null && interceptor.value().length() > 0)
      ret.add(interceptor.value());
    return ret;
  }
View Full Code Here

Examples of com.jfinal.aop.Interceptor

    if (inters.length > 0) {
      sb.append("Interceptor : ");
      for (int i=0; i<inters.length; i++) {
        if (i > 0)
          sb.append("\n              ");
        Interceptor inter = inters[i];
        Class<? extends Interceptor> ic = inter.getClass();
        sb.append(ic.getName()).append(".(").append(ic.getSimpleName()).append(".java:1)");
      }
      sb.append("\n");
    }
   
View Full Code Here

Examples of com.opensymphony.xwork2.interceptor.Interceptor

        String message;
        Throwable cause;

        try {
            // interceptor instances are long-lived and used across user sessions, so don't try to pass in any extra context
            Interceptor interceptor = (Interceptor) objectFactory.buildBean(interceptorClassName, null);
            reflectionProvider.setProperties(params, interceptor);
            interceptor.init();

            return interceptor;
        } catch (InstantiationException e) {
            cause = e;
            message = "Unable to instantiate an instance of Interceptor class [" + interceptorClassName + "].";
View Full Code Here

Examples of complex.dispatches.Interceptor

    {
        // Note: It's important for the following test, that aInterceptor will be hold alive by the uno reference
        // xInterceptor. Otherwhise we cant check some internal states of aInterceptor at the end of this method, because
        // it was already killed .-)

        Interceptor aInterceptor = new Interceptor();
        XDispatchProviderInterceptor xInterceptor = UnoRuntime.queryInterface(XDispatchProviderInterceptor.class, aInterceptor);

        XFrame xFrame = impl_createNewFrame();
        XDispatchProviderInterception xInterception = UnoRuntime.queryInterface(XDispatchProviderInterception.class, xFrame);

        xInterception.registerDispatchProviderInterceptor(xInterceptor);
        impl_closeFrame(xFrame);

        int nRegCount = aInterceptor.getRegistrationCount();
        boolean bIsRegistered = aInterceptor.isRegistered();

        System.out.println("registration count = " + nRegCount);
        System.out.println("is registered ?    = " + bIsRegistered);

        if (nRegCount < 1)
View Full Code Here

Examples of dynaop.Interceptor

        Mock methodInterceptorMock = mock(MethodInterceptor.class);

        pico.registerComponentInstance("interceptorComponentKey", methodInterceptorMock.proxy());

        InterceptorFactory interceptorFactory = new ContainerSuppliedInterceptorFactory(pico, "interceptorComponentKey");
        Interceptor interceptor = interceptorFactory.create(null);
        assertNotNull(interceptor);

        // verify that the dynaop interceptor delegates to the MethodInterceptor
        // in the container:
        methodInterceptorMock.expects(once()).method("invoke");
        interceptor.intercept(null);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.