Search in sources :

Example 1 with SessionBean31MetaData

use of org.jboss.metadata.ejb.spec.SessionBean31MetaData in project wildfly by wildfly.

the class StartupMergingProcessor method handleDeploymentDescriptor.

@Override
protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SingletonComponentDescription description) throws DeploymentUnitProcessingException {
    if (!description.isInitOnStartup()) {
        SessionBeanMetaData data = description.getDescriptorData();
        if (data instanceof SessionBean31MetaData) {
            SessionBean31MetaData singletonBeanMetaData = (SessionBean31MetaData) data;
            Boolean initOnStartup = singletonBeanMetaData.isInitOnStartup();
            if (initOnStartup != null && initOnStartup) {
                description.initOnStartup();
                description.getModuleDescription().registerStartupBean();
            }
        }
    }
// else skip. This is already marked as InitOnStartup by @Startup annotation.
}
Also used : SessionBeanMetaData(org.jboss.metadata.ejb.spec.SessionBeanMetaData) SessionBean31MetaData(org.jboss.metadata.ejb.spec.SessionBean31MetaData)

Example 2 with SessionBean31MetaData

use of org.jboss.metadata.ejb.spec.SessionBean31MetaData in project wildfly by wildfly.

the class SessionSynchronizationMergingProcessor method handleDeploymentDescriptor.

@Override
protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final StatefulComponentDescription description) throws DeploymentUnitProcessingException {
    final DeploymentReflectionIndex reflectionIndex = deploymentUnit.getAttachment(Attachments.REFLECTION_INDEX);
    // if we implement SessionSynchronization we can ignore any DD information
    if (SessionSynchronization.class.isAssignableFrom(componentClass)) {
        final ClassReflectionIndex classIndex = reflectionIndex.getClassIndex(SessionSynchronization.class);
        description.setAfterBegin(classIndex.getMethod(void.class, "afterBegin"));
        description.setAfterCompletion(classIndex.getMethod(void.class, "afterCompletion", boolean.class));
        description.setBeforeCompletion(classIndex.getMethod(void.class, "beforeCompletion"));
        return;
    }
    SessionBeanMetaData data = description.getDescriptorData();
    if (data instanceof SessionBean31MetaData) {
        SessionBean31MetaData metaData = (SessionBean31MetaData) data;
        if (metaData.getAfterBeginMethod() != null)
            description.setAfterBegin(MethodResolutionUtils.resolveMethod(metaData.getAfterBeginMethod(), componentClass, reflectionIndex));
        if (metaData.getAfterCompletionMethod() != null)
            description.setAfterCompletion(MethodResolutionUtils.resolveMethod(metaData.getAfterCompletionMethod(), componentClass, reflectionIndex));
        if (metaData.getBeforeCompletionMethod() != null)
            description.setBeforeCompletion(MethodResolutionUtils.resolveMethod(metaData.getBeforeCompletionMethod(), componentClass, reflectionIndex));
    }
}
Also used : SessionBeanMetaData(org.jboss.metadata.ejb.spec.SessionBeanMetaData) ClassReflectionIndex(org.jboss.as.server.deployment.reflect.ClassReflectionIndex) DeploymentReflectionIndex(org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex) SessionBean31MetaData(org.jboss.metadata.ejb.spec.SessionBean31MetaData)

Example 3 with SessionBean31MetaData

use of org.jboss.metadata.ejb.spec.SessionBean31MetaData in project wildfly by wildfly.

the class StatefulTimeoutMergingProcessor method handleDeploymentDescriptor.

@Override
protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final StatefulComponentDescription componentConfiguration) throws DeploymentUnitProcessingException {
    final SessionBeanMetaData data = componentConfiguration.getDescriptorData();
    if (data == null) {
        return;
    }
    if (data instanceof SessionBean31MetaData) {
        SessionBean31MetaData sessionBean31MetaData = (SessionBean31MetaData) data;
        final StatefulTimeoutMetaData statefulTimeout = sessionBean31MetaData.getStatefulTimeout();
        if (statefulTimeout != null) {
            TimeUnit unit = TimeUnit.MINUTES;
            if (statefulTimeout.getUnit() != null) {
                unit = statefulTimeout.getUnit();
            }
            componentConfiguration.setStatefulTimeout(new StatefulTimeoutInfo(statefulTimeout.getTimeout(), unit));
        }
    }
}
Also used : SessionBeanMetaData(org.jboss.metadata.ejb.spec.SessionBeanMetaData) StatefulTimeoutInfo(org.jboss.as.ejb3.component.stateful.StatefulTimeoutInfo) TimeUnit(java.util.concurrent.TimeUnit) StatefulTimeoutMetaData(org.jboss.metadata.ejb.spec.StatefulTimeoutMetaData) SessionBean31MetaData(org.jboss.metadata.ejb.spec.SessionBean31MetaData)

