Examples of Interceptor


Examples of org.apache.directory.studio.apacheds.configuration.model.v151.Interceptor

        upButton.setEnabled( !selection.isEmpty() );
        downButton.setEnabled( !selection.isEmpty() );
        if ( !selection.isEmpty() )
        {
            Interceptor interceptor = ( Interceptor ) selection.getFirstElement();
            upButton.setEnabled( interceptors.indexOf( interceptor ) != 0 );
            downButton.setEnabled( interceptors.indexOf( interceptor ) != ( interceptors.size() - 1 ) );
        }
    }
View Full Code Here

Examples of org.apache.geronimo.core.service.Interceptor

    public Msg sendRequest(URI to, Msg msg) throws TransportException {
        try {
            routerLock.acquire();

            Interceptor interceptor = lookupInterceptorFrom(to);

            SimpleInvocation invocation = new SimpleInvocation();
            InvocationSupport.putMarshaledValue(invocation, msg.popMarshaledObject());
            InvocationSupport.putRemoteURI(invocation, to);

            InvocationResult result = interceptor.invoke(invocation);

            msg = msg.createMsg();
            Object rc = result.getResult();
            msg.pushMarshaledObject((MarshalledObject) rc);
            return msg;
View Full Code Here

Examples of org.apache.ibatis.plugin.Interceptor

  private void pluginElement(XNode parent) throws Exception {
    if (parent != null) {
      for (XNode child : parent.getChildren()) {
        String interceptor = child.getStringAttribute("interceptor");
        Properties properties = child.getChildrenAsProperties();
        Interceptor interceptorInstance = (Interceptor) resolveClass(interceptor).newInstance();
        interceptorInstance.setProperties(properties);
        configuration.addInterceptor(interceptorInstance);
      }
    }
  }
View Full Code Here

Examples of org.apache.openejb.jee.Interceptor

                for (Class<?> interceptorsAnnotatedClass : inheritedClassFinder.findAnnotatedClasses(Interceptors.class)) {
                    Interceptors interceptors = interceptorsAnnotatedClass.getAnnotation(Interceptors.class);
                    EjbJar ejbJar = ejbModule.getEjbJar();
                    for (Class interceptor : interceptors.value()) {
                        if (ejbJar.getInterceptor(interceptor.getName()) == null) {
                            ejbJar.addInterceptor(new Interceptor(interceptor.getName()));
                        }
                    }

                    InterceptorBinding binding = new InterceptorBinding(bean);
                    assemblyDescriptor.getInterceptorBinding().add(0, binding);

                    for (Class interceptor : interceptors.value()) {
                        binding.getInterceptorClass().add(interceptor.getName());
                    }
                }

                for (Method method : inheritedClassFinder.findAnnotatedMethods(Interceptors.class)) {
                    Interceptors interceptors = method.getAnnotation(Interceptors.class);
                    if (interceptors != null) {
                        EjbJar ejbJar = ejbModule.getEjbJar();
                        for (Class interceptor : interceptors.value()) {
                            if (ejbJar.getInterceptor(interceptor.getName()) == null) {
                                ejbJar.addInterceptor(new Interceptor(interceptor.getName()));
                            }
                        }

                        InterceptorBinding binding = new InterceptorBinding(bean);
                        assemblyDescriptor.getInterceptorBinding().add(0, binding);
View Full Code Here

Examples of org.apache.openejb.jee.Interceptor

        EjbJar ejbJar = new EjbJar();
        AssemblyDescriptor ad = ejbJar.getAssemblyDescriptor();

        EnterpriseBean bean = ejbJar.addEnterpriseBean(new StatefulBean(TargetBean.class));

        Interceptor interceptor;

        interceptor = ejbJar.addInterceptor(new Interceptor(ClassInterceptor.class));
        ad.addInterceptorBinding(new InterceptorBinding(bean, interceptor));

        interceptor = ejbJar.addInterceptor(new Interceptor(DefaultInterceptor.class));
        ad.addInterceptorBinding(new InterceptorBinding("*", interceptor));

        interceptor = ejbJar.addInterceptor(new Interceptor(EchoMethodInterceptor.class));
        InterceptorBinding binding = ad.addInterceptorBinding(new InterceptorBinding(bean, interceptor));
        binding.setMethod(new NamedMethod("echo"));

        return new EjbModule(this.getClass().getClassLoader(), this.getClass().getSimpleName(), "test", ejbJar, null);
    }
View Full Code Here

Examples of org.apache.openejb.jee.Interceptor

        ejbJar.addEnterpriseBean(new StatelessBean(Target2Bean.class));

        EnterpriseBean bean = ejbJar.addEnterpriseBean(new StatelessBean(TargetBean.class));

        Interceptor interceptor;

        interceptor = ejbJar.addInterceptor(new Interceptor(DefaultInterceptor.class));
        ad.addInterceptorBinding(new InterceptorBinding("*", interceptor));

        {
            interceptor = ejbJar.addInterceptor(new Interceptor(EchoMethodInterceptorViaDD.class));
            InterceptorBinding binding = ad.addInterceptorBinding(new InterceptorBinding(bean, interceptor));
            binding.setMethod(new NamedMethod(TargetBean.class.getMethod("echo", List.class)));
        }

        {
            interceptor = ejbJar.addInterceptor(new Interceptor(EchoMethodInterceptorViaDD.class));
            InterceptorBinding binding = ad.addInterceptorBinding(new InterceptorBinding(bean, interceptor));
            binding.setMethod(new NamedMethod(TargetBean.class.getMethod("echo", int.class)));
        }

        {
            interceptor = ejbJar.addInterceptor(new Interceptor(EchoMethodInterceptorViaDD.class));
            InterceptorBinding binding = ad.addInterceptorBinding(new InterceptorBinding(bean, interceptor));
            binding.setMethod(new NamedMethod(TargetBean.class.getMethod("echo", boolean.class)));
        }

        EnterpriseBean bean3 = ejbJar.addEnterpriseBean(new StatelessBean(Target3Bean.class));
View Full Code Here

Examples of org.apache.servicemix.soap.api.Interceptor

            setState(message, iterator);
        }

        try {
            while (iterator.hasNext()) {
                Interceptor currentInterceptor = iterator.next();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Invoking handleMessage on interceptor " + currentInterceptor.getId());
                }
                currentInterceptor.handleMessage(message);
            }
        } catch (RuntimeException ex) {
            if (LOG.isInfoEnabled()) {
                LOG.info("Interceptor has thrown exception, unwinding now", ex);
            }
            message.setContent(Exception.class, ex);
            // Unwind
            while (iterator.hasPrevious()) {
                Interceptor currentInterceptor = iterator.previous();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Invoking handleFault on interceptor " + currentInterceptor.getId());
                }
                currentInterceptor.handleFault(message);
            }
            throw ex;
        }
    }
View Full Code Here

Examples of org.apache.tomcat.Interceptor

     */
    public void addInterceptor(Interceptor interceptor) {

  synchronized (interceptors) {
      interceptor.setContainer(container)// May throw IAE
      Interceptor temp[] = new Interceptor[interceptors.length + 1];
      for (int i = 0; i < interceptors.length; i++)
    temp[i] = interceptors[i];
      temp[interceptors.length] = interceptor;
      interceptors = temp;
  }
View Full Code Here

Examples of org.apache.tomcat.Interceptor

     * Return the set of Interceptors associated with this Valve.
     */
    public Interceptor[] findInterceptors() {

  synchronized (interceptors) {
      Interceptor results[] = new Interceptor[interceptors.length];
      for (int i = 0; i < interceptors.length; i++)
    results[i] = interceptors[i];
      return (results);
  }

View Full Code Here

Examples of org.apache.tomcat.Interceptor

  throws IOException, ServletException {

  // Acquire a private copy of the current Interceptor list
  // IMPLEMENTATION NOTE:  Not required if configuration can only
  // occur at startup time
  Interceptor list[] = findInterceptors();

  // Call the preService() method of all defined Interceptors
  boolean done = false;
  int last = -1;
  Throwable t = 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.