Search in sources :

Example 6 with EEModuleClassDescription

use of org.jboss.as.ee.component.EEModuleClassDescription in project wildfly by wildfly.

the class StartupMergingProcessor method handleAnnotations.

@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();
            }
        }
    }
}
Also used : EEModuleClassDescription(org.jboss.as.ee.component.EEModuleClassDescription) Startup(javax.ejb.Startup)

Example 7 with EEModuleClassDescription

use of org.jboss.as.ee.component.EEModuleClassDescription in project wildfly by wildfly.

the class StatefulTimeoutMergingProcessor method handleAnnotations.

@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));
    }
}
Also used : StatefulTimeoutInfo(org.jboss.as.ejb3.component.stateful.StatefulTimeoutInfo) StatefulTimeout(javax.ejb.StatefulTimeout) EEModuleClassDescription(org.jboss.as.ee.component.EEModuleClassDescription)

Example 8 with EEModuleClassDescription

use of org.jboss.as.ee.component.EEModuleClassDescription in project wildfly by wildfly.

the class ConcurrencyManagementMergingProcessor method handleAnnotations.

@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));
    }
}
Also used : ConcurrencyManagement(javax.ejb.ConcurrencyManagement) ConcurrencyManagementType(javax.ejb.ConcurrencyManagementType) EEModuleClassDescription(org.jboss.as.ee.component.EEModuleClassDescription)

Example 9 with EEModuleClassDescription

use of org.jboss.as.ee.component.EEModuleClassDescription in project wildfly by wildfly.

the class MdbDeliveryMergingProcessor method handleAnnotations.

@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));
        }
    }
}
Also used : DeliveryGroup(org.jboss.ejb3.annotation.DeliveryGroup) DeliveryActive(org.jboss.ejb3.annotation.DeliveryActive) EEModuleClassDescription(org.jboss.as.ee.component.EEModuleClassDescription)

Example 10 with EEModuleClassDescription

use of org.jboss.as.ee.component.EEModuleClassDescription in project wildfly by wildfly.

the class RunAsMergingProcessor method handleAnnotations.

@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);
}
Also used : RunAsPrincipal(org.jboss.ejb3.annotation.RunAsPrincipal) RunAs(javax.annotation.security.RunAs) EEModuleClassDescription(org.jboss.as.ee.component.EEModuleClassDescription)

Aggregations

EEModuleClassDescription (org.jboss.as.ee.component.EEModuleClassDescription)29 ClassInfo (org.jboss.jandex.ClassInfo)9 EEModuleDescription (org.jboss.as.ee.component.EEModuleDescription)6 MethodInfo (org.jboss.jandex.MethodInfo)6 CompositeIndex (org.jboss.as.server.deployment.annotation.CompositeIndex)5 ComponentDescription (org.jboss.as.ee.component.ComponentDescription)4 InterceptorClassDescription (org.jboss.as.ee.component.interceptors.InterceptorClassDescription)4 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)4 HashMap (java.util.HashMap)3 HashSet (java.util.HashSet)3 Map (java.util.Map)3 InvocationContext (javax.interceptor.InvocationContext)3 BindingConfiguration (org.jboss.as.ee.component.BindingConfiguration)3 InjectionSource (org.jboss.as.ee.component.InjectionSource)3 EJBEndpoint (org.jboss.as.webservices.metadata.model.EJBEndpoint)3 AnnotationInstance (org.jboss.jandex.AnnotationInstance)3 AnnotationTarget (org.jboss.jandex.AnnotationTarget)3 ServiceName (org.jboss.msc.service.ServiceName)3 WebService (javax.jws.WebService)2 WebServiceProvider (javax.xml.ws.WebServiceProvider)2