Package org.jboss.invocation

Examples of org.jboss.invocation.MethodInterceptorFactory


                        final InterceptorMethodDescription aroundInvoke = entry.getValue();
                        final Class<?> methodDeclaringClass = module.getClassLoader().loadClass(entry.getKey());
                        final ClassReflectionIndex<?> methodDeclaringClassIndex = index.getClassIndex(methodDeclaringClass);
                        //we know what the signature is
                        final Method aroundInvokeMethod = methodDeclaringClassIndex.getMethod(Object.class, aroundInvoke.getIdentifier().getName(), InvocationContext.class);
                        theInterceptorFactories.add(new MethodInterceptorFactory(AbstractComponent.INSTANCE_FACTORY, aroundInvokeMethod));
                    } catch(ClassNotFoundException e){
                        //this should never happen
                        throw new DeploymentUnitProcessingException("Failed to load interceptor class " + entry.getKey());
                    }
                }
View Full Code Here


            for (InterceptorMethodDescription aroundInvoke : interceptor.getAroundInvokeMethods()) {
                final Class<?> methodDeclaringClass = module.getClassLoader().loadClass(aroundInvoke.getDeclaringClass());
                final ClassReflectionIndex<?> methodDeclaringClassIndex = index.getClassIndex(methodDeclaringClass);
                //we know what the signature is
                final Method aroundInvokeMethod = methodDeclaringClassIndex.getMethod(Object.class, aroundInvoke.getIdentifier().getName(), InvocationContext.class);
                theInterceptorFactories.add(new MethodInterceptorFactory(instanceFactory, aroundInvokeMethod));
            }
        } catch (ClassNotFoundException e) {
            throw new DeploymentUnitProcessingException("Failed to load interceptor class " + interceptor.getInterceptorClassName());
        }
    }
View Full Code Here

    private static LifecycleInterceptorFactory createInterceptorLifecycle(final ClassLoader classLoader, final InterceptorMethodDescription lifecycleConfiguration, final DeploymentReflectionIndex deploymentReflectionIndex) throws NoSuchMethodException, ClassNotFoundException {
        final Class<?> declaringClass = classLoader.loadClass(lifecycleConfiguration.getDeclaringClass());
        final Class<?> instanceClass = classLoader.loadClass(lifecycleConfiguration.getInstanceClass());
        final Method lifecycleMethod = deploymentReflectionIndex.getClassIndex(declaringClass).getMethod(void.class, lifecycleConfiguration.getIdentifier().getName(), InvocationContext.class);
        final MethodInterceptorFactory delegate = new MethodInterceptorFactory(new SimpleInterceptorInstanceFactory(instanceClass), lifecycleMethod);
        return new LifecycleInterceptorFactory(delegate, lifecycleMethod);
    }
View Full Code Here

                        final InterceptorMethodDescription aroundInvoke = entry.getValue();
                        final Class<?> methodDeclaringClass = module.getClassLoader().loadClass(entry.getKey());
                        final ClassReflectionIndex<?> methodDeclaringClassIndex = index.getClassIndex(methodDeclaringClass);
                        //we know what the signature is
                        final Method aroundInvokeMethod = methodDeclaringClassIndex.getMethod(Object.class, aroundInvoke.getIdentifier().getName(), InvocationContext.class);
                        theInterceptorFactories.add(new MethodInterceptorFactory(AbstractComponent.INSTANCE_FACTORY, aroundInvokeMethod));
                    } catch(ClassNotFoundException e){
                        //this should never happen
                        throw new DeploymentUnitProcessingException("Failed to load interceptor class " + entry.getKey());
                    }
                }
View Full Code Here

    private static MethodAwareInterceptorFactory createInterceptorLifecycle(final ClassLoader classLoader, final InterceptorMethodDescription lifecycleConfiguration, final DeploymentReflectionIndex deploymentReflectionIndex) throws NoSuchMethodException, ClassNotFoundException {
        final Class<?> declaringClass = classLoader.loadClass(lifecycleConfiguration.getDeclaringClass());
        final Class<?> instanceClass = classLoader.loadClass(lifecycleConfiguration.getInstanceClass());
        final Method lifecycleMethod = deploymentReflectionIndex.getClassIndex(declaringClass).getMethod(void.class, lifecycleConfiguration.getIdentifier().getName(), InvocationContext.class);
        final MethodInterceptorFactory delegate = new MethodInterceptorFactory(new SimpleInterceptorInstanceFactory(instanceClass), lifecycleMethod);
        return new MethodAwareInterceptorFactory(delegate, lifecycleMethod);
    }
View Full Code Here

            for (InterceptorMethodDescription aroundInvoke : interceptor.getAroundInvokeMethods()) {
                final Class<?> methodDeclaringClass = module.getClassLoader().loadClass(aroundInvoke.getDeclaringClass());
                final ClassReflectionIndex<?> methodDeclaringClassIndex = index.getClassIndex(methodDeclaringClass);
                //we know what the signature is
                final Method aroundInvokeMethod = methodDeclaringClassIndex.getMethod(Object.class, aroundInvoke.getIdentifier().getName(), InvocationContext.class);
                theInterceptorFactories.add(new MethodInterceptorFactory(instanceFactory, aroundInvokeMethod));
            }
        } catch(ClassNotFoundException e) {
            throw new DeploymentUnitProcessingException("Could not load interceptor class ",e);
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.invocation.MethodInterceptorFactory

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.