Package org.ow2.asm.signature

Examples of org.ow2.asm.signature.SignatureWriter


     * @param jMethod object to check
     * @return true if the given method is an interceptor method (ie AroundInvoke, PostConstruct, etc).
     */
    private boolean isInterceptorMethod(final JMethod jMethod) {
        // get method metadata
        EasyBeansEjbJarMethodMetadata method = this.classAnnotationMetadata.getMethodMetadata(jMethod);
        if (method == null) {
            throw new IllegalStateException("Cannot find a method " + jMethod + " in class "
                    + this.classAnnotationMetadata.getClassName());
        }
        return (method.isAroundInvoke() || method.isLifeCycleMethod());
    }
View Full Code Here


            // 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);

                // overriding ?
                boolean overrided = true;
                overrided = !((method.getAccess() & Opcodes.ACC_PRIVATE) == Opcodes.ACC_PRIVATE);

                // Add only if it is not present or if current method is not
                // overriding super method (it means super method is private)
                if (beanMethod == null || (!overrided && beanMethod != null && !beanMethod.isInherited())) {

                    // Add a clone of the method to bean class
                    EasyBeansEjbJarMethodMetadata clonedMethodAnnotationMetadata =
                        (EasyBeansEjbJarMethodMetadata) methodAnnotationMetadata.clone();
                    // set new class linked to this method metadata
                    clonedMethodAnnotationMetadata
                            .setClassMetadata(beanclassAnnotationMetadata);

                    // method is inherited
                    clonedMethodAnnotationMetadata.setInherited(true, superClassMetadata);

                    // Final method ? ignore it
                    if ((method.getAccess() & Opcodes.ACC_FINAL) == Opcodes.ACC_FINAL) {
                        logger.warn("Ignoring final method ''{0}'' from the class ''{1}''", method.getName(),
                                beanclassAnnotationMetadata.getClassName());
                        clonedMethodAnnotationMetadata.setIgnored(true);
                    }

                    beanclassAnnotationMetadata
                            .addStandardMethodMetadata(clonedMethodAnnotationMetadata);


                    // lifecycle / aroundInvoke
                    if (clonedMethodAnnotationMetadata.isPostConstruct()) {
                        beanclassAnnotationMetadata.addPostConstructMethodMetadata(clonedMethodAnnotationMetadata);
                    }
                    if (clonedMethodAnnotationMetadata.isPreDestroy()) {
                        beanclassAnnotationMetadata.addPreDestroyMethodMetadata(clonedMethodAnnotationMetadata);
                    }
                    if (clonedMethodAnnotationMetadata.isPostActivate()) {
                        beanclassAnnotationMetadata.addPostActivateMethodMetadata(clonedMethodAnnotationMetadata);
                    }
                    if (clonedMethodAnnotationMetadata.isPrePassivate()) {
                        beanclassAnnotationMetadata.addPrePassivateMethodMetadata(clonedMethodAnnotationMetadata);
                    }
                    if (clonedMethodAnnotationMetadata.isAroundInvoke()) {
                        beanclassAnnotationMetadata.addAroundInvokeMethodMetadata(clonedMethodAnnotationMetadata);
                    }
                }
            }
