Search in sources :

Example 1 with StatefulTimeoutMetaData

use of org.jboss.metadata.ejb.spec.StatefulTimeoutMetaData 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)

Aggregations

TimeUnit (java.util.concurrent.TimeUnit)1 StatefulTimeoutInfo (org.jboss.as.ejb3.component.stateful.StatefulTimeoutInfo)1 SessionBean31MetaData (org.jboss.metadata.ejb.spec.SessionBean31MetaData)1 SessionBeanMetaData (org.jboss.metadata.ejb.spec.SessionBeanMetaData)1 StatefulTimeoutMetaData (org.jboss.metadata.ejb.spec.StatefulTimeoutMetaData)1