@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SessionBeanComponentDescription description) throws DeploymentUnitProcessingException { final RuntimeAnnotationInformation<Boolean> data = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, Asynchronous.class); for (final Map.Entry<String, List<Boolean>> entry : data.getClassAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { description.addAsynchronousClass(entry.getKey()); } } for (final Map.Entry<Method, List<Boolean>> entry : data.getMethodAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { description.addAsynchronousMethod(MethodIdentifier.getIdentifierForMethod(entry.getKey())); } } }
private void processTransactionAttributeAnnotation(final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, MethodIntf methodIntf, final EJBComponentDescription componentConfiguration) { final RuntimeAnnotationInformation<TransactionAttributeType> data = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, TransactionAttribute.class); for (Map.Entry<String, List<TransactionAttributeType>> entry : data.getClassAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { //we can't specify both methodIntf and class name final String className = methodIntf == null ? entry.getKey() : null; componentConfiguration.getTransactionAttributes().setAttribute(methodIntf, className, entry.getValue().get(0)); } } for (Map.Entry<Method, List<TransactionAttributeType>> entry : data.getMethodAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { String[] parameterTypes = MethodInfoHelper.getCanonicalParameterTypes(entry.getKey()); componentConfiguration.getTransactionAttributes().setAttribute(methodIntf, entry.getValue().get(0), entry.getKey().getDeclaringClass().getName(), entry.getKey().getName(), parameterTypes); } } }
private void processTransactionTimeoutAnnotation(final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, MethodIntf methodIntf, final EJBComponentDescription componentConfiguration) { final RuntimeAnnotationInformation<Integer> data = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, TransactionTimeout.class); for (Map.Entry<String, List<Integer>> entry : data.getClassAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { //we can't specify both methodIntf and class name final String className = methodIntf == null ? entry.getKey() : null; componentConfiguration.getTransactionTimeouts().setAttribute(methodIntf, className, entry.getValue().get(0)); } } for (Map.Entry<Method, List<Integer>> entry : data.getMethodAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { final String className = entry.getKey().getDeclaringClass().getName(); String[] parameterTypes = MethodInfoHelper.getCanonicalParameterTypes(entry.getKey()); componentConfiguration.getTransactionTimeouts().setAttribute(methodIntf, entry.getValue().get(0), className, entry.getKey().getName(), parameterTypes); } } }
protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SessionBeanComponentDescription componentConfiguration) { //handle lock annotations final RuntimeAnnotationInformation<LockType> lockData = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, Lock.class); for (Map.Entry<String, List<LockType>> entry : lockData.getClassAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { componentConfiguration.setBeanLevelLockType(entry.getKey(), entry.getValue().get(0)); } } for (Map.Entry<Method, List<LockType>> entry : lockData.getMethodAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { componentConfiguration.setLockType(entry.getValue().get(0), MethodIdentifier.getIdentifierForMethod(entry.getKey())); } } final RuntimeAnnotationInformation<AccessTimeoutDetails> accessTimeout = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, AccessTimeout.class); for (Map.Entry<String, List<AccessTimeoutDetails>> entry : accessTimeout.getClassAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { componentConfiguration.setBeanLevelAccessTimeout(entry.getKey(), entry.getValue().get(0)); } } for (Map.Entry<Method, List<AccessTimeoutDetails>> entry : accessTimeout.getMethodAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { componentConfiguration.setAccessTimeout(entry.getValue().get(0), MethodIdentifier.getIdentifierForMethod(entry.getKey())); } } }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription description) throws DeploymentUnitProcessingException { final RuntimeAnnotationInformation<Boolean> permitData = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, PermitAll.class); for (Map.Entry<String, List<Boolean>> entry : permitData.getClassAnnotations().entrySet()) { description.getAnnotationMethodPermissions().setAttribute(null, entry.getKey(), EJBMethodSecurityAttribute.permitAll()); } for (Map.Entry<Method, List<Boolean>> entry : permitData.getMethodAnnotations().entrySet()) { final Method method = entry.getKey(); description.getAnnotationMethodPermissions().setAttribute(null, EJBMethodSecurityAttribute.permitAll(), method.getDeclaringClass().getName(), method.getName(), MethodInfoHelper.getCanonicalParameterTypes(method)); } final RuntimeAnnotationInformation<String[]> data = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, RolesAllowed.class); for (Map.Entry<String, List<String[]>> entry : data.getClassAnnotations().entrySet()) { description.getAnnotationMethodPermissions().setAttribute(null, entry.getKey(), EJBMethodSecurityAttribute.rolesAllowed(new HashSet<String>(Arrays.<String>asList(entry.getValue().get(0))))); } for (Map.Entry<Method, List<String[]>> entry : data.getMethodAnnotations().entrySet()) { final Method method = entry.getKey(); description.getAnnotationMethodPermissions().setAttribute(null, EJBMethodSecurityAttribute.rolesAllowed(new HashSet<String>(Arrays.<String>asList(entry.getValue().get(0)))), method.getDeclaringClass().getName(), method.getName(), MethodInfoHelper.getCanonicalParameterTypes(method)); } final RuntimeAnnotationInformation<Boolean> denyData = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, DenyAll.class); for (Map.Entry<String, List<Boolean>> entry : denyData.getClassAnnotations().entrySet()) { description.getAnnotationMethodPermissions().setAttribute(null, entry.getKey(), EJBMethodSecurityAttribute.denyAll()); } for (Map.Entry<Method, List<Boolean>> entry : denyData.getMethodAnnotations().entrySet()) { final Method method = entry.getKey(); description.getAnnotationMethodPermissions().setAttribute(null, EJBMethodSecurityAttribute.denyAll(), method.getDeclaringClass().getName(), method.getName(), MethodInfoHelper.getCanonicalParameterTypes(method)); } }
if (excludeDefaultInterceptors.getClassAnnotations().containsKey(componentClass.getName())) { description.setExcludeDefaultInterceptors(true); final List<String[]> classInterceptors = interceptors.getClassAnnotations().get(clazz.getName()); if (classInterceptors != null) { for (final String interceptor : classInterceptors.get(0)) {
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SessionBeanComponentDescription description) throws DeploymentUnitProcessingException { final RuntimeAnnotationInformation<Boolean> data = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, Asynchronous.class); for (final Map.Entry<String, List<Boolean>> entry : data.getClassAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { description.addAsynchronousClass(entry.getKey()); } } for (final Map.Entry<Method, List<Boolean>> entry : data.getMethodAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { description.addAsynchronousMethod(MethodIdentifier.getIdentifierForMethod(entry.getKey())); } } }
private void processTransactionAttributeAnnotation(final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, MethodIntf methodIntf, final EJBComponentDescription componentConfiguration) { final RuntimeAnnotationInformation<TransactionAttributeType> data = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, TransactionAttribute.class); for (Map.Entry<String, List<TransactionAttributeType>> entry : data.getClassAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { //we can't specify both methodIntf and class name final String className = methodIntf == null ? entry.getKey() : null; componentConfiguration.getTransactionAttributes().setAttribute(methodIntf, className, entry.getValue().get(0)); } } for (Map.Entry<Method, List<TransactionAttributeType>> entry : data.getMethodAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { final MethodIdentifier method = MethodIdentifier.getIdentifierForMethod(entry.getKey()); componentConfiguration.getTransactionAttributes().setAttribute(methodIntf, entry.getValue().get(0), entry.getKey().getDeclaringClass().getName(), method.getName(), method.getParameterTypes()); } } }
private void processTransactionTimeoutAnnotation(final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, MethodIntf methodIntf, final EJBComponentDescription componentConfiguration) { final RuntimeAnnotationInformation<Integer> data = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, TransactionTimeout.class); for (Map.Entry<String, List<Integer>> entry : data.getClassAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { //we can't specify both methodIntf and class name final String className = methodIntf == null ? entry.getKey() : null; componentConfiguration.getTransactionTimeouts().setAttribute(methodIntf, className, entry.getValue().get(0)); } } for (Map.Entry<Method, List<Integer>> entry : data.getMethodAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { final MethodIdentifier method = MethodIdentifier.getIdentifierForMethod(entry.getKey()); final String className = entry.getKey().getDeclaringClass().getName(); componentConfiguration.getTransactionTimeouts().setAttribute(methodIntf, entry.getValue().get(0), className, method.getName(), method.getParameterTypes()); } } }
protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SessionBeanComponentDescription componentConfiguration) { //handle lock annotations final RuntimeAnnotationInformation<LockType> lockData = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, Lock.class); for (Map.Entry<String, List<LockType>> entry : lockData.getClassAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { componentConfiguration.setBeanLevelLockType(entry.getKey(), entry.getValue().get(0)); } } for (Map.Entry<Method, List<LockType>> entry : lockData.getMethodAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { componentConfiguration.setLockType(entry.getValue().get(0), MethodIdentifier.getIdentifierForMethod(entry.getKey())); } } final RuntimeAnnotationInformation<AccessTimeoutDetails> accessTimeout = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, AccessTimeout.class); for (Map.Entry<String, List<AccessTimeoutDetails>> entry : accessTimeout.getClassAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { componentConfiguration.setBeanLevelAccessTimeout(entry.getKey(), entry.getValue().get(0)); } } for (Map.Entry<Method, List<AccessTimeoutDetails>> entry : accessTimeout.getMethodAnnotations().entrySet()) { if (!entry.getValue().isEmpty()) { componentConfiguration.setAccessTimeout(entry.getValue().get(0), MethodIdentifier.getIdentifierForMethod(entry.getKey())); } } }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription description) throws DeploymentUnitProcessingException { final RuntimeAnnotationInformation<Boolean> permitData = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, PermitAll.class); for (Map.Entry<String, List<Boolean>> entry : permitData.getClassAnnotations().entrySet()) { description.getAnnotationMethodPermissions().setAttribute(null, entry.getKey(), EJBMethodSecurityAttribute.permitAll()); } for (Map.Entry<Method, List<Boolean>> entry : permitData.getMethodAnnotations().entrySet()) { final Method method = entry.getKey(); final MethodIdentifier identifier = MethodIdentifier.getIdentifierForMethod(method); description.getAnnotationMethodPermissions().setAttribute(null, EJBMethodSecurityAttribute.permitAll(), method.getDeclaringClass().getName(), method.getName(), identifier.getParameterTypes()); } final RuntimeAnnotationInformation<String[]> data = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, RolesAllowed.class); for (Map.Entry<String, List<String[]>> entry : data.getClassAnnotations().entrySet()) { description.getAnnotationMethodPermissions().setAttribute(null, entry.getKey(), EJBMethodSecurityAttribute.rolesAllowed(new HashSet<String>(Arrays.<String>asList(entry.getValue().get(0))))); } for (Map.Entry<Method, List<String[]>> entry : data.getMethodAnnotations().entrySet()) { final Method method = entry.getKey(); final MethodIdentifier identifier = MethodIdentifier.getIdentifierForMethod(method); description.getAnnotationMethodPermissions().setAttribute(null, EJBMethodSecurityAttribute.rolesAllowed(new HashSet<String>(Arrays.<String>asList(entry.getValue().get(0)))), method.getDeclaringClass().getName(), method.getName(), identifier.getParameterTypes()); } final RuntimeAnnotationInformation<Boolean> denyData = MethodAnnotationAggregator.runtimeAnnotationInformation(componentClass, applicationClasses, deploymentReflectionIndex, DenyAll.class); for (Map.Entry<String, List<Boolean>> entry : denyData.getClassAnnotations().entrySet()) { description.getAnnotationMethodPermissions().setAttribute(null, entry.getKey(), EJBMethodSecurityAttribute.denyAll()); } for (Map.Entry<Method, List<Boolean>> entry : denyData.getMethodAnnotations().entrySet()) { final Method method = entry.getKey(); final MethodIdentifier identifier = MethodIdentifier.getIdentifierForMethod(method); description.getAnnotationMethodPermissions().setAttribute(null, EJBMethodSecurityAttribute.denyAll(), method.getDeclaringClass().getName(), method.getName(), identifier.getParameterTypes()); } }
if (excludeDefaultInterceptors.getClassAnnotations().containsKey(componentClass.getName())) { description.setExcludeDefaultInterceptors(true); final List<String[]> classInterceptors = interceptors.getClassAnnotations().get(clazz.getName()); if (classInterceptors != null) { for (final String interceptor : classInterceptors.get(0)) {
if (excludeDefaultInterceptors.getClassAnnotations().containsKey(componentClass.getName())) { description.setExcludeDefaultInterceptors(true); final List<String[]> classInterceptors = interceptors.getClassAnnotations().get(clazz.getName()); if (classInterceptors != null) { for (final String interceptor : classInterceptors.get(0)) {
if (excludeDefaultInterceptors.getClassAnnotations().containsKey(componentClass.getName())) { description.setExcludeDefaultInterceptors(true); final List<String[]> classInterceptors = interceptors.getClassAnnotations().get(clazz.getName()); if (classInterceptors != null) { for (final String interceptor : classInterceptors.get(0)) {