Package org.jboss.as.ee.component

Examples of org.jboss.as.ee.component.Component


            this.sessionIdReference = sessionIdReference;
        }

        @Override
        public Object processInvocation(InterceptorContext context) throws Exception {
            final Component component = context.getPrivateData(Component.class);
            if (component instanceof StatefulSessionComponent == false) {
                throw MESSAGES.unexpectedComponent(component,StatefulSessionComponent.class);
            }
            StatefulSessionComponent statefulComponent = (StatefulSessionComponent) component;
            StatefulSessionComponentInstance statefulSessionComponentInstance = statefulComponent.getCache().create();
View Full Code Here


            return this.singletonComponentInstance;
        }
        if (dependsOn != null) {
            for(ServiceName serviceName : dependsOn) {
                final ServiceController<Component> service = (ServiceController<Component>) CurrentServiceContainer.getServiceContainer().getRequiredService(serviceName);
                final Component component = service.getValue();
                if (component instanceof SingletonComponent) {
                    ((SingletonComponent) component).getComponentInstance();
                }
            }
        }
View Full Code Here

        this.retainIfException = retainIfException;
    }

    @Override
    public Object processInvocation(InterceptorContext context) throws Exception {
        final Component component = context.getPrivateData(Component.class);
        // just log a WARN and throw back the original exception
        if (component instanceof StatefulSessionComponent == false) {
            throw new RuntimeException("Unexpected component: " + component + " in interceptor context: " + context +
                    " Expected an instance of " + StatefulSessionComponent.class);
        }
View Full Code Here

        assert Thread.holdsLock(creationLock);

        if (dependsOn != null) {
            for (ServiceName serviceName : dependsOn) {
                final ServiceController<Component> service = (ServiceController<Component>) currentServiceContainer().getRequiredService(serviceName);
                final Component component = service.getValue();
                if (component instanceof SingletonComponent) {
                    ((SingletonComponent) component).getComponentInstance();
                }
            }
        }
View Full Code Here

        } else if (ejbLocator instanceof EntityEJBLocator) {
            final Object primaryKey = ((EntityEJBLocator<?>) ejbLocator).getPrimaryKey();
            interceptorContext.putPrivateData(EntityBeanComponent.PRIMARY_KEY_CONTEXT_KEY, primaryKey);
        }
        if (componentView.isAsynchronous(method)) {
            final Component component = componentView.getComponent();
            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);
View Full Code Here

        final EjbDeploymentInformation ejbDeploymentInformation = this.findEJB(appName, moduleName, distinctName, beanName);
        if (ejbDeploymentInformation == null) {
            this.writeNoSuchEJBFailureMessage(channelAssociation, invocationId, appName, moduleName, distinctName, beanName, null);
            return;
        }
        final Component component = ejbDeploymentInformation.getEjbComponent();
        if (!(component instanceof StatefulSessionComponent)) {
            final String failureMessage = EjbLogger.ROOT_LOGGER.notStatefulSessionBean(beanName, appName, moduleName, distinctName).getLocalizedMessage();
            this.writeInvocationFailure(channelAssociation, HEADER_EJB_NOT_STATEFUL, invocationId, failureMessage);
            return;
        }
View Full Code Here

        this.viewMethod = viewMethod;
    }

    @Override
    public Object processInvocation(InterceptorContext context) throws Exception {
        final Component component = context.getPrivateData(Component.class);
        if (component instanceof EJBComponent == false) {
            throw new IllegalStateException("Unexpected component type: " + component.getClass() + " expected: " + EJBComponent.class);
        }
        final Method invokedMethod = context.getMethod();
        final ComponentViewInstance componentViewInstance = context.getPrivateData(ComponentViewInstance.class);
        final String viewClassOfInvokedMethod = componentViewInstance.getViewClass().getName();
        // shouldn't really happen if the interceptor was setup correctly. But let's be safe and do a check
View Full Code Here

        this.retainIfException = retainIfException;
    }

    @Override
    public Object processInvocation(InterceptorContext context) throws Exception {
        final Component component = context.getPrivateData(Component.class);
        // just log a WARN and throw back the original exception
        if (component instanceof StatefulSessionComponent == false) {
            throw new RuntimeException("Unexpected component: " + component + " in interceptor context: " + context +
                    " Expected an instance of " + StatefulSessionComponent.class);
        }
View Full Code Here

            this.sessionIdReference = sessionIdReference;
        }

        @Override
        public Object processInvocation(InterceptorContext context) throws Exception {
            final Component component = context.getPrivateData(Component.class);
            if (component instanceof StatefulSessionComponent == false) {
                throw new IllegalStateException("Unexpected component: " + component + " Expected " + StatefulSessionComponent.class);
            }
            StatefulSessionComponent statefulComponent = (StatefulSessionComponent) component;
            StatefulSessionComponentInstance statefulSessionComponentInstance = statefulComponent.getCache().create();
View Full Code Here

            return this.singletonComponentInstance;
        }
        if (dependsOn != null) {
            for(ServiceName serviceName : dependsOn) {
                final ServiceController<Component> service = (ServiceController<Component>) CurrentServiceRegistry.getServiceRegistry().getRequiredService(serviceName);
                final Component component = service.getValue();
                if(component instanceof SingletonComponent) {
                    ((SingletonComponent) component).getComponentInstance();
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.jboss.as.ee.component.Component

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.