View Full Code Here

        if (allInterfaces.contains(SESSION_BEAN_INTERFACE)) {
            // first add dependency injection for setSessionContext method.
            JAnnotationResource jAnnotationResource = new JAnnotationResource();

            // add resource on setSessionContext method
            EasyBeansEjbJarMethodMetadata setCtxMethod = getMethod(sessionBean, SETSESSIONCONTEXT_METHOD, false,
                    SESSION_BEAN_INTERFACE);
            setCtxMethod.setJAnnotationResource(jAnnotationResource);


            // ejbRemove() method
            EasyBeansEjbJarMethodMetadata ejbRemoveMethod = getMethod(sessionBean, EJBREMOVE_METHOD, true, SESSION_BEAN_INTERFACE);
            ejbRemoveMethod.setPreDestroy(true);
            if (!sessionBean.getPreDestroyMethodsMetadata().contains(ejbRemoveMethod)) {
                sessionBean.addPreDestroyMethodMetadata(ejbRemoveMethod);
            }

            // ejbActivate() method
            EasyBeansEjbJarMethodMetadata ejbActivateMethod = getMethod(sessionBean, EJBACTIVATE_METHOD, true, SESSION_BEAN_INTERFACE);
            ejbRemoveMethod.setPostActivate(true);
            if (!sessionBean.getPostActivateMethodsMetadata().contains(ejbActivateMethod)) {
                sessionBean.addPostActivateMethodMetadata(ejbActivateMethod);
            }

            // ejbPassivate() method
            EasyBeansEjbJarMethodMetadata ejbPassivateMethod = getMethod(sessionBean, EJBPASSIVATE_METHOD, true,
                    SESSION_BEAN_INTERFACE);
            ejbRemoveMethod.setPrePassivate(true);
            if (!sessionBean.getPrePassivateMethodsMetadata().contains(ejbPassivateMethod)) {
                sessionBean.addPrePassivateMethodMetadata(ejbPassivateMethod);
            }
View Full Code Here

     */
    public static void resolve(final EasyBeansEjbJarClassMetadata sessionBean) {

        Iterator<EasyBeansEjbJarMethodMetadata> itMethods = sessionBean.getMethodMetadataCollection().iterator();
        while (itMethods.hasNext()) {
            EasyBeansEjbJarMethodMetadata method = itMethods.next();
            IJavaxJwsWebMethod webMethod = method.getJavaxJwsWebMethod();
            // Annotation present and not excluded
            if (webMethod != null && !webMethod.getExclude()) {
                method.setBusinessMethod(true);
            }
        }
    }
View Full Code Here

                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

        if (remoteHome == null && localHome == null) {
            return;
        }

        // EJB-JAR
        EjbJarArchiveMetadata ejbJarAnnotationMetadata = bean.getEjbJarDeployableMetadata();
        // List of interfaces found in remote home interfaces.
        List<String> interfacesList = new ArrayList<String>();

        // Get List of Interfaces from remote home
        if (remoteHome != null) {
View Full Code Here

        // Wrap in a try/finally block to be able to stop/unregister the dispatcher afterall
        try {
            this.ejbJarInfo = new EJBJarInfo();
            // bind session beans
            EjbJarArchiveMetadata ejbMetadata = this.deployment.getEjbJarArchiveMetadata();
            if (ejbMetadata != null) {
                List<String> beanNames = this.deployment.getEjbJarArchiveMetadata().getBeanNames();
                for (String beanName : beanNames) {
                    for (EasyBeansEjbJarClassMetadata classAnnotationMetadata : this.deployment.getEjbJarArchiveMetadata()
                            .getClassesForBean(beanName)) {
View Full Code Here

    protected String getActivationSpec(final EasyBeansEjbJarClassMetadata mdbMetadata) {
        String activationSpec = null;

        EasyBeansDD easybeansDD = this.deployment.getEjbJarArchiveMetadata().getEasyBeansDD();
        if (easybeansDD != null) {
            EJB ejb = easybeansDD.getEJB();
            if (ejb != null) {
                // get MDB
                List<MessageDrivenBean> mdbList = ejb.getMessageDrivenBeans();
                if (mdbList != null) {
                    for (MessageDrivenBean mdb : mdbList) {
                        if (mdb.getEjbName().equals(mdbMetadata.getJCommonBean().getName())) {
                            String mdbActivationSpec = mdb.getActivationSpec();
                            if (mdbActivationSpec != null) {
View Full Code Here

     * @return the activation spec value or the default one if no activation spec was specified
     */
    protected String getActivationSpec(final EasyBeansEjbJarClassMetadata mdbMetadata) {
        String activationSpec = null;

        EasyBeansDD easybeansDD = this.deployment.getEjbJarArchiveMetadata().getEasyBeansDD();
        if (easybeansDD != null) {
            EJB ejb = easybeansDD.getEJB();
            if (ejb != null) {
                // get MDB
                List<MessageDrivenBean> mdbList = ejb.getMessageDrivenBeans();
                if (mdbList != null) {
                    for (MessageDrivenBean mdb : mdbList) {
View Full Code Here

            }
        }

        // Use info from easybeans.xml if available
        WebserviceEndpoint endpoint = null;
        EasyBeansDD easybeansDD = this.deployment.getEjbJarArchiveMetadata().getEasyBeansDD();
        if (easybeansDD != null) {

            // Iterates on additional datas
            EasyBeansWebservices webservices = easybeansDD.getWebservices();
            if ((webservices != null) && (webservices.getWebserviceEndpoints() != null)) {

                Iterator<WebserviceEndpoint> i = webservices.getWebserviceEndpoints().iterator();
                for (; i.hasNext() && (endpoint == null);) {
                    WebserviceEndpoint browsed = i.next();
View Full Code Here

TOP

Related Classes of org.ow2.asm.signature.SignatureWriter

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.