Package javax.ejb

Examples of javax.ejb.Stateless


      throw error(L.l(
             "'{0}' must not be abstract.  Session bean implementations must be fully implemented.",
             ejbJavaClass.getName()));

    if (ejbClass.isAnnotationPresent(Stateless.class)) {
      Stateless stateless = ejbClass.getAnnotation(Stateless.class);

      if (getEJBName() == null && !"".equals(stateless.name()))
        setEJBName(stateless.name());

      _sessionType = Stateless.class;
    } else if (ejbClass.isAnnotationPresent(Stateful.class)) {
      Stateful stateful = ejbClass.getAnnotation(Stateful.class);
View Full Code Here


      if (annType.isAnnotationPresent(Stateless.class)) {
        EjbStatelessBean<X> bean
          = new EjbStatelessBean<X>(this, rawAnnType, annType, moduleName);
        bean.setInjectionTarget(injectTarget);

        Stateless stateless = annType.getAnnotation(Stateless.class);

        if (! "".equals(stateless.name()) && stateless.name() != null)
          bean.setEJBName(stateless.name());

        setBeanConfig(bean.getEJBName(), bean);
      }
      else if (annType.isAnnotationPresent(Stateful.class)) {
        EjbStatefulBean<X> bean
View Full Code Here

    if (getInstanceClass() == null)
      throw new ConfigException(L.l("ejb-stateless-bean requires a 'class' attribute"));

    final String name = getName();

    Annotation ann = new Stateless() {
        public Class annotationType() { return Stateless.class; }
        public String name() { return name; }
        public String mappedName() { return name; }
        public String description() { return ""; }
    };
View Full Code Here

        throw new ConfigException(L.l("'{0}' needs a configured session-type",
                                      ejbClass.getName()));
    }

    if ("Stateless".equals(_sessionType)) {
      Stateless stateless = new StatelessLiteral(name, mappedName, description);
      annType.addAnnotation(stateless);
     
      return new EjbStatelessBean<T>(getConfig(), rawAnnType, annType, moduleName);
    }
    else if ("Stateful".equals(_sessionType)) {
View Full Code Here

                    sessionBean.setSessionType(SessionType.SINGLETON);
                }
            }

            for (Class<?> beanClass : finder.findAnnotatedClasses(Stateless.class)) {
                Stateless stateless = beanClass.getAnnotation(Stateless.class);
                String ejbName = getEjbName(stateless, beanClass);

                if (!isValidAnnotationUsage(Stateless.class, beanClass, ejbName, ejbModule)) continue;

                EnterpriseBean enterpriseBean = ejbJar.getEnterpriseBean(ejbName);
View Full Code Here

                    managedClasses.remove(beanClass.get().getName());
                    specializingClasses.add(beanClass.get());
                    continue;
                }

                Stateless stateless = beanClass.getAnnotation(Stateless.class);
                String ejbName = getEjbName(stateless, beanClass.get());

                if (!isValidEjbAnnotationUsage(Stateless.class, beanClass, ejbName, ejbModule)) continue;

                EnterpriseBean enterpriseBean = ejbJar.getEnterpriseBean(ejbName);
                if (enterpriseBean == null) {
                    enterpriseBean = new StatelessBean(ejbName, beanClass.get());
                    ejbJar.addEnterpriseBean(enterpriseBean);
                }
                if (enterpriseBean.getEjbClass() == null) {
                    enterpriseBean.setEjbClass(beanClass.get());
                }
                if (enterpriseBean instanceof SessionBean) {
                    SessionBean sessionBean = (SessionBean) enterpriseBean;
                    sessionBean.setSessionType(SessionType.STATELESS);

                    if (stateless.mappedName() != null) {
                        sessionBean.setMappedName(stateless.mappedName());
                    }
                }
                LegacyProcessor.process(beanClass.get(), enterpriseBean);
            }
View Full Code Here

                        if (annotation != null && specified(annotation.name())) {
                            return annotation.name();
                        }
                    }
                    case STATELESS: {
                        final Stateless annotation = clazz.getAnnotation(Stateless.class);
                        if (annotation != null && specified(annotation.name())) {
                            return annotation.name();
                        }
                    }
                    case SINGLETON: {
                        final Singleton annotation = clazz.getAnnotation(Singleton.class);
                        if (annotation != null && specified(annotation.name())) {
                            return annotation.name();
                        }
                    }
                }
            }

            if (bean instanceof MessageDrivenBean) {
                final MessageDriven annotation = clazz.getAnnotation(MessageDriven.class);
                if (annotation != null && specified(annotation.name())) {
                    return annotation.name();
                }
            }

            return clazz.getSimpleName();
        }
View Full Code Here

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

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

   }

   @Override
   public JBossSessionBeanMetaData create(Class<?> beanClass)
   {
      Stateless annotation = finder.getAnnotation(beanClass, Stateless.class);
      if(annotation == null)
         return null;
     
      JBossSessionBeanMetaData beanMetaData = create(beanClass, annotation);
      beanMetaData.setSessionType(SessionType.Stateless);
View Full Code Here

TOP

Related Classes of javax.ejb.Stateless

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.