Package org.jboss.invocation

Examples of org.jboss.invocation.Interceptor


    /** {@inheritDoc} */
    @Override
    public Interceptor createClientInterceptor(final Class<?> viewClass) {
        // One instance per client lookup.
        final ComponentInstance instance = createInstance();
        return new Interceptor() {
            public Object processInvocation(final InterceptorContext context) throws Exception {
                context.putPrivateData(ComponentInstance.class, instance);
                return context.proceed();
            }

View Full Code Here


        return preDestroyInterceptors;
    }

    /** {@inheritDoc} */
    public Interceptor getInterceptor(final Method method) throws IllegalStateException {
        Interceptor interceptor = methodMap.get(method);
        if (interceptor == null) {
            throw new IllegalStateException("Method does not exist " + method);
        }
        return interceptor;
    }
View Full Code Here

        final ComponentInstance instance = context.getPrivateData(ComponentInstance.class);
        if (instance == null) {
            throw new CannotProceedException("No instance is associated with this component class");
        }
        context.setTarget(instance.getInstance());
        final Interceptor interceptor = instance.getInterceptor(context.getMethod());
        return interceptor.processInvocation(context);
    }
View Full Code Here

        final Method ejbCreate = (Method) context.getContextData().get(EntityBeanHomeCreateInterceptorFactory.EJB_CREATE_METHOD_KEY);
        final Method ejbPostCreate = (Method) context.getContextData().get(EntityBeanHomeCreateInterceptorFactory.EJB_POST_CREATE_METHOD_KEY);
        final Object[] params = (Object[]) context.getContextData().get(EntityBeanHomeCreateInterceptorFactory.PARAMETERS_KEY);

        return new Interceptor() {
            @Override
            public Object processInvocation(final InterceptorContext context) throws Exception {

                if (existing != null) {
                    primaryKeyReference.set(existing);
View Full Code Here

    @Override
    public Interceptor create(final InterceptorFactoryContext context) {

        final EntityBeanComponent component = (EntityBeanComponent) context.getContextData().get(Component.class);

        return new Interceptor() {
            @Override
            public Object processInvocation(final InterceptorContext context) throws Exception {

                //grab a bean from the pool to invoke the finder method on
                final EntityBeanComponentInstance instance = component.acquireUnAssociatedInstance();
View Full Code Here

        waitForComponentStart();
        // Interceptor factory context
        context.getContextData().put(Component.class, this);

        // Create the post-construct interceptors for the ComponentInstance
        final Interceptor componentInstancePostConstructInterceptor = this.getPostConstruct().create(context);
        // create the pre-destroy interceptors
        final Interceptor componentInstancePreDestroyInterceptor = this.getPreDestroy().create(context);

        @SuppressWarnings("unchecked")
        final AtomicReference<ManagedReference> instanceReference = (AtomicReference<ManagedReference>) context.getContextData().get(BasicComponentInstance.INSTANCE_KEY);

        instanceReference.set(instance);
View Full Code Here

            @Override
            public void configure(DeploymentPhaseContext context, ComponentConfiguration componentConfiguration, ViewDescription description, ViewConfiguration configuration) throws DeploymentUnitProcessingException {

                //add the invocation type to the start of the chain
                //TODO: is there a cleaner way to do this?
                configuration.addViewInterceptor(new ImmediateInterceptorFactory(new Interceptor() {
                    @Override
                    public Object processInvocation(final InterceptorContext context) throws Exception {
                        context.putPrivateData(InvocationType.class, InvocationType.MESSAGE_DELIVERY);
                        return context.proceed();
                    }
View Full Code Here

        return createClientInterceptor(view, sessionId);
    }

    @Override
    public Interceptor createClientInterceptor(final Class<?> view, final Serializable sessionId) {
        return new Interceptor() {
            @Override
            public Object processInvocation(InterceptorContext context) throws Exception {
                final Method method = context.getMethod();
                // if no-interface view, then check whether invocation on the method is allowed
                // (for ex: invocation on protected methods isn't allowed)
View Full Code Here

    }

    @Override
    public Interceptor createClientInterceptor(final Class<?> view) {

        return new Interceptor() {
            @Override
            public Object processInvocation(InterceptorContext context) throws Exception {
                final Method method = context.getMethod();
                // if no-interface view, then check whether invocation on the method is allowed
                // (for ex: invocation on protected methods isn't allowed)
View Full Code Here

        return createClientInterceptor(view, null);
    }

    @Override
    public Interceptor createClientInterceptor(Class<?> view, Serializable sessionId) {
        return new Interceptor() {
            @Override
            public Object processInvocation(InterceptorContext context) throws Exception {
                // TODO: FIXME: Component shouldn't be attached in a interceptor context that
                // runs on remote clients.
                context.putPrivateData(Component.class, MessageDrivenComponent.this);
View Full Code Here

TOP

Related Classes of org.jboss.invocation.Interceptor

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.