Search in sources :

Example 1 with ConcurrentMethodsMetaData

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

the class EjbConcurrencyMergingProcessor method handleDeploymentDescriptor.

protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SessionBeanComponentDescription componentConfiguration) throws DeploymentUnitProcessingException {
    if (componentConfiguration.getDescriptorData() == null) {
        return;
    }
    SessionBeanMetaData sessionBeanMetaData = componentConfiguration.getDescriptorData();
    if (sessionBeanMetaData instanceof SessionBean31MetaData) {
        SessionBean31MetaData descriptor = (SessionBean31MetaData) sessionBeanMetaData;
        // handle lock
        if (descriptor.getLockType() != null) {
            componentConfiguration.setBeanLevelLockType(componentConfiguration.getEJBClassName(), descriptor.getLockType());
        }
        // handle access timeout
        if (descriptor.getAccessTimeout() != null) {
            componentConfiguration.setBeanLevelAccessTimeout(componentConfiguration.getEJBClassName(), new AccessTimeoutDetails(descriptor.getAccessTimeout().getTimeout(), descriptor.getAccessTimeout().getUnit()));
        }
        final ConcurrentMethodsMetaData methods = descriptor.getConcurrentMethods();
        if (methods != null) {
            for (final ConcurrentMethodMetaData method : methods) {
                final Method realMethod = resolveMethod(deploymentReflectionIndex, componentClass, componentClass, method.getMethod());
                final MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifierForMethod(realMethod);
                if (method.getLockType() != null) {
                    componentConfiguration.setLockType(method.getLockType(), methodIdentifier);
                }
                if (method.getAccessTimeout() != null) {
                    componentConfiguration.setAccessTimeout(new AccessTimeoutDetails(method.getAccessTimeout().getTimeout(), method.getAccessTimeout().getUnit()), methodIdentifier);
                }
            }
        }
    }
}
Also used : ConcurrentMethodsMetaData(org.jboss.metadata.ejb.spec.ConcurrentMethodsMetaData) SessionBeanMetaData(org.jboss.metadata.ejb.spec.SessionBeanMetaData) AccessTimeoutDetails(org.jboss.as.ejb3.concurrency.AccessTimeoutDetails) ConcurrentMethodMetaData(org.jboss.metadata.ejb.spec.ConcurrentMethodMetaData) Method(java.lang.reflect.Method) MethodIdentifier(org.jboss.invocation.proxy.MethodIdentifier) SessionBean31MetaData(org.jboss.metadata.ejb.spec.SessionBean31MetaData)

Aggregations

Method (java.lang.reflect.Method)1 AccessTimeoutDetails (org.jboss.as.ejb3.concurrency.AccessTimeoutDetails)1 MethodIdentifier (org.jboss.invocation.proxy.MethodIdentifier)1 ConcurrentMethodMetaData (org.jboss.metadata.ejb.spec.ConcurrentMethodMetaData)1 ConcurrentMethodsMetaData (org.jboss.metadata.ejb.spec.ConcurrentMethodsMetaData)1 SessionBean31MetaData (org.jboss.metadata.ejb.spec.SessionBean31MetaData)1 SessionBeanMetaData (org.jboss.metadata.ejb.spec.SessionBeanMetaData)1