Example 4 with SessionBean31MetaData

use of org.jboss.metadata.ejb.spec.SessionBean31MetaData in project wildfly by wildfly.

the class ConcurrencyManagementMergingProcessor method handleDeploymentDescriptor.

@Override
protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SessionBeanComponentDescription componentConfiguration) throws DeploymentUnitProcessingException {
    if (componentConfiguration.getDescriptorData() == null) {
        return;
    }
    SessionBeanMetaData data = componentConfiguration.getDescriptorData();
    if (data instanceof SessionBean31MetaData) {
        SessionBean31MetaData descriptor = (SessionBean31MetaData) data;
        final ConcurrencyManagementType type = descriptor.getConcurrencyManagementType();
        if (type != null) {
            componentConfiguration.setConcurrencyManagementType(type);
        }
    }
}
Also used : ConcurrencyManagementType(javax.ejb.ConcurrencyManagementType) SessionBeanMetaData(org.jboss.metadata.ejb.spec.SessionBeanMetaData) SessionBean31MetaData(org.jboss.metadata.ejb.spec.SessionBean31MetaData)

Example 5 with SessionBean31MetaData

use of org.jboss.metadata.ejb.spec.SessionBean31MetaData in project wildfly by wildfly.

the class EjbDependsOnMergingProcessor method handleDeploymentDescriptor.

@Override
protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription description) throws DeploymentUnitProcessingException {
    final EEApplicationDescription applicationDescription = deploymentUnit.getAttachment(Attachments.EE_APPLICATION_DESCRIPTION);
    final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT);
    if (description.getDescriptorData() instanceof SessionBean31MetaData) {
        SessionBean31MetaData metaData = (SessionBean31MetaData) description.getDescriptorData();
        if (metaData.getDependsOn() != null) {
            setupDependencies(description, applicationDescription, deploymentRoot, metaData.getDependsOn());
        }
    }
}
Also used : EEApplicationDescription(org.jboss.as.ee.component.EEApplicationDescription) ResourceRoot(org.jboss.as.server.deployment.module.ResourceRoot) SessionBean31MetaData(org.jboss.metadata.ejb.spec.SessionBean31MetaData)

Aggregations

SessionBean31MetaData (org.jboss.metadata.ejb.spec.SessionBean31MetaData)9 SessionBeanMetaData (org.jboss.metadata.ejb.spec.SessionBeanMetaData)7 Method (java.lang.reflect.Method)3 ComponentDescription (org.jboss.as.ee.component.ComponentDescription)2 SessionBeanComponentDescription (org.jboss.as.ejb3.component.session.SessionBeanComponentDescription)2 ClassReflectionIndex (org.jboss.as.server.deployment.reflect.ClassReflectionIndex)2 MethodIdentifier (org.jboss.invocation.proxy.MethodIdentifier)2 TimeUnit (java.util.concurrent.TimeUnit)1 ConcurrencyManagementType (javax.ejb.ConcurrencyManagementType)1 ComponentConfiguration (org.jboss.as.ee.component.ComponentConfiguration)1 ComponentConfigurator (org.jboss.as.ee.component.ComponentConfigurator)1 DependencyConfigurator (org.jboss.as.ee.component.DependencyConfigurator)1 DeploymentDescriptorEnvironment (org.jboss.as.ee.component.DeploymentDescriptorEnvironment)1 EEApplicationDescription (org.jboss.as.ee.component.EEApplicationDescription)1 EEModuleDescription (org.jboss.as.ee.component.EEModuleDescription)1 ViewConfiguration (org.jboss.as.ee.component.ViewConfiguration)1 ViewConfigurator (org.jboss.as.ee.component.ViewConfigurator)1 ViewDescription (org.jboss.as.ee.component.ViewDescription)1 EJBViewDescription (org.jboss.as.ejb3.component.EJBViewDescription)1 SessionBeanComponentCreateService (org.jboss.as.ejb3.component.session.SessionBeanComponentCreateService)1