Package org.jboss.metadata.ejb.spec

Examples of org.jboss.metadata.ejb.spec.SessionBeanMetaData


        }

    }

    protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final StatefulComponentDescription componentConfiguration) throws DeploymentUnitProcessingException {
        SessionBeanMetaData beanMetaData = componentConfiguration.getDescriptorData();
        if (beanMetaData == null) {
            return;
        }
        if (beanMetaData.getRemoveMethods() == null || beanMetaData.getRemoveMethods().isEmpty()) {
            return;
        }

        final DeploymentReflectionIndex reflectionIndex = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.REFLECTION_INDEX);

        final Set<MethodIdentifier> annotationRemoveMethods = new HashSet<MethodIdentifier>();
        for(final StatefulComponentDescription.StatefulRemoveMethod method : componentConfiguration.getRemoveMethods()) {
            annotationRemoveMethods.add(method.getMethodIdentifier());
        }

        //We loop through twice, as the more more general form with no parameters is applied to all methods with that name
        //while the method that specifies the actual parameters override this
        for (final RemoveMethodMetaData removeMethod : beanMetaData.getRemoveMethods()) {
            if(removeMethod.getBeanMethod().getMethodParams() == null) {
                final NamedMethodMetaData methodData = removeMethod.getBeanMethod();
                final Collection<Method> methods = MethodResolutionUtils.resolveMethods(methodData, componentClass, reflectionIndex);
                for(final Method method : methods) {
                    final Boolean retainIfException = removeMethod.getRetainIfException();
                    final MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifierForMethod(method);
                    if(retainIfException == null) {
                        //if this is null we have to allow annotation values of retainIfException to take precidence
                        if(!annotationRemoveMethods.contains(methodIdentifier)) {
                            componentConfiguration.addRemoveMethod(methodIdentifier, false);
                        }
                    } else {
                        componentConfiguration.addRemoveMethod(methodIdentifier, retainIfException);
                    }
                }
            }
        }
        for (final RemoveMethodMetaData removeMethod : beanMetaData.getRemoveMethods()) {
            if(removeMethod.getBeanMethod().getMethodParams() != null) {
                final NamedMethodMetaData methodData = removeMethod.getBeanMethod();
                final Collection<Method> methods = MethodResolutionUtils.resolveMethods(methodData, componentClass, reflectionIndex);
                for(final Method method : methods) {
                    final Boolean retainIfException = removeMethod.getRetainIfException();
View Full Code Here


                continue;
            }
            final String ejbName = sessionBeanClassInfo.name().local();
            final AnnotationValue nameValue = sessionBeanAnnotation.value("name");
            final String beanName = nameValue == null || nameValue.asString().isEmpty() ? ejbName : nameValue.asString();
            final SessionBeanMetaData beanMetaData = getEnterpriseBeanMetaData(deploymentUnit, beanName, SessionBeanMetaData.class);
            final SessionBeanComponentDescription.SessionBeanType sessionBeanType;
            final String beanClassName;
            if (beanMetaData != null) {
                beanClassName = override(sessionBeanClassInfo.name().toString(), beanMetaData.getEjbClass());
                sessionBeanType = override(annotatedSessionBeanType, descriptionOf(((SessionBeanMetaData) beanMetaData).getSessionType()));
            } else {
                beanClassName = sessionBeanClassInfo.name().toString();
                sessionBeanType = annotatedSessionBeanType;
            }
View Full Code Here

   @Override
   public void merge(JBossEnterpriseBeanMetaData override, EnterpriseBeanMetaData original, String overridenFile, String overrideFile, boolean mustOverride)
   {
      super.merge(override, original, overridenFile, overrideFile, mustOverride);
      JBossSessionBeanMetaData joverride = (JBossSessionBeanMetaData) override;
      SessionBeanMetaData soriginal = (SessionBeanMetaData) original;

      // home
      if(joverride != null && joverride.getHome() != null)
         home = joverride.getHome();
      else if(soriginal != null && soriginal.getHome() != null)
         home = soriginal.getHome();
      // remote
      if(joverride != null && joverride.getRemote() != null)
         remote = joverride.getRemote();
      else if(soriginal != null && soriginal.getRemote() != null)
         remote = soriginal.getRemote();
      // localHome
      if(joverride != null && joverride.getLocalHome() != null)
         localHome = joverride.getLocalHome();
      else if(soriginal != null && soriginal.getLocalHome() != null)
         localHome = soriginal.getLocalHome();
      // local
      if(joverride != null && joverride.getLocal() != null)
         local = joverride.getLocal();
      else if(soriginal != null && soriginal.getLocal() != null)
         local = soriginal.getLocal();
      // businessLocals
      if(joverride != null && joverride.getBusinessLocals() != null)
         businessLocals = joverride.getBusinessLocals();
      else if(soriginal != null && soriginal.getBusinessLocals() != null)
         businessLocals = soriginal.getBusinessLocals();
      // businessRemotes
      if(joverride != null && joverride.getBusinessRemotes() != null)
         businessRemotes = joverride.getBusinessRemotes();
      else if(soriginal != null && soriginal.getBusinessRemotes() != null)
         businessRemotes = soriginal.getBusinessRemotes();
      // serviceEndpoint
      if(joverride != null && joverride.getServiceEndpoint() != null)
         serviceEndpoint = joverride.getServiceEndpoint();
      else if(soriginal != null && soriginal.getServiceEndpoint() != null)
         serviceEndpoint = soriginal.getServiceEndpoint();
      // sessionType
      if(joverride != null && joverride.getSessionType() != null)
         sessionType = joverride.getSessionType();
      else if(soriginal != null && soriginal.getSessionType() != null)
         sessionType = soriginal.getSessionType();
      // timeoutMethod
      if(joverride != null && joverride.getTimeoutMethod() != null)
         timeoutMethod = joverride.getTimeoutMethod();
      else if(soriginal != null && soriginal.getTimeoutMethod() != null)
         timeoutMethod = soriginal.getTimeoutMethod();
      // initMethods
      if(joverride != null && joverride.getInitMethods() != null)
         initMethods = joverride.getInitMethods();
      else if(soriginal != null && soriginal.getInitMethods() != null)
         initMethods = soriginal.getInitMethods();
      // removeMethods
      if(joverride != null && joverride.getRemoveMethods() != null)
         removeMethods = joverride.getRemoveMethods();
      else if(soriginal != null && soriginal.getRemoveMethods() != null)
         removeMethods = soriginal.getRemoveMethods();
      // aroundInvokes
      if(joverride != null && joverride.getAroundInvokes() != null)
         aroundInvokes = joverride.getAroundInvokes();
      else if(soriginal != null && soriginal.getAroundInvokes() != null)
         aroundInvokes = soriginal.getAroundInvokes();
      // postActivates
      if(joverride != null && joverride.getPostActivates() != null)
         postActivates = joverride.getPostActivates();
      else if(soriginal != null && soriginal.getPostActivates() != null)
         postActivates = soriginal.getPostActivates();
      // prePassivates
      if(joverride != null && joverride.getPrePassivates() != null)
         prePassivates = joverride.getPrePassivates();
      else if(soriginal != null && soriginal.getPrePassivates() != null)
         prePassivates = soriginal.getPrePassivates();
      // securityRoleRefs
      if(joverride != null && joverride.getSecurityRoleRefs() != null)
         securityRoleRefs = joverride.getSecurityRoleRefs();
      else if(soriginal != null && soriginal.getSecurityRoleRefs() != null)
         securityRoleRefs = soriginal.getSecurityRoleRefs();

      if(joverride != null)
      {
         // jndiName
         if(joverride.getJndiName() != null)
View Full Code Here

                continue;
            }
            final String ejbName = sessionBeanClassInfo.name().local();
            final AnnotationValue nameValue = sessionBeanAnnotation.value("name");
            final String beanName = nameValue == null || nameValue.asString().isEmpty() ? ejbName : nameValue.asString();
            final SessionBeanMetaData beanMetaData = getEnterpriseBeanMetaData(deploymentUnit, beanName, SessionBeanMetaData.class);
            final SessionBeanComponentDescription.SessionBeanType sessionBeanType;
            final String beanClassName;
            if (beanMetaData != null) {
                sessionBeanType = override(annotatedSessionBeanType, descriptionOf(beanMetaData.getSessionType()));
                beanClassName = override(sessionBeanClassInfo.name().toString(), beanMetaData.getEjbClass());
            } else {
                sessionBeanType = annotatedSessionBeanType;
                beanClassName = sessionBeanClassInfo.name().toString();
            }
View Full Code Here

                continue;
            }
            final String ejbName = sessionBeanClassInfo.name().local();
            final AnnotationValue nameValue = sessionBeanAnnotation.value("name");
            final String beanName = nameValue == null || nameValue.asString().isEmpty() ? ejbName : nameValue.asString();
            final SessionBeanMetaData beanMetaData = getEnterpriseBeanMetaData(deploymentUnit, beanName, SessionBeanMetaData.class);
            final SessionBeanComponentDescription.SessionBeanType sessionBeanType;
            final String beanClassName;
            if (beanMetaData != null) {
                beanClassName = override(sessionBeanClassInfo.name().toString(), beanMetaData.getEjbClass());
                sessionBeanType = override(annotatedSessionBeanType, descriptionOf(((SessionBeanMetaData) beanMetaData).getSessionType()));
            } else {
                beanClassName = sessionBeanClassInfo.name().toString();
                sessionBeanType = annotatedSessionBeanType;
            }
View Full Code Here

            }
            final ClassInfo sessionBeanClassInfo = (ClassInfo) target;
            final String ejbName = sessionBeanClassInfo.name().local();
            final AnnotationValue nameValue = sessionBeanAnnotation.value("name");
            final String beanName = nameValue == null || nameValue.asString().isEmpty() ? ejbName : nameValue.asString();
            final SessionBeanMetaData beanMetaData = getEnterpriseBeanMetaData(deploymentUnit, beanName, SessionBeanMetaData.class);
            final SessionBeanComponentDescription.SessionBeanType sessionBeanType;
            final String beanClassName;
            if (beanMetaData != null) {
                sessionBeanType = override(annotatedSessionBeanType, descriptionOf(beanMetaData.getSessionType()));
                beanClassName = override(sessionBeanClassInfo.name().toString(), beanMetaData.getEjbClass());
            } else {
                sessionBeanType = annotatedSessionBeanType;
                beanClassName = sessionBeanClassInfo.name().toString();
            }
View Full Code Here

/*     */
/*     */   public void merge(JBossEnterpriseBeanMetaData override, EnterpriseBeanMetaData original, String overridenFile, String overrideFile, boolean mustOverride)
/*     */   {
/* 818 */     super.merge(override, original, overridenFile, overrideFile, mustOverride);
/* 819 */     JBossSessionBeanMetaData joverride = (JBossSessionBeanMetaData)override;
/* 820 */     SessionBeanMetaData soriginal = (SessionBeanMetaData)original;
/*     */
/* 823 */     if ((joverride != null) && (joverride.home != null))
/* 824 */       this.home = joverride.home;
/* 825 */     else if ((soriginal != null) && (soriginal.getHome() != null)) {
/* 826 */       this.home = soriginal.getHome();
/*     */     }
/* 828 */     if ((joverride != null) && (joverride.remote != null))
/* 829 */       this.remote = joverride.remote;
/* 830 */     else if ((soriginal != null) && (soriginal.getRemote() != null)) {
/* 831 */       this.remote = soriginal.getRemote();
/*     */     }
/* 833 */     if ((joverride != null) && (joverride.localHome != null))
/* 834 */       this.localHome = joverride.localHome;
/* 835 */     else if ((soriginal != null) && (soriginal.getLocalHome() != null)) {
/* 836 */       this.localHome = soriginal.getLocalHome();
/*     */     }
/* 838 */     if ((joverride != null) && (joverride.local != null))
/* 839 */       this.local = joverride.local;
/* 840 */     else if ((soriginal != null) && (soriginal.getLocal() != null)) {
/* 841 */       this.local = soriginal.getLocal();
/*     */     }
/* 843 */     if ((joverride != null) && (joverride.businessLocals != null))
/* 844 */       this.businessLocals = joverride.businessLocals;
/* 845 */     else if ((soriginal != null) && (soriginal.getBusinessLocals() != null)) {
/* 846 */       this.businessLocals = soriginal.getBusinessLocals();
/*     */     }
/* 848 */     if ((joverride != null) && (joverride.businessRemotes != null))
/* 849 */       this.businessRemotes = joverride.businessRemotes;
/* 850 */     else if ((soriginal != null) && (soriginal.getBusinessRemotes() != null)) {
/* 851 */       this.businessRemotes = soriginal.getBusinessRemotes();
/*     */     }
/* 853 */     if ((joverride != null) && (joverride.serviceEndpoint != null))
/* 854 */       this.serviceEndpoint = joverride.serviceEndpoint;
/* 855 */     else if ((soriginal != null) && (soriginal.getServiceEndpoint() != null)) {
/* 856 */       this.serviceEndpoint = soriginal.getServiceEndpoint();
/*     */     }
/* 858 */     if ((joverride != null) && (joverride.sessionType != null))
/* 859 */       this.sessionType = joverride.sessionType;
/* 860 */     else if ((soriginal != null) && (soriginal.getSessionType() != null)) {
/* 861 */       this.sessionType = soriginal.getSessionType();
/*     */     }
/* 863 */     if ((joverride != null) && (joverride.timeoutMethod != null))
/* 864 */       this.timeoutMethod = joverride.timeoutMethod;
/* 865 */     else if ((soriginal != null) && (soriginal.getTimeoutMethod() != null)) {
/* 866 */       this.timeoutMethod = soriginal.getTimeoutMethod();
/*     */     }
/* 868 */     if ((joverride != null) && (joverride.initMethods != null))
/* 869 */       this.initMethods = joverride.initMethods;
/* 870 */     else if ((soriginal != null) && (soriginal.getInitMethods() != null)) {
/* 871 */       this.initMethods = soriginal.getInitMethods();
/*     */     }
/* 873 */     if ((joverride != null) && (joverride.removeMethods != null))
/* 874 */       this.removeMethods = joverride.removeMethods;
/* 875 */     else if ((soriginal != null) && (soriginal.getRemoveMethods() != null)) {
/* 876 */       this.removeMethods = soriginal.getRemoveMethods();
/*     */     }
/* 878 */     if ((joverride != null) && (joverride.aroundInvokes != null))
/* 879 */       this.aroundInvokes = joverride.aroundInvokes;
/* 880 */     else if ((soriginal != null) && (soriginal.getAroundInvokes() != null)) {
/* 881 */       this.aroundInvokes = soriginal.getAroundInvokes();
/*     */     }
/* 883 */     if ((joverride != null) && (joverride.postActivates != null))
/* 884 */       this.postActivates = joverride.postActivates;
/* 885 */     else if ((soriginal != null) && (soriginal.getPostActivates() != null)) {
/* 886 */       this.postActivates = soriginal.getPostActivates();
/*     */     }
/* 888 */     if ((joverride != null) && (joverride.prePassivates != null))
/* 889 */       this.prePassivates = joverride.prePassivates;
/* 890 */     else if ((soriginal != null) && (soriginal.getPrePassivates() != null)) {
/* 891 */       this.prePassivates = soriginal.getPrePassivates();
/*     */     }
/* 893 */     if ((joverride != null) && (joverride.securityRoleRefs != null))
/* 894 */       this.securityRoleRefs = joverride.securityRoleRefs;
/* 895 */     else if ((soriginal != null) && (soriginal.getSecurityRoleRefs() != null)) {
/* 896 */       this.securityRoleRefs = soriginal.getSecurityRoleRefs();
/*     */     }
/*     */
/* 899 */     if ((joverride != null) && (joverride.jndiName != null)) {
/* 900 */       this.jndiName = joverride.jndiName;
/*     */     }
View Full Code Here

/*    */   {
/* 47 */     Stateless annotation = (Stateless)this.finder.getAnnotation(beanClass, Stateless.class);
/* 48 */     if (annotation == null) {
/* 49 */       return null;
/*    */     }
/* 51 */     SessionBeanMetaData beanMetaData = create(beanClass, annotation);
/* 52 */     beanMetaData.setSessionType(SessionType.Stateless);
/* 53 */     return beanMetaData;
/*    */   }
View Full Code Here

/*     */   }
/*     */
/*     */   public abstract SessionBeanMetaData create(Class<?> paramClass);
/*     */
/*     */   protected SessionBeanMetaData create(Class<?> beanClass, String name, String mappedName, String description) {
/*  73 */     SessionBeanMetaData bean = new SessionBeanMetaData();
/*  74 */     bean.setEjbClass(beanClass.getName());
/*     */     String ejbName;
/*     */     String ejbName;
/*  76 */     if ((name == null) || (name.length() == 0))
/*  77 */       ejbName = beanClass.getSimpleName();
/*     */     else
/*  79 */       ejbName = name;
/*  80 */     bean.setEjbName(ejbName);
/*  81 */     if ((mappedName != null) && (mappedName.length() > 0))
/*  82 */       bean.setMappedName(mappedName);
/*  83 */     if ((description != null) && (description.length() > 0))
/*     */     {
/*  85 */       DescriptionGroupMetaData descriptionGroup = new DescriptionGroupMetaData();
/*  86 */       DescriptionsImpl descriptions = new DescriptionsImpl();
/*  87 */       DescriptionImpl descriptionImpl = new DescriptionImpl();
/*  88 */       descriptionImpl.setDescription(description);
/*  89 */       descriptions.add(descriptionImpl);
/*  90 */       descriptionGroup.setDescriptions(descriptions);
/*  91 */       bean.setDescriptionGroup(descriptionGroup);
/*     */     }
/*     */
/*  94 */     TransactionManagement txMgmt = (TransactionManagement)this.finder.getAnnotation(beanClass, TransactionManagement.class);
/*  95 */     TransactionManagementType txType = TransactionManagementType.CONTAINER;
/*  96 */     if (txMgmt != null)
/*  97 */       txType = txMgmt.value();
/*  98 */     bean.setTransactionType(txType);
/*     */
/* 100 */     processTopLevel(bean, beanClass);
/*     */
/* 102 */     return bean;
/*     */   }
View Full Code Here

/*    */   {
/* 51 */     Stateful annotation = (Stateful)this.finder.getAnnotation(beanClass, Stateful.class);
/* 52 */     if (annotation == null) {
/* 53 */       return null;
/*    */     }
/* 55 */     SessionBeanMetaData beanMetaData = create(beanClass, annotation);
/* 56 */     beanMetaData.setSessionType(SessionType.Stateful);
/* 57 */     return beanMetaData;
/*    */   }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.ejb.spec.SessionBeanMetaData

Copyright © 2018 www.massapicom. 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.