Package javax.ejb

Examples of javax.ejb.Stateless


            }
        } else {

          
            //TODO BM handle stateless
            Stateless stateless = null;
            try {
                stateless = annElem.getAnnotation(javax.ejb.Stateless.class);
            } catch (Exception e) {
                if (logger.isLoggable(Level.FINE)) {
                    //This can happen in the web.zip installation where there is no ejb
                    //Just logging the error
                    conLogger.log(Level.FINE, LogUtils.EXCEPTION_THROWN, e);
                }
            }
            Singleton singleton = null;
            try {
                singleton = annElem.getAnnotation(javax.ejb.Singleton.class);
            } catch (Exception e) {
                if (logger.isLoggable(Level.FINE)) {
                    //This can happen in the web.zip installation where there is no ejb
                    //Just logging the error
                    conLogger.log(Level.FINE, LogUtils.EXCEPTION_THROWN, e);
                }
            }
            String name;


            if ((stateless != null) &&((stateless).name()==null || stateless.name().length()>0)) {
                name = stateless.name();
            } else if ((singleton != null) &&((singleton).name()==null || singleton.name().length()>0)) {
                name = singleton.name();

            }else {
                name = ((Class) annElem).getSimpleName();
View Full Code Here


            }
        } else {

          
            //TODO BM handle stateless
            Stateless stateless = null;
            try {
                stateless = annElem.getAnnotation(javax.ejb.Stateless.class);
            } catch (Exception e) {
                if (logger.isLoggable(Level.FINE)) {
                    //This can happen in the web.zip installation where there is no ejb
                    //Just logging the error
                    conLogger.log(Level.FINE, LogUtils.EXCEPTION_THROWN, e);
                }
            }
            Singleton singleton = null;
            try {
                singleton = annElem.getAnnotation(javax.ejb.Singleton.class);
            } catch (Exception e) {
                if (logger.isLoggable(Level.FINE)) {
                    //This can happen in the web.zip installation where there is no ejb
                    //Just logging the error
                    conLogger.log(Level.FINE, LogUtils.EXCEPTION_THROWN, e);
                }
            }
            String name;


            if ((stateless != null) &&((stateless).name()==null || stateless.name().length()>0)) {
                name = stateless.name();
            } else if ((singleton != null) &&((singleton).name()==null || singleton.name().length()>0)) {
                name = singleton.name();

            }else {
                name = ((Class) annElem).getSimpleName();
View Full Code Here

                    }
                }
            }

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

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

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

                    if (stateless.mappedName() != null) {
                        sessionBean.setMappedName(stateless.mappedName());
                    }
                }
            }

            for (Class<?> beanClass : finder.findAnnotatedClasses(Stateful.class)) {
View Full Code Here

                if (beanClass.isAnnotationPresent(Specializes.class)) {
                    specializingClasses.add(beanClass.get());
                }

                final Stateless stateless = beanClass.getAnnotation(Stateless.class);
                final 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) {
                    final 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

                if (beanClass.isAnnotationPresent(Specializes.class)) {
                    specializingClasses.add(beanClass.get());
                }

                final Stateless stateless = beanClass.getAnnotation(Stateless.class);
                final 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) {
                    final 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

            /* 19.2:  ejb-name: Default is the unqualified name of the bean class */

            EjbJar ejbJar = ejbModule.getEjbJar();
            List<Class> classes = finder.findAnnotatedClasses(Stateless.class);
            for (Class<?> beanClass : classes) {
                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

                if (beanClass.isAnnotationPresent(Specializes.class)) {
                    specializingClasses.add(beanClass.get());
                }

                final Stateless stateless = beanClass.getAnnotation(Stateless.class);
                final 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) {
                    final 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

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.