Examples of Interceptor


Examples of httl.spi.Interceptor

   */
  @Reqiured
  public void setInterceptors(Interceptor[] interceptors) {
    Listener last = null;
    for (int i = interceptors.length - 1; i >= 0; i--) {
      final Interceptor current = interceptors[i];
      final Listener next = last;
      last = new Listener() {
        public void render(Context context) throws IOException, ParseException {
          if (next == null) {
            Listener listener = (Listener) context.get(LISTENER_KEY);
            if (listener != null) {
              current.render(context, listener);
            }
          } else {
            current.render(context, next);
          }
        }
      };
    }
    this.chain = last;
View Full Code Here

Examples of javax.enterprise.inject.spi.Interceptor

    @Override
    public Object proceed() throws Exception
    {
        if (interceptors != null && interceptorIndex < interceptors.size())
        {
            Interceptor interceptor = interceptors.get(interceptorIndex++);

            if (interceptor.intercepts(type))
            {
                return interceptor.intercept(type, instances.get(interceptor), this);
            }
            else
            {
                return proceed();
            }
View Full Code Here

Examples of juju.reattore.server.intercept.Interceptor

    /** @see Interceptor */
    public boolean process(HttpRequest req, HttpResponse resp) {

        /* Where's my map function, eh? */
        for (Iterator i = children.iterator(); i.hasNext();) {
            Interceptor in = (Interceptor)i.next();

            if (in.process(req, resp)) {
                return true;
            }
        }

        return false;
View Full Code Here

Examples of mfinder.annotation.Interceptor

     * @param obj 方法所在的对象。
     *
     * @return Interceptor代理对象。
     */
    private InterceptorProxy createInterceptorProxy(Method method, Object obj) {
        Interceptor interceptor = method.getAnnotation(Interceptor.class);
        Class[] params = method.getParameterTypes();

        //check interceptor invoke args
        boolean requireAction = false;
        //interceptor代理的方法无参数或参数仅为ActionInvocation或其子类
        if (params.length == 0) {
            requireAction = false;
        } //未指定actionInvocationClass参数类型时允许ActionInvocation任意子类;否则为actionInvocationClass的父类
        else if (isProxyMethod(params)) {
            requireAction = true;
        } else {
            throw new IllegalArgumentException("Illegal arguments in Interceptor : " + method);
        }
        return new InterceptorProxy(interceptor.name().trim(), method, obj, requireAction);
    }
View Full Code Here

Examples of net.paoding.rose.web.annotation.Interceptor

                logger.error("", new IllegalArgumentException("Interceptor must be end with '"
                        + RoseConstants.INTERCEPTOR_SUFFIX + "': " + userClass.getName()));
                continue;
            }
            InterceptorBuilder builder = new InterceptorBuilder(interceptor);
            Interceptor annotation = userClass.getAnnotation(Interceptor.class);
            if (annotation != null) {
                builder.oncePerRequest(annotation.oncePerRequest());
            }
            String interceporName;
            if (beanName.startsWith(AUTO_BEAN_NAME_PREFIX)) {
                interceporName = StringUtils.removeEnd(StringUtils.uncapitalize(userClass
                        .getSimpleName()), RoseConstants.INTERCEPTOR_SUFFIX);
View Full Code Here

Examples of net.sf.hibernate.Interceptor

    Session session = null;

    try {
      if (txObject.getSessionHolder() == null || txObject.getSessionHolder().isSynchronizedWithTransaction()) {
        Interceptor entityInterceptor = getEntityInterceptor();
        Session newSession = (entityInterceptor != null ?
            getSessionFactory().openSession(entityInterceptor) : getSessionFactory().openSession());
        if (logger.isDebugEnabled()) {
          logger.debug("Opened new Session [" + newSession + "] for Hibernate transaction");
        }
View Full Code Here

Examples of net.sf.jportlet.portlet.application.Interceptor

            if ( classname != null )
            {
                try
                {
                    Interceptor it = ( Interceptor ) Class.forName( classname ).newInstance(  );
                    _interceptors.add( it );
                }
                catch ( Exception e )
                {
                    _log.error( "Invalid inteceptor class: " + classname, e );
View Full Code Here

Examples of net.sourceforge.stripes.controller.Interceptor

                ctx.setLifecycleStage(LifecycleStage.ActionBeanResolution);
                ctx.setActionBeanContext(tempContext);

                // Run action bean resolution
                ctx.setInterceptors(config.getInterceptors(LifecycleStage.ActionBeanResolution));
                resolution = ctx.wrap( new Interceptor() {
                    public Resolution intercept(ExecutionContext ec) throws Exception {
                        ActionBean bean = resolver.getActionBean(ec.getActionBeanContext(), binding);
                        ec.setActionBean(bean);
                        return null;
                    }
                });
            }
            else {
                ctx.setActionBean(actionBean);
                ctx.setActionBeanContext(actionBean.getContext());
            }

            // Then, if and only if an event was specified, run handler resolution
            if (resolution == null && event != null && (beanNotPresent || this.alwaysExecuteEvent)) {
                ctx.setLifecycleStage(LifecycleStage.HandlerResolution);
                ctx.setInterceptors(config.getInterceptors(LifecycleStage.HandlerResolution));
                resolution = ctx.wrap( new Interceptor() {
                    public Resolution intercept(ExecutionContext ec) throws Exception {
                        ec.setHandler(resolver.getHandler(ec.getActionBean().getClass(), event));
                        ec.getActionBeanContext().setEventName(event);
                        return null;
                    }
View Full Code Here

Examples of org.apache.beehive.controls.spi.svc.Interceptor

        {
            ControlBeanContext cbc = getControlBeanContext();

            for ( String n : interceptorNames )
            {
                Interceptor i = ensureInterceptor( n );
                try
                {
                    i.preInvoke( this, m, args );
                }
                catch (InterceptorPivotException ipe)
                {
                    ipe.setInterceptorName(n);
                    throw ipe;
View Full Code Here

Examples of org.apache.beehive.netui.pageflow.interceptor.Interceptor

                    InterceptorForward fwd = context.getInterceptorForward();
                   
                    if ( _log.isDebugEnabled() )
                    {
                       
                        Interceptor overridingInterceptor = context.getOverridingInterceptor();
                        StringBuffer msg = new StringBuffer();
                        msg.append( "Action interceptor " );
                        msg.append( overridingInterceptor.getClass().getName() );
                        msg.append( " before action " );
                        msg.append( actionName );
                        msg.append( ": forwarding to " );
                        msg.append( fwd != null ? fwd.getPath() : "null [no forward]" );
                        _log.debug( msg.toString() );
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.