Package org.jboss.metadata.ejb.jboss

Examples of org.jboss.metadata.ejb.jboss.JBossSessionBean31MetaData


      // only session beans and that too of type JBossSessionBean31MetaData
      if (metaData.isSession() == false || (metaData instanceof JBossSessionBean31MetaData) == false)
      {
         return null;
      }
      JBossSessionBean31MetaData sessionBean = (JBossSessionBean31MetaData) metaData;
      // get the bean level lock type
      LockType lockType = sessionBean.getLockType();
      // if no bean level lock type specified, then just return null
      if (lockType == null)
      {
         return null;
      }
View Full Code Here


      // only session beans and that too of type JBossSessionBean31MetaData
      if (metaData.isSession() == false || (metaData instanceof JBossSessionBean31MetaData) == false)
      {
         return null;
      }
      JBossSessionBean31MetaData sessionBean = (JBossSessionBean31MetaData) metaData;
      // create  a named method metadata to represent the method being queried
      NamedMethodMetaData namedMethod = new NamedMethodMetaData();
      namedMethod.setName(method.getName());
      if (method.getParameters() != null)
      {
         MethodParametersMetaData methodParams = new MethodParametersMetaData();
         methodParams.addAll(Arrays.asList(method.getParameters()));
         // set the method params on the named method metadata
         namedMethod.setMethodParams(methodParams);
      }
      ConcurrentMethodsMetaData concurrentMethods = sessionBean.getConcurrentMethods();
      if(concurrentMethods == null)
      {
         // EJB3.1 spec, section 4.8.5.5 specifies special meaning for @Lock annotation
         // on superclass(es) of bean.
         // If the method invoked belongs to the superclass of the bean, then pick up
         // the @Lock annotation from the superclass. If it's absent on the superclass
         // then by default it's LockType.WRITE
         String declaringClass = method.getDeclaringClass();
         // the check here for @Singleton bean is for optimization, so as to avoid
         // doing additional checks for non @Singleton beans since only @Singleton beans have explicit @Lock
         if (sessionBean.isSingleton() && declaringClass != null && !sessionBean.getEjbClass().equals(declaringClass))
         {
            LockType lockType = sessionBean.getLockType(declaringClass);
            if (lockType == null)
            {
               lockType = LockType.WRITE;
            }
            Lock lock = new LockImpl(lockType);
            return annotationClass.cast(lock);
         }
         // the method was invoked on the bean class (and not on super class of bean).
         // So return null. Later resolveClassAnnotation will pick up the correct bean level
         // lock semantics (either via the annotation or via metadata)
         return null;
      }
      // get the concurrency method metadata for this named method
      ConcurrentMethodMetaData concurrentMethodMetaData = concurrentMethods.find(namedMethod);
      LockType lockType = null;
      // if this named method did not have concurrency metadata or lock metadata, then
      // check for the method named "*" and see if that has the lock type set
      if (concurrentMethodMetaData == null || concurrentMethodMetaData.getLockType() == null)
      {
         // get lock type for method "*"
         lockType = getLockTypeApplicableForAllMethods(sessionBean);
      }
      else
      {
         lockType = concurrentMethodMetaData.getLockType();
      }
      // lock type was not specified for this method nor for the
      // method "*"
      if (lockType == null)
      {
         // EJB3.1 spec, section 4.8.5.5 specifies special meaning for @Lock annotation
         // on superclass(es) of bean.
         // If the method invoked belongs to the superclass of the bean, then pick up
         // the @Lock annotation from the superclass. If it's absent on the superclass
         // then by default it's LockType.WRITE
         String declaringClass = method.getDeclaringClass();
         // the check here for @Singleton bean is for optimization, so as to avoid
         // doing additional checks for non @Singleton beans since only @Singleton beans have explicit @Lock
         if (sessionBean.isSingleton() && declaringClass != null && !sessionBean.getEjbClass().equals(declaringClass))
         {
            lockType = sessionBean.getLockType(declaringClass);
            if (lockType == null)
            {
               lockType = LockType.WRITE;
            }
            Lock lock = new LockImpl(lockType);
View Full Code Here

   private AccessTimeoutEffigy findAccessTimeout(Method method)
   {
      AccessTimeoutMetaData accessTimeout = null;
      // best match
      JBossSessionBean31MetaData beanMetaData = getBeanMetaData();
      String params[] = params(method);
      ConcurrentMethodsMetaData concurrentMethods = beanMetaData.getConcurrentMethods();
      if(concurrentMethods != null)
      {
         ConcurrentMethodMetaData concurrentMethodMetaData = concurrentMethods.bestMatch(method.getName(), params);
         if(concurrentMethodMetaData != null)
         {
            // the concurrent-method might only contain a lock element, not an access-timeout
            accessTimeout = concurrentMethodMetaData.getAccessTimeout();
         }
      }
      if(accessTimeout == null)
         accessTimeout = beanMetaData.getAccessTimeout();
      return accessTimeout(accessTimeout);
   }
View Full Code Here

      // add the dependency on the EJB container
      invocationDependencies.add(enterpriseBean.getContainerName());

      if (this.isEJB31SessionBean(enterpriseBean))
      {
         JBossSessionBean31MetaData sessionBean = (JBossSessionBean31MetaData) enterpriseBean;
         // if the resolved bean is a singleton, then add a dependency on the singleton bean jndi binder
         if (sessionBean.isSingleton())
         {
            String singletonBeanJndiBinder = enterpriseBean.getContainerName() + ",type=singleton-bean-jndi-binder";
            invocationDependencies.add(singletonBeanJndiBinder);
         }
         // if the resolved interface is a no-interface view
         // then add a dependency on the no-interface view jndi binder
         String resolvedBusinessInterface = binderResolutionResult.getResolvedBusinessInterface();
         if (sessionBean.isNoInterfaceBean() && sessionBean.getEjbClass().equals(resolvedBusinessInterface))
         {
            String nointerfaceViewJndiBinder = enterpriseBean.getContainerName() + ",type=nointerface-view-jndi-binder";
            invocationDependencies.add(nointerfaceViewJndiBinder);
         }
      }
View Full Code Here

      }
      if (sessionBean instanceof JBossSessionBean31MetaData == false)
      {
         return false;
      }
      JBossSessionBean31MetaData sessionBean31 = (JBossSessionBean31MetaData) beanMetaData;
      return sessionBean31.isNoInterfaceBean();
   }
