Package org.jboss.as.ee.component

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


        this.componentInstanceReference = componentInstanceReference;
    }

    public Object processInvocation(final InterceptorContext context) throws Exception {
        final AtomicReference<ComponentInstance> componentInstanceReference = this.componentInstanceReference;
        final Component component = context.getPrivateData(Component.class);
        final ComponentInstance componentInstance = component.createInstance();
        boolean ok = false;
        try {
            context.putPrivateData(ComponentInstance.class, componentInstance);
            componentInstanceReference.set(componentInstance);
            final Object result = context.proceed();
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 = EjbMessages.MESSAGES.notStatefulSessionBean(beanName, appName, moduleName, distinctName).getLocalizedMessage();
            this.writeInvocationFailure(channelAssociation, HEADER_EJB_NOT_STATEFUL, invocationId, failureMessage);
            return;
        }
View Full Code Here

        this.contextID = contextID;
    }

    @Override
    public Object processInvocation(InterceptorContext context) throws Exception {
        final Component component = context.getPrivateData(Component.class);
        if (component instanceof EJBComponent == false) {
            throw MESSAGES.unexpectedComponent(component,EJBComponent.class);
        }
        final Method invokedMethod = context.getMethod();
        final ComponentView componentView = context.getPrivateData(ComponentView.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

                if (existing != null) {
                    primaryKeyReference.set(existing);
                    return existing;
                }
                final Component component = context.getPrivateData(Component.class);
                if (!(component instanceof EntityBeanComponent)) {
                    throw MESSAGES.unexpectedComponent(component, EntityBeanComponent.class);
                }
                final EntityBeanComponent entityBeanComponent = (EntityBeanComponent) component;
                //grab an unasociated entity bean from the pool
View Full Code Here

* @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
*/
public abstract class AbstractEJBInterceptor implements Interceptor {

    protected static <C extends EJBComponent> C getComponent(InterceptorContext context, Class<C> componentType) {
        Component component = context.getPrivateData(Component.class);
        if (component == null) {
           throw MESSAGES.componentNotSetInInterceptor(context);
        }
        return componentType.cast(component);
    }
View Full Code Here

        final InterceptorContext context = CurrentInvocationContext.get();
        if (context == null) {
            return;
        }

        final Component component = context.getPrivateData(Component.class);
        if (!(component instanceof EJBComponent)) {
            return;
        }
        final InvocationType invocationType = context.getPrivateData(InvocationType.class);
View Full Code Here

        this.componentInstanceReference = componentInstanceReference;
    }

    public Object processInvocation(final InterceptorContext context) throws Exception {
        final AtomicReference<ComponentInstance> componentInstanceReference = this.componentInstanceReference;
        final Component component = context.getPrivateData(Component.class);
        final ComponentInstance componentInstance = component.createInstance();
        boolean ok = false;
        try {
            context.putPrivateData(ComponentInstance.class, componentInstance);
            componentInstanceReference.set(componentInstance);
            final Object result = context.proceed();
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 MESSAGES.unexpectedComponent(component,EJBComponent.class);
        }
        final Method invokedMethod = context.getMethod();
        final ComponentView componentView = context.getPrivateData(ComponentView.class);
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.