Examples of CancellationFlag


Examples of org.jboss.as.ejb3.component.CancellationFlag

        public void setParameters(Object[] params) throws IllegalArgumentException, IllegalStateException {
            context.setParameters(params);
        }

        public boolean wasCancelCalled() throws IllegalStateException {
            final CancellationFlag flag = context.getPrivateData(CancellationFlag.class);
            if(flag != null) {
                return flag.get();
            }
            return super.wasCancelCalled();
        }
View Full Code Here

Examples of org.jboss.as.ejb3.component.CancellationFlag

        public void setParameters(Object[] params) throws IllegalArgumentException, IllegalStateException {
            context.setParameters(params);
        }

        public boolean wasCancelCalled() throws IllegalStateException {
            final CancellationFlag flag = context.getPrivateData(CancellationFlag.class);
            if(flag != null) {
                return flag.get();
            }
            return super.wasCancelCalled();
        }
View Full Code Here

Examples of org.jboss.as.ejb3.component.CancellationFlag

        public void setParameters(Object[] params) throws IllegalArgumentException, IllegalStateException {
            context.setParameters(params);
        }

        public boolean wasCancelCalled() throws IllegalStateException {
            final CancellationFlag flag = context.getPrivateData(CancellationFlag.class);
            if (flag != null) {
                return flag.get();
            }
            return super.wasCancelCalled();
        }
View Full Code Here

Examples of org.jboss.as.ejb3.component.CancellationFlag

        public void setParameters(Object[] params) throws IllegalArgumentException, IllegalStateException {
            context.setParameters(params);
        }

        public boolean wasCancelCalled() throws IllegalStateException {
            final CancellationFlag flag = context.getPrivateData(CancellationFlag.class);
            if (flag != null) {
                return flag.get();
            }
            return super.wasCancelCalled();
        }
View Full Code Here

Examples of org.jboss.as.ejb3.component.interceptors.CancellationFlag

    public void processMessage(ChannelAssociation channelAssociation, MessageInputStream messageInputStream) throws IOException {
        final DataInputStream input = new DataInputStream(messageInputStream);
        // read the id of the invocation which needs to be cancelled
        final short invocationToCancel = input.readShort();
        // get the cancellation flag (if any) for the invocation id
        final CancellationFlag cancellationFlag = this.remoteAsyncInvocationCancelStatus.getCancelStatus(invocationToCancel);
        if (cancellationFlag == null) {
            return;
        }
        // mark it as cancelled
        cancellationFlag.set(true);
        logger.debug("Invocation with id " + invocationToCancel + " has been marked as cancelled, as requested");
    }
View Full Code Here

Examples of org.jboss.as.ejb3.component.interceptors.CancellationFlag

            if (!(component instanceof SessionBeanComponent)) {
                EjbLogger.EJB3_LOGGER.asyncMethodSupportedOnlyForSessionBeans(component.getComponentClass(), method);
                // just invoke normally
                return componentView.invoke(interceptorContext);
            }
            final CancellationFlag asyncInvocationCancellationFlag = new CancellationFlag();
            interceptorContext.putPrivateData(CancellationFlag.class, asyncInvocationCancellationFlag);
            // keep track of the cancellation flag for this invocation
            this.remoteAsyncInvocationCancelStatus.registerAsyncInvocation(invocationId, asyncInvocationCancellationFlag);
            try {
                return ((Future)componentView.invoke(interceptorContext)).get();
View Full Code Here

Examples of org.jboss.as.ejb3.component.interceptors.CancellationFlag

        config.setClassCloner(new LocalInvocationClassCloner(invocation.getInvokedProxy().getClass().getClassLoader()));
        final ObjectCloner resultCloner = ObjectCloners.getSerializingObjectClonerFactory().createCloner(config);
        if (async) {
            if (ejbComponent instanceof SessionBeanComponent) {
                final SessionBeanComponent component = (SessionBeanComponent) ejbComponent;
                final CancellationFlag flag = new CancellationFlag();
                final SecurityContext securityContext = SecurityContextAssociation.getSecurityContext();
                final AsyncInvocationTask task = new AsyncInvocationTask(flag) {

                    @Override
                    protected Object runInvocation() throws Exception {
View Full Code Here

Examples of org.jboss.as.ejb3.component.interceptors.CancellationFlag

                // just invoke normally
                return componentView.invoke(interceptorContext);
            }
            // it's really a async method invocation on a session bean. So treat it accordingly
            final SessionBeanComponent sessionBeanComponent = (SessionBeanComponent) componentView.getComponent();
            final CancellationFlag cancellationFlag = new CancellationFlag();
            // add the cancellation flag to the interceptor context
            interceptorContext.putPrivateData(CancellationFlag.class, cancellationFlag);

            final AsyncInvocationTask asyncInvocationTask = new AsyncInvocationTask(cancellationFlag) {
                @Override
View Full Code Here

Examples of org.jboss.as.ejb3.component.interceptors.CancellationFlag

        config.setClassCloner(new ClassLoaderClassCloner(invocation.getInvokedProxy().getClass().getClassLoader()));
        final ObjectCloner resultCloner = ObjectCloners.getSerializingObjectClonerFactory().createCloner(config);
        if (async) {
            if (ejbComponent instanceof SessionBeanComponent) {
                final SessionBeanComponent component = (SessionBeanComponent) ejbComponent;
                final CancellationFlag flag = new CancellationFlag();
                final AsyncInvocationTask task = new AsyncInvocationTask(flag) {

                    @Override
                    protected Object runInvocation() throws Exception {
                        return view.invoke(context);
View Full Code Here

Examples of org.jboss.as.ejb3.component.interceptors.CancellationFlag

    public void processMessage(ChannelAssociation channelAssociation, InputStream inputStream) throws IOException {
        final DataInputStream input = new DataInputStream(inputStream);
        // read the id of the invocation which needs to be cancelled
        final short invocationToCancel = input.readShort();
        // get the cancellation flag (if any) for the invocation id
        final CancellationFlag cancellationFlag = this.remoteAsyncInvocationCancelStatus.getCancelStatus(invocationToCancel);
        if (cancellationFlag == null) {
            return;
        }
        // mark it as cancelled
        cancellationFlag.set(true);
        logger.debug("Invocation with id " + invocationToCancel + " has been marked as cancelled, as requested");
    }
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.