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.
}
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));
}
}
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));
}
}
}
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);
}
}
}
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());
}
}
}
Aggregations