Package org.wildfly.extension.requestcontroller

Examples of org.wildfly.extension.requestcontroller.ControlPoint


                final InjectedValue<ManagedReferenceFactory> delegateInjection = new InjectedValue<>();
                delegate.getResourceValue(resolutionContext, serviceBuilder, phaseContext, delegateInjection);
                injector.inject(new ManagedReferenceFactory() {
                    @Override
                    public ManagedReference getReference() {
                        ControlPoint cp = controlPointInjectedValue.getValue();
                        try {
                            RunResult res = cp.beginRequest();
                            if(res != RunResult.RUN) {
                                throw EjbLogger.ROOT_LOGGER.containerSuspended();
                            }
                            try {
                                return delegateInjection.getValue().getReference();
                            } finally {
                                cp.requestComplete();
                            }
                        } catch (Exception e) {
                            throw new RuntimeException(e);
                        }
                    }
View Full Code Here


        InvocationType invocation = context.getPrivateData(InvocationType.class);
        if (invocation != InvocationType.REMOTE && invocation != InvocationType.MESSAGE_DELIVERY) {
            return context.proceed();
        }
        EJBComponent component = getComponent(context, EJBComponent.class);
        ControlPoint entryPoint = component.getControlPoint();
        RunResult result = entryPoint.beginRequest();
        if (result == RunResult.REJECTED) {
            throw EjbLogger.ROOT_LOGGER.containerSuspended();
        }
        try {
            return context.proceed();
        } finally {
            entryPoint.requestComplete();
        }
    }
View Full Code Here

     *
     * This should only be used by callers that service remote requests (i.e. places that represent a remote entry point into the container)
     * @return The session id
     */
    public SessionID createSessionRemote() {
        ControlPoint controlPoint = getControlPoint();
        if(controlPoint == null) {
            return createSession();
        } else {
            try {
                RunResult result = controlPoint.beginRequest();
                if(result == RunResult.REJECTED) {
                    throw EjbLogger.ROOT_LOGGER.containerSuspended();
                }
                try {
                    return createSession();
                } finally {
                    controlPoint.requestComplete();
                }
            } catch (Exception e) {
                throw new EJBException(e);
            }
        }
View Full Code Here

            deploymentInfo.setServerName("WildFly " + Version.AS_VERSION);
            if (undertowService.getValue().isStatisticsEnabled()) {
                deploymentInfo.setMetricsCollector(new UndertowMetricsCollector());
            }

            ControlPoint controlPoint = controlPointInjectedValue.getOptionalValue();
            if (controlPoint != null) {
                deploymentInfo.addInitialHandlerChainWrapper(GlobalRequestControllerHandler.wrapper(controlPoint));
            }

            this.deploymentInfo = deploymentInfo;
View Full Code Here

TOP

Related Classes of org.wildfly.extension.requestcontroller.ControlPoint

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.