@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription description) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); //we only care about annotations on the bean class itself if (clazz == null) { return; } final ClassAnnotationInformation<DeclareRoles, String[]> declareRoles = clazz.getAnnotationInformation(DeclareRoles.class); if (declareRoles == null) { return; } if (!declareRoles.getClassLevelAnnotations().isEmpty()) { description.addDeclaredRoles(declareRoles.getClassLevelAnnotations().get(0)); } }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SessionBeanComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); //we only care about annotations on the bean class itself if (clazz == null) { return; } ClassAnnotationInformation<ConcurrencyManagement, ConcurrencyManagementType> management = clazz.getAnnotationInformation(ConcurrencyManagement.class); if (management == null) { return; } if (!management.getClassLevelAnnotations().isEmpty()) { componentConfiguration.setConcurrencyManagementType(management.getClassLevelAnnotations().get(0)); } }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final MessageDrivenComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); //we only care about annotations on the bean class itself if (clazz == null) { return; } final ClassAnnotationInformation<DeliveryActive, Boolean> deliveryActive = clazz.getAnnotationInformation(DeliveryActive.class); if (deliveryActive != null) { if (!deliveryActive.getClassLevelAnnotations().isEmpty()) { componentConfiguration.setDeliveryActive(deliveryActive.getClassLevelAnnotations().get(0)); } } final ClassAnnotationInformation<DeliveryGroup, String> deliveryGroup = clazz.getAnnotationInformation(DeliveryGroup.class); if (deliveryGroup != null) { if (!deliveryGroup.getClassLevelAnnotations().isEmpty()) { componentConfiguration.setDeliveryGroup(deliveryGroup.getClassLevelAnnotations().get(0)); } } }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); //we only care about annotations on the bean class itself if (clazz == null) { return; } ClassAnnotationInformation<TransactionManagement, TransactionManagementType> management = clazz.getAnnotationInformation(TransactionManagement.class); if (management == null) { return; } if (!management.getClassLevelAnnotations().isEmpty()) { componentConfiguration.setTransactionManagementType(management.getClassLevelAnnotations().get(0)); } }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final StatefulComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); //we only care about annotations on the bean class itself if (clazz == null) { return; } final ClassAnnotationInformation<StatefulTimeout, StatefulTimeoutInfo> timeout = clazz.getAnnotationInformation(StatefulTimeout.class); if (timeout == null) { return; } if (!timeout.getClassLevelAnnotations().isEmpty()) { componentConfiguration.setStatefulTimeout(timeout.getClassLevelAnnotations().get(0)); } }
@Override protected void handleAnnotations(DeploymentUnit deploymentUnit, EEApplicationClasses applicationClasses, DeploymentReflectionIndex deploymentReflectionIndex, Class<?> componentClass, StatefulComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); //we only care about annotations on the bean class itself if (clazz == null) { return; } final ClassAnnotationInformation<Cache, CacheInfo> cache = clazz.getAnnotationInformation(Cache.class); if (cache == null) { return; } if (!cache.getClassLevelAnnotations().isEmpty()) { componentConfiguration.setCache(cache.getClassLevelAnnotations().get(0)); } }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final MessageDrivenComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); //we only care about annotations on the bean class itself if (clazz == null) { return; } final ClassAnnotationInformation<ResourceAdapter, String> resourceAdapter = clazz.getAnnotationInformation(ResourceAdapter.class); if (resourceAdapter == null || resourceAdapter.getClassLevelAnnotations().isEmpty()) { return; } final String configuredAdapterName = resourceAdapter.getClassLevelAnnotations().get(0); final String adapterName = addEarPrefixIfRelativeName(configuredAdapterName, deploymentUnit, componentClass); componentConfiguration.setResourceAdapterName(adapterName); }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription description) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); //we only care about annotations on the bean class itself if (clazz == null) { return; } final ClassAnnotationInformation<SecurityDomain, String> securityDomain = clazz.getAnnotationInformation(SecurityDomain.class); if (securityDomain == null) { return; } if (!securityDomain.getClassLevelAnnotations().isEmpty()) { if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debug("EJB " + description.getEJBName() + " is part of security domain " + securityDomain.getClassLevelAnnotations().get(0)); } description.setSecurityDomain(securityDomain.getClassLevelAnnotations().get(0)); } }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); // we only care about annotations on the bean class itself if (clazz == null) { return; } final ClassAnnotationInformation<RunAs, String> runAs = clazz.getAnnotationInformation(RunAs.class); if (runAs == null) { return; } if (!runAs.getClassLevelAnnotations().isEmpty()) { componentConfiguration.setRunAs(runAs.getClassLevelAnnotations().get(0)); } final ClassAnnotationInformation<RunAsPrincipal, String> runAsPrincipal = clazz .getAnnotationInformation(RunAsPrincipal.class); String principal = DEFAULT_RUN_AS_PRINCIPAL; if (runAsPrincipal != null) { if (!runAsPrincipal.getClassLevelAnnotations().isEmpty()) { principal = runAsPrincipal.getClassLevelAnnotations().get(0); } } componentConfiguration.setRunAsPrincipal(principal); }
@Override protected void handleAnnotations(DeploymentUnit deploymentUnit, EEApplicationClasses applicationClasses, DeploymentReflectionIndex deploymentReflectionIndex, Class<?> componentClass, MessageDrivenComponentDescription componentDescription) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); //we only care about annotations on the bean class itself if (clazz == null) { return; } final ClassAnnotationInformation<ClusteredSingleton, Boolean> clustering = clazz.getAnnotationInformation(ClusteredSingleton.class); if (clustering == null || clustering.getClassLevelAnnotations().isEmpty()) { return; } componentDescription.setClusteredSingleton(true); }
@Override protected void handleAnnotations(DeploymentUnit deploymentUnit, EEApplicationClasses applicationClasses, DeploymentReflectionIndex deploymentReflectionIndex, Class<?> componentClass, T description) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); //we only care about annotations on the bean class itself if (clazz == null) { return; } final ClassAnnotationInformation<Pool, String> pool = clazz.getAnnotationInformation(Pool.class); if (pool == null) { return; } if (!pool.getClassLevelAnnotations().isEmpty()) { final String poolName = pool.getClassLevelAnnotations().get(0); if (poolName == null || poolName.trim().isEmpty()) { throw EjbLogger.ROOT_LOGGER.poolNameCannotBeEmptyString(description.getEJBName()); } this.setPoolName(description, poolName); } }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription description) throws DeploymentUnitProcessingException { final EEModuleClassDescription classDescription = applicationClasses.getClassByName(componentClass.getName()); if (classDescription == null) { return; } final EEApplicationDescription applicationDescription = deploymentUnit.getAttachment(Attachments.EE_APPLICATION_DESCRIPTION); final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT); //we ony care about annotations on the actual class final ClassAnnotationInformation<DependsOn, String[]> dependsOnClassAnnotationInformation = classDescription.getAnnotationInformation(DependsOn.class); if (dependsOnClassAnnotationInformation != null) { if (!dependsOnClassAnnotationInformation.getClassLevelAnnotations().isEmpty()) { final String[] annotationValues = dependsOnClassAnnotationInformation.getClassLevelAnnotations().get(0); setupDependencies(description, applicationDescription, deploymentRoot, annotationValues); } } }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SingletonComponentDescription description) throws DeploymentUnitProcessingException { EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); if (clazz != null) { final ClassAnnotationInformation<Startup, Object> data = clazz.getAnnotationInformation(Startup.class); if (data != null) { if (!data.getClassLevelAnnotations().isEmpty()) { description.initOnStartup(); description.getModuleDescription().registerStartupBean(); } } } }
if (annotationData != null) { if (!annotationData.getClassLevelAnnotations().isEmpty()) { classAnnotations.put(c.getName(), annotationData.getClassLevelAnnotations());
final ClassAnnotationInformation<LocalHome, String> localAnnotations = clazz.getAnnotationInformation(LocalHome.class); if (localAnnotations != null) { if (!localAnnotations.getClassLevelAnnotations().isEmpty()) { localHome = localAnnotations.getClassLevelAnnotations().get(0); if (!remoteAnnotations.getClassLevelAnnotations().isEmpty()) { home = remoteAnnotations.getClassLevelAnnotations().get(0); if (description.getEjbRemoteView() == null) {
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final MessageDrivenComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); //we only care about annotations on the bean class itself if (clazz == null) { return; } final ClassAnnotationInformation<ResourceAdapter, String> resourceAdaptor = clazz.getAnnotationInformation(ResourceAdapter.class); if (resourceAdaptor == null) { return; } if (!resourceAdaptor.getClassLevelAnnotations().isEmpty()) { componentConfiguration.setResourceAdapterName(resourceAdaptor.getClassLevelAnnotations().get(0)); } }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription description) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); //we only care about annotations on the bean class itself if (clazz == null) { return; } final ClassAnnotationInformation<DeclareRoles, String[]> declareRoles = clazz.getAnnotationInformation(DeclareRoles.class); if (declareRoles == null) { return; } if (!declareRoles.getClassLevelAnnotations().isEmpty()) { description.addDeclaredRoles(declareRoles.getClassLevelAnnotations().get(0)); } }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); //we only care about annotations on the bean class itself if (clazz == null) { return; } ClassAnnotationInformation<TransactionManagement, TransactionManagementType> management = clazz.getAnnotationInformation(TransactionManagement.class); if (management == null) { return; } if (!management.getClassLevelAnnotations().isEmpty()) { componentConfiguration.setTransactionManagementType(management.getClassLevelAnnotations().get(0)); } }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final StatefulComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); //we only care about annotations on the bean class itself if (clazz == null) { return; } final ClassAnnotationInformation<StatefulTimeout, StatefulTimeoutInfo> timeout = clazz.getAnnotationInformation(StatefulTimeout.class); if (timeout == null) { return; } if (!timeout.getClassLevelAnnotations().isEmpty()) { componentConfiguration.setStatefulTimeout(timeout.getClassLevelAnnotations().get(0)); } }
@Override protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SingletonComponentDescription description) throws DeploymentUnitProcessingException { EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); if (clazz != null) { final ClassAnnotationInformation<Startup, Object> data = clazz.getAnnotationInformation(Startup.class); if (data != null) { if (!data.getClassLevelAnnotations().isEmpty()) { description.initOnStartup(); } } } }