Package org.ow2.easybeans.component.itf

Examples of org.ow2.easybeans.component.itf.EZBStatisticComponent


            } catch (FactoryException fe) {
                throw new EZBContainerException("Cannot build the stateful factory", fe);
            }
        } else if (sessionBean.isSingleton()) {
            try {
                sessionFactory = new SingletonSessionFactory(className, this);
            } catch (FactoryException fe) {
                throw new EZBContainerException("Cannot build the stateful factory", fe);
            }
        } else {
            throw new EZBContainerException("unknown session type for: " + sessionBean);
View Full Code Here


            } catch (FactoryException fe) {
                throw new EZBContainerException("Cannot build the stateless factory", fe);
            }
        } else if (sessionBean.isStateful()) {
            try {
                sessionFactory = new StatefulSessionFactory(className, this);
            } catch (FactoryException fe) {
                throw new EZBContainerException("Cannot build the stateful factory", fe);
            }
        } else if (sessionBean.isSingleton()) {
            try {
View Full Code Here

        SessionFactory<?> sessionFactory = null;

        if (sessionBean.isStateless()) {
            try {
                sessionFactory = new StatelessSessionFactory(className, this);
            } catch (FactoryException fe) {
                throw new EZBContainerException("Cannot build the stateless factory", fe);
            }
        } else if (sessionBean.isStateful()) {
            try {
View Full Code Here

        // stateless ? (using id = stateful)
        boolean isStateless = !isUsingID();

        // build the metadata
        EasyBeansMetaData metadata = new EasyBeansMetaData(ejbHome, homeInterfaceClass, remoteInterfaceClass, isStateless);

        // return it
        return metadata;
    }
View Full Code Here

        if (this.available) {
            throw new IllegalStateException("Cannot change the EZBContainer configuration after start().");
        }
        this.configuration = config;
        this.id = String.valueOf(System.identityHashCode(this));
        this.deployment = new Deployment(this.configuration);
        this.factories = new HashMap<String, Factory<?, ?>>();
    }
View Full Code Here

        // Create Resolver for EAR
        EZBApplicationJNDIResolver applicationJNDIResolver = new ApplicationJNDIResolver();

        // Create EasyBeans injection Holder
        InjectionHolder ejbInjectionHolder = new InjectionHolder();
        ejbInjectionHolder.setPersistenceUnitManager(persistenceUnitManager);
        ejbInjectionHolder.setJNDIResolver(applicationJNDIResolver);


        // Configure containers
        for (EZBContainer container : containers) {
            // Set the classloader that needs to be used
View Full Code Here

            // Get meta data of the super class
            EasyBeansEjbJarClassMetadata superClassMetadata = beanclassAnnotationMetadata.getLinkedClassMetadata(superClass);

            if (superClassMetadata == null) {
                // TODO : I18n
                throw new ResolverException("The class " + beanclassAnnotationMetadata + " extends the class " + superClass
                        + "but this class seems to be outside of the ejb-jar");
            }

            // Takes method metadata of the super class and adds them to the
            // bean class
View Full Code Here

            if (superClass.equals(JAVA_LANG_OBJECT)) {
                return;
            }

            // Get meta data of the super class
            EasyBeansEjbJarClassMetadata superClassMetadata = beanclassAnnotationMetadata.getLinkedClassMetadata(superClass);

            if (superClassMetadata == null) {
                // TODO : I18n
                throw new ResolverException("The class " + beanclassAnnotationMetadata + " extends the class " + superClass
                        + "but this class seems to be outside of the ejb-jar");
            }

            // Takes method metadata of the super class and adds them to the
            // bean class
            // Note : the flag inherited is set to true
            for (EasyBeansEjbJarMethodMetadata methodAnnotationMetadata : superClassMetadata.getMethodMetadataCollection()) {
                // check that the method has not be redefined
                JMethod method = methodAnnotationMetadata.getJMethod();

                EasyBeansEjbJarMethodMetadata beanMethod = beanclassAnnotationMetadata.getMethodMetadata(method);
View Full Code Here

            }
            // add as visited
            visitedInterfaces.add(itf);

            // get meta data of the interface
            EasyBeansEjbJarClassMetadata itfMetadata = visitingclassAnnotationMetadata.getLinkedClassMetadata(itf);

            if (itfMetadata == null) {
                logger.warn("No class was found for interface {0}.", itf);
                continue;
            }

            // for each method of the interface, set the business method to true
            // in bean
            for (EasyBeansEjbJarMethodMetadata methodData : itfMetadata.getMethodMetadataCollection()) {
                JMethod itfMethod = methodData.getJMethod();

                // Ignore class init method
                if (itfMethod.getName().equals(CLASS_INIT) || itfMethod.getName().equals(CONST_INIT)) {
                    continue;
                }

                // take the method from the bean class
                EasyBeansEjbJarMethodMetadata beanMethod = beanclassAnnotationMetadata.getMethodMetadata(itfMethod);
                if (beanMethod == null) {
                    // TODO: I18n
                    throw new IllegalStateException("No method was found for method " + itfMethod + " in class "
                            + beanclassAnnotationMetadata.getClassName());
                }
                beanMethod.setBusinessMethod(true);
            }

            // loop again
            if (itfMetadata.getInterfaces() != null) {
                loop(beanclassAnnotationMetadata, itfMetadata, visitedInterfaces);
            }
        }
    }
View Full Code Here

        mv.visitMaxs(0, 0);
        mv.visitEnd();

        // add method in the class metadata
        JMethod method = new JMethod(ACC_PUBLIC, generatedMethodName, "()V", null, null);
        EasyBeansEjbJarMethodMetadata generatedMetadata = new EasyBeansEjbJarMethodMetadata(method, classMetaData);

        // Set value
        switch (interceptorType) {
            case POST_CONSTRUCT:
                generatedMetadata.setPostConstruct(true);
                break;
            case PRE_DESTROY:
                generatedMetadata.setPreDestroy(true);
                break;
            case PRE_PASSIVATE:
                generatedMetadata.setPrePassivate(true);
                break;
            case POST_ACTIVATE:
                generatedMetadata.setPostActivate(true);
                break;
            default:
                    throw new RuntimeException("No generated method name found for interceptorType '" + interceptorType + "'");
        }
View Full Code Here

TOP

Related Classes of org.ow2.easybeans.component.itf.EZBStatisticComponent

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.