Package org.jboss.as.ee.component

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


        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


* @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 EjbLogger.ROOT_LOGGER.componentNotSetInInterceptor(context);
        }
        return componentType.cast(component);
    }
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.ROOT_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.retainIfException = retainIfException;
    }

    @Override
    public Object processInvocation(InterceptorContext context) throws Exception {
        final Component component = context.getPrivateData(Component.class);

        //if a session bean is participating in a transaction, it
        //is an error for a client to invoke the remove method
        //on the session object's home or component interface.
        final ComponentView view = context.getPrivateData(ComponentView.class);
View Full Code Here

    private StatefulComponentSessionIdGeneratingInterceptor() {
    }

    @Override
    public Object processInvocation(InterceptorContext context) throws Exception {
        final Component component = context.getPrivateData(Component.class);
        if (component instanceof StatefulSessionComponent == false) {
            throw EjbLogger.ROOT_LOGGER.unexpectedComponent(component, StatefulSessionComponent.class);
        }
        ComponentClientInstance clientInstance = context.getPrivateData(ComponentClientInstance.class);
        SessionID existing = context.getPrivateData(SessionID.class);
View Full Code Here

    public static final InterceptorFactory FACTORY = new ImmediateInterceptorFactory(new ManagedBeanCreateInterceptor());

    public Object processInvocation(final InterceptorContext context) throws Exception {
        final ComponentClientInstance instance = context.getPrivateData(ComponentClientInstance.class);
        final Component component = context.getPrivateData(Component.class);
        final ComponentInstance componentInstance = component.createInstance();
        boolean ok = false;
        try {
            context.putPrivateData(ComponentInstance.class, componentInstance);
            instance.setViewInstanceData(ComponentInstance.class, componentInstance);
            final Object result = context.proceed();
View Full Code Here

      try {
         // prepare for invocation
         onBeforeInvocation(wsInvocation);
         // prepare invocation data
         final ComponentView componentView = getComponentView();
         Component component = componentView.getComponent();
         //for spring integration and @FactoryType is annotated we don't need to go into ee's interceptors
         if(wsInvocation.getInvocationContext().getTargetBean() != null
                 && (endpoint.getProperty("SpringBus") != null)
                 || wsInvocation.getInvocationContext().getProperty("forceTargetBean") != null) {
             this.reference = new ManagedReference() {
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

        } 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)) {
                logger.warn("Asynchronous invocations are only supported on session beans. Bean class " + component.getComponentClass()
                        + " is not a session bean, invocation on method " + method + " will have no asynchronous semantics");
                // just invoke normally
                return componentView.invoke(interceptorContext);
            }
            // it's really a async method invocation on a session bean. So treat it accordingly
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.