Package org.jboss.jandex

Examples of org.jboss.jandex.AnnotationInstance.target()


        }
        if (concurrencyMgmtAnnotations.size() > 1) {
            throw new DeploymentUnitProcessingException("More than one @ConcurrencyManagement annotation found on bean: " + componentDescription.getEJBName());
        }
        AnnotationInstance concurrencyMgmtAnnotation = concurrencyMgmtAnnotations.get(0);
        if (concurrencyMgmtAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@ConcurrencyManagement can appear only on a class. Target: " + concurrencyMgmtAnnotation.target() + " is not a class");
        }
        AnnotationValue conMgmtAnnVal = concurrencyMgmtAnnotation.value();
        ConcurrencyManagementType concurrencyManagementType = ConcurrencyManagementType.valueOf(conMgmtAnnVal.asEnum());
        switch (concurrencyManagementType) {
View Full Code Here


        if (concurrencyMgmtAnnotations.size() > 1) {
            throw new DeploymentUnitProcessingException("More than one @ConcurrencyManagement annotation found on bean: " + componentDescription.getEJBName());
        }
        AnnotationInstance concurrencyMgmtAnnotation = concurrencyMgmtAnnotations.get(0);
        if (concurrencyMgmtAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@ConcurrencyManagement can appear only on a class. Target: " + concurrencyMgmtAnnotation.target() + " is not a class");
        }
        AnnotationValue conMgmtAnnVal = concurrencyMgmtAnnotation.value();
        ConcurrencyManagementType concurrencyManagementType = ConcurrencyManagementType.valueOf(conMgmtAnnVal.asEnum());
        switch (concurrencyManagementType) {
            case CONTAINER:
View Full Code Here

            throw new RuntimeException("@Local appears more than once in EJB class: " + sessionBeanClass.name());
        }
        final Collection<String> localBusinessInterfaces = new HashSet<String>();

        AnnotationInstance ejbLocalAnnotation = ejbLocalAnnotations.get(0);
        AnnotationTarget target = ejbLocalAnnotation.target();
        if (target instanceof ClassInfo == false) {
            throw new RuntimeException("@Local should only appear on a class. Target: " + target + " is not a class");
        }
        AnnotationValue ejbLocalAnnValue = ejbLocalAnnotation.value();
        if (ejbLocalAnnValue == null) {
View Full Code Here

        // The @DependsOn must be on a @Singleton
        final List<AnnotationInstance> singletonAnnotations = annotationsOnBean.get(DotName.createSimple(Singleton.class
                .getName()));
        if (singletonAnnotations == null || singletonAnnotations.isEmpty()) {
            throw new DeploymentUnitProcessingException(
                    "@DependsOn can appear only on a class annotated with @Singleton. Target: " + dependsOnAnnotation.target()
                            + " is not a class.");
        }
        if (dependsOnAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@DependsOn can appear only on a class. Target: "
                    + dependsOnAnnotation.target() + " is not a class.");
View Full Code Here

        if (singletonAnnotations == null || singletonAnnotations.isEmpty()) {
            throw new DeploymentUnitProcessingException(
                    "@DependsOn can appear only on a class annotated with @Singleton. Target: " + dependsOnAnnotation.target()
                            + " is not a class.");
        }
        if (dependsOnAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@DependsOn can appear only on a class. Target: "
                    + dependsOnAnnotation.target() + " is not a class.");
        }
    }
View Full Code Here

                    "@DependsOn can appear only on a class annotated with @Singleton. Target: " + dependsOnAnnotation.target()
                            + " is not a class.");
        }
        if (dependsOnAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@DependsOn can appear only on a class. Target: "
                    + dependsOnAnnotation.target() + " is not a class.");
        }
    }

    // TODO - This should be externalized to share with EjbResourcesInjectionAnnotationProcessor
    private ServiceName createServiceName(final DeploymentUnit deploymentUnit, final String beanName, final String beanInterface) {
View Full Code Here

        }
        if (concurrencyMgmtAnnotations.size() > 1) {
            throw new DeploymentUnitProcessingException("More than one @ConcurrencyManagement annotation found on bean: " + componentDescription.getEJBName());
        }
        AnnotationInstance concurrencyMgmtAnnotation = concurrencyMgmtAnnotations.get(0);
        if (concurrencyMgmtAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@ConcurrencyManagement can appear only on a class. Target: " + concurrencyMgmtAnnotation.target() + " is not a class");
        }
        AnnotationValue conMgmtAnnVal = concurrencyMgmtAnnotation.value();
        ConcurrencyManagementType concurrencyManagementType = ConcurrencyManagementType.valueOf(conMgmtAnnVal.asEnum());
        switch (concurrencyManagementType) {
View Full Code Here

        if (concurrencyMgmtAnnotations.size() > 1) {
            throw new DeploymentUnitProcessingException("More than one @ConcurrencyManagement annotation found on bean: " + componentDescription.getEJBName());
        }
        AnnotationInstance concurrencyMgmtAnnotation = concurrencyMgmtAnnotations.get(0);
        if (concurrencyMgmtAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@ConcurrencyManagement can appear only on a class. Target: " + concurrencyMgmtAnnotation.target() + " is not a class");
        }
        AnnotationValue conMgmtAnnVal = concurrencyMgmtAnnotation.value();
        ConcurrencyManagementType concurrencyManagementType = ConcurrencyManagementType.valueOf(conMgmtAnnVal.asEnum());
        switch (concurrencyManagementType) {
            case CONTAINER:
View Full Code Here

  private void bindSingleIdAnnotation(EntityBinding entityBinding) {
    AnnotationInstance idAnnotation = JandexHelper.getSingleAnnotation(
        configuredClass.getClassInfo(), JPADotNames.ID
    );

    String idName = JandexHelper.getPropertyName( idAnnotation.target() );
    MappedAttribute idAttribute = configuredClass.getMappedProperty( idName );
    if ( !( idAttribute instanceof SimpleAttribute ) ) {
      throw new AssertionFailure( "Unexpected attribute type for id attribute" );
    }
View Full Code Here

    );
    if ( generatedValueAnn == null ) {
      return;
    }

    String idName = JandexHelper.getPropertyName( generatedValueAnn.target() );
    if ( !idPropertyName.equals( idName ) ) {
      throw new AssertionFailure(
          String.format(
              "Attribute[%s.%s] with @GeneratedValue doesn't have a @Id.",
              configuredClass.getName(),
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.