Package org.jboss.metadata.ejb.spec

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


        }
    }

    @Override
    protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SingletonComponentDescription description) throws DeploymentUnitProcessingException {
        SessionBeanMetaData data = description.getDescriptorData();
        if (data instanceof SessionBean31MetaData) {
            SessionBean31MetaData singletonBeanMetaData = (SessionBean31MetaData) data;
            Boolean initOnStartup = singletonBeanMetaData.isInitOnStartup();
            if (initOnStartup != null && initOnStartup) {
                description.initOnStartup();
View Full Code Here


    @Override
    protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SessionBeanComponentDescription componentConfiguration) throws DeploymentUnitProcessingException {
        if (componentConfiguration.getDescriptorData() == null) {
            return;
        }
        SessionBeanMetaData data = componentConfiguration.getDescriptorData();
        if (data instanceof SessionBean31MetaData) {
            SessionBean31MetaData descriptor = (SessionBean31MetaData) data;
            final ConcurrencyManagementType type = descriptor.getConcurrencyManagementType();
            if (type != null) {
                componentConfiguration.setConcurrencyManagementType(type);
View Full Code Here

            description.setAfterCompletion(classIndex.getMethod(void.class, "afterCompletion", boolean.class));
            description.setBeforeCompletion(classIndex.getMethod(void.class,"beforeCompletion"));
            return;
        }

        SessionBeanMetaData data = description.getDescriptorData();
        if (data instanceof SessionBean31MetaData) {
            SessionBean31MetaData metaData = (SessionBean31MetaData) data;
            if (metaData.getAfterBeginMethod() != null)
                description.setAfterBegin(MethodResolutionUtils.resolveMethod(metaData.getAfterBeginMethod(), componentClass,reflectionIndex));
            if (metaData.getAfterCompletionMethod() != null)
View Full Code Here

        }
    }

    @Override
    protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final StatefulComponentDescription componentConfiguration) throws DeploymentUnitProcessingException {
        final SessionBeanMetaData data = componentConfiguration.getDescriptorData();
        if (data == null) {
            return;
        }
        if (data instanceof SessionBean31MetaData) {
            SessionBean31MetaData sessionBean31MetaData = (SessionBean31MetaData) data;
View Full Code Here

    }

    @Override
    protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SessionBeanComponentDescription description) throws DeploymentUnitProcessingException {
        final SessionBeanMetaData data = description.getDescriptorData();
        if (data != null) {
            if (data instanceof SessionBean31MetaData) {
                final SessionBean31MetaData sessionBeanData = (SessionBean31MetaData) data;
                final AsyncMethodsMetaData async = sessionBeanData.getAsyncMethods();
                if (async != null) {
View Full Code Here

            }
        }
    }

    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

    protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final SessionBeanComponentDescription componentConfiguration) throws DeploymentUnitProcessingException {

        if (componentConfiguration.getDescriptorData() == null) {
            return;
        }
        SessionBeanMetaData sessionBeanMetaData = componentConfiguration.getDescriptorData();
        if (sessionBeanMetaData instanceof SessionBean31MetaData) {
            SessionBean31MetaData descriptor = (SessionBean31MetaData) sessionBeanMetaData;

            //handle lock
            if (descriptor.getLockType() != null) {
View Full Code Here

   {
      Stateless annotation = finder.getAnnotation(beanClass, Stateless.class);
      if(annotation == null)
         return null;
     
      SessionBeanMetaData beanMetaData = create(beanClass, annotation);
      beanMetaData.setSessionType(SessionType.Stateless);
      return beanMetaData;
   }
View Full Code Here

            try
            {
               Class<?> ejbClass = classLoader.loadClass(bean.getEjbClass());
               if (bean.isSession())
               {
                  SessionBeanMetaData sb = (SessionBeanMetaData) bean;
                  JBossSessionBeanMetaData sessionBean = new JBossSessionBeanMetaData();
                  sessionBean.setEjbName(sb.getEjbName());
                  sessionBean.setEjbClass(sb.getEjbClass());

                  if (sb.isStateful())
                  {
                     StatefulProcessor processor = new StatefulProcessor(finder);
                     sessionBean.setSessionType(SessionType.Stateful);
                     processor.process(metaData, sessionBean, ejbClass);
                  }
View Full Code Here

   {
      Stateful annotation = finder.getAnnotation(beanClass, Stateful.class);
      if(annotation == null)
         return null;
     
      SessionBeanMetaData beanMetaData = create(beanClass, annotation);
      beanMetaData.setSessionType(SessionType.Stateful);
      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.