Package org.jboss.invocation

Examples of org.jboss.invocation.Interceptor


        return this.singletonComponentInstance;
    }

    @Override
    public Interceptor createClientInterceptor(Class<?> view) {
        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, SingletonComponent.this);
View Full Code Here


        this.pool = new StrictMaxPool<StatelessSessionComponentInstance>(factory, 20, 5, TimeUnit.MINUTES);
    }

    @Override
    public Interceptor createClientInterceptor(Class<?> viewClass) {
        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, StatelessSessionComponent.this);
View Full Code Here

        return createClientInterceptor(view, sessionId);
    }

    @Override
    public Interceptor createClientInterceptor(Class<?> view, final Serializable sessionId) {
        return new Interceptor() {
            @Override
            public Object processInvocation(InterceptorContext context) throws Exception {
                // TODO: attaching as Serializable.class is a bit wicked
                context.putPrivateData(Serializable.class, sessionId);
                // TODO: this won't work for remote proxies
View Full Code Here

                    protected Interceptor create(Component component, InterceptorFactoryContext context) {
                        if (component instanceof LockableComponent) {
                            return new ContainerManagedConcurrencyInterceptor((LockableComponent) component);
                        } else {
                            // TODO: This shouldn't be required
                            return new Interceptor() {
                                @Override
                                public Object processInvocation(InterceptorContext interceptorContext) throws Exception {
                                    return interceptorContext.proceed();
                                }
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

    public void callTimeout(final TimerImpl timer, final Method timeoutMethod) throws Exception {
        if(!started) {
            //this can happen if an invocation has been triggered as the deployment is shutting down
            throw new RuntimeException("Timer invocation failed, invoker is not started");
        }
        final Interceptor interceptor = timeoutInterceptors.get(timeoutMethod);
        if(interceptor == null) {
            throw EjbMessages.MESSAGES.failToInvokeTimeout(timeoutMethod);
        }
        final InterceptorContext context = new InterceptorContext();
        context.setContextData(new HashMap<String, Object>());
        context.setMethod(timeoutMethod);
        if(timeoutMethod.getParameterTypes().length == 0) {
            context.setParameters(new Object[0]);
        } else {
            final Object[] params = new Object[1];
            params[0] = timer;
            context.setParameters(params);
        }
        context.setTimer(timer);

        if(timer.getPrimaryKey() != null) {
            context.putPrivateData(EntityBeanComponent.PRIMARY_KEY_CONTEXT_KEY, timer.getPrimaryKey());
        }
        context.putPrivateData(Component.class, ejbComponent.getValue());
        context.putPrivateData(MethodIntf.class, MethodIntf.TIMER);
        context.putPrivateData(InvocationType.class, InvocationType.TIMER);
        interceptor.processInvocation(context);
    }
View Full Code Here

    @Override
    public Interceptor create(final InterceptorFactoryContext context) {

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

        return new Interceptor() {
            @Override
            public Object processInvocation(final InterceptorContext context) throws Exception {
                final InterceptorContext asyncInterceptorContext = context.clone();
                asyncInterceptorContext.putPrivateData(InvocationType.class, InvocationType.ASYNC);
                component.getAsynchronousExecutor().execute(new Task(asyncInterceptorContext));
View Full Code Here

    @Override
    public Interceptor create(final InterceptorFactoryContext context) {

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

        return new Interceptor() {
            @Override
            public Object processInvocation(final InterceptorContext context) throws Exception {
                final InterceptorContext asyncInterceptorContext = context.clone();
                asyncInterceptorContext.putPrivateData(InvocationType.class, InvocationType.ASYNC);
                final CancellationFlag flag = new CancellationFlag();
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(Class<?> view, final Serializable sessionId) {
        return new Interceptor() {
            @Override
            public Object processInvocation(InterceptorContext context) throws Exception {
                // TODO: attaching as Serializable.class is a bit wicked
                context.putPrivateData(Serializable.class, sessionId);
                // TODO: this won't work for remote proxies
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.