View Full Code Here

   protected boolean isNoInterface(JBossSessionBeanMetaData jsbmd)
   {
      if (jsbmd.isSession() && jsbmd instanceof JBossSessionBean31MetaData)
      {
         JBossSessionBean31MetaData sessionBeanMetaData = (JBossSessionBean31MetaData) jsbmd;
         return sessionBeanMetaData.isNoInterfaceBean();
      }
      return false;
   }
View Full Code Here

      }
      List<TimerMetaData> autoTimersMetaData = null;
      // Session bean
      if (enterpriseBeanMetaData.isSession() && enterpriseBeanMetaData instanceof JBossSessionBean31MetaData)
      {
         JBossSessionBean31MetaData sessionBean = (JBossSessionBean31MetaData) enterpriseBeanMetaData;
         // Stateful beans don't have timerservice/timers
         if (sessionBean.isStateful())
         {
            return;
         }
         // Get hold of the auto timer metadata
         autoTimersMetaData = sessionBean.getTimers();
      }
      // MDB
      else if (enterpriseBeanMetaData.isMessageDriven()
            && enterpriseBeanMetaData instanceof JBossMessageDrivenBean31MetaData)
      {
View Full Code Here

      }

      // If EJB 3.1
      if (session instanceof JBossSessionBean31MetaData)
      {
         final JBossSessionBean31MetaData session31 = (JBossSessionBean31MetaData) session;
         asyncMethods = session31.getAsyncMethods();
         if (asyncMethods == null)
         {
            asyncMethods = new AsyncMethodsMetaData();
         }
      }
View Full Code Here

      JBossSessionBeanMetaData sessionBean = (JBossSessionBeanMetaData) enterpriseBean;
      if (sessionBean instanceof JBossSessionBean31MetaData == false)
      {
         return;
      }
      JBossSessionBean31MetaData sessionBean31 = (JBossSessionBean31MetaData) sessionBean;
      if (!sessionBean31.isSingleton())
      {
         return;
      }
      process(unit, sessionBean31, container);
View Full Code Here

         }
         return;
      }

      // now start with actual processing
      JBossSessionBean31MetaData sessionBean = (JBossSessionBean31MetaData) beanMetaData;
      // we are only concerned with Singleton beans
      if (!sessionBean.isSingleton())
      {
         if (logger.isTraceEnabled())
         {
            logger.trace("Ignoring non-singleton bean " + sessionBean.getName());
         }
         return;
      }

      // Create a singleton container
      ClassLoader classLoader = unit.getClassLoader();
      String domainName = AOPBasedSingletonContainer.getAOPDomainName();
      DomainDefinition singletonContainerAOPDomain = AspectManager.instance().getContainer(domainName);
      if (singletonContainerAOPDomain == null)
      {
         throw new DeploymentException(domainName + " AOP domain not configured - cannot deploy EJB named "
               + beanMetaData.getEjbName() + " in unit " + unit);
      }
      Hashtable<String, String> ctxProperties = new Hashtable<String, String>();
      AOPBasedSingletonContainer singletonContainer;
      try
      {
         singletonContainer = new AOPBasedSingletonContainer(classLoader, sessionBean.getEjbClass(), sessionBean
               .getEjbName(), (Domain) singletonContainerAOPDomain.getManager(), ctxProperties, sessionBean, unit);
      }
      catch (ClassNotFoundException cnfe)
      {
         throw new DeploymentException(cnfe);
View Full Code Here

TOP

Related Classes of org.jboss.metadata.ejb.jboss.JBossSessionBean31MetaData

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.