Examples of EJBComponent


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

        context.putPrivateData(ComponentInstance.class, instance);
        boolean discarded = false;
        try {
            return context.proceed();
        } catch (Exception ex) {
            final EJBComponent ejbComponent = (EJBComponent)component;
            // Detect app exception
            if (ejbComponent.getApplicationException(ex.getClass(), context.getMethod()) != null) {
                // it's an application exception, just throw it back.
                throw ex;
            }
            if(ex instanceof ConcurrentAccessTimeoutException || ex instanceof ConcurrentAccessException) {
                throw ex;
View Full Code Here

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

    public Object processInvocation(InterceptorContext interceptorContext) throws Exception {
        try {
            // we just pass on the control and do our work only when an exception occurs
            return interceptorContext.proceed();
        } catch (Throwable t) {
            final EJBComponent component = (EJBComponent) interceptorContext.getPrivateData(Component.class);
            final Method invokedMethod = interceptorContext.getMethod();
            // check if it's an application exception. If yes, then *don't* log
            final ApplicationExceptionDetails appException = component.getApplicationException(t.getClass(), invokedMethod);
            if (appException == null) {
                EjbLogger.EJB3_INVOCATION_LOGGER.invocationFailed(component.getComponentName(), invokedMethod, t);
            }
            if (t instanceof Exception) {
                throw (Exception) t;
            }
            // Typically, this interceptor (which would be the first one in the chain) would catch Exception and not Throwable since the other EJB interceptors
View Full Code Here

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

    @Override
    protected void processInvocation(final EJBClientInvocationContext invocation, final EJBReceiverInvocationContext receiverContext) throws Exception {
        final EJBLocator locator = invocation.getLocator();
        final EjbDeploymentInformation ejb = findBean(locator.getAppName(), locator.getModuleName(), locator.getDistinctName(), locator.getBeanName());
        final EJBComponent ejbComponent = ejb.getEjbComponent();

        final Class<?> viewClass = invocation.getViewClass();
        final ComponentView view = ejb.getView(viewClass.getName());
        if (view == null) {
            throw EjbLogger.ROOT_LOGGER.viewNotFound(viewClass.getName(), ejb.getEjbName());
View Full Code Here

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

    }

    @Override
    protected <T> StatefulEJBLocator<T> openSession(EJBReceiverContext context, Class<T> viewType, String appName, String moduleName, String distinctName, String beanName) throws IllegalArgumentException {
        final EjbDeploymentInformation ejbInfo = findBean(appName, moduleName, distinctName, beanName);
        final EJBComponent component = ejbInfo.getEjbComponent();
        if (!(component instanceof StatefulSessionComponent)) {
            throw EjbLogger.ROOT_LOGGER.notStatefulSessionBean(beanName, appName, moduleName, distinctName);
        }
        final StatefulSessionComponent statefulComponent = (StatefulSessionComponent) component;
        final SessionID sessionID = statefulComponent.createSession();
View Full Code Here

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

    private ExecutionTimeInterceptor() {
    }

    @Override
    public Object processInvocation(final InterceptorContext context) throws Exception {
        final EJBComponent component = getComponent(context, EJBComponent.class);
        if (!component.isStatisticsEnabled())
            return context.proceed();
        final Long startWaitTime = (Long) context.getPrivateData(WaitTimeInterceptor.START_WAIT_TIME);
        final long waitTime = startWaitTime != null && startWaitTime != 0L ? System.currentTimeMillis() - startWaitTime : 0L;
        component.getInvocationMetrics().startInvocation();
        final long start = System.currentTimeMillis();
        try {
            return context.proceed();
        } finally {
            final long executionTime = System.currentTimeMillis() - start;
            component.getInvocationMetrics().finishInvocation(context.getMethod(), waitTime, executionTime);
        }
    }
View Full Code Here

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

    }


    @Override
    protected Object handleInvocation(final InterceptorContext invocation) throws Exception {
        final EJBComponent ejbComponent = getComponent();
        TransactionManager tm = ejbComponent.getTransactionManager();
        assert tm.getTransaction() == null : "can't handle BMT transaction, there is a transaction active";

        boolean exceptionThrown = false;
        try {
            return invocation.proceed();
View Full Code Here

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

    @Override
    protected Interceptor create(final Component component, final InterceptorFactoryContext context) {
        if (component instanceof EJBComponent == false) {
            throw EjbLogger.ROOT_LOGGER.unexpectedComponent(component, EJBComponent.class);
        }
        final EJBComponent ejbComponent = (EJBComponent) component;
        final ServerSecurityManager securityManager;
        if(propagateSecurity) {
            securityManager = ejbComponent.getSecurityManager();
        } else {
            securityManager = new SimpleSecurityManager((SimpleSecurityManager) ejbComponent.getSecurityManager());
        }
        final EJBSecurityMetaData securityMetaData = ejbComponent.getSecurityMetaData();
        String securityDomain =  securityMetaData.getSecurityDomain();
        if (securityDomain == null) {
            securityDomain = DEFAULT_DOMAIN;
        }
        if (ROOT_LOGGER.isTraceEnabled()) {
            ROOT_LOGGER.trace("Using security domain: " + securityDomain + " for EJB " + ejbComponent.getComponentName());
        }
        final String runAs = securityMetaData.getRunAs();
        // TODO - We should do something with DeclaredRoles although it never has much meaning in JBoss AS
        final String runAsPrincipal = securityMetaData.getRunAsPrincipal();
        final SecurityRolesMetaData securityRoles = securityMetaData.getSecurityRoles();
View Full Code Here

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

    private final Set<Class<?>> serializableClasses = Collections.newSetFromMap(new IdentityHashMap<Class<?>, Boolean>());

    public StatefulSessionBeanSerializabilityChecker(ModuleDeployment deployment) {
        // Find component classes of any stateful components and any superclasses
        for (EjbDeploymentInformation info: deployment.getEjbs().values()) {
            EJBComponent component = info.getEjbComponent();
            if (component instanceof StatefulSessionComponent) {
                Class<?> componentClass = component.getComponentClass();
                while (componentClass != Object.class) {
                    this.serializableClasses.add(componentClass);
                    componentClass = componentClass.getSuperclass();
                }
            }
View Full Code Here

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

    protected abstract void executeReadMetricStep(final OperationContext context, final ModelNode operation, final EJBComponent component) throws OperationFailedException;

    @Override
    protected void executeRuntimeStep(final OperationContext context, final ModelNode operation) throws OperationFailedException {
        final ServiceName componentServiceName = componentServiceName(context,operation);
        final EJBComponent component = (EJBComponent) context.getServiceRegistry(false).getRequiredService(componentServiceName).getValue();
        executeReadMetricStep(context, operation, component);
        context.stepCompleted();
    }
View Full Code Here

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

    @Override
    protected void processInvocation(final EJBClientInvocationContext invocation, final EJBReceiverInvocationContext receiverContext) throws Exception {
        final EJBLocator locator = invocation.getLocator();
        final EjbDeploymentInformation ejb = findBean(locator.getAppName(), locator.getModuleName(), locator.getDistinctName(), locator.getBeanName());
        final EJBComponent ejbComponent = ejb.getEjbComponent();

        final Class<?> viewClass = invocation.getViewClass();
        final ComponentView view = ejb.getView(viewClass.getName());
        if (view == null) {
            throw new RuntimeException("Could not find view " + viewClass + " for ejb " + ejb.getEjbName());
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.