Package org.ow2.asm.commons

Examples of org.ow2.asm.commons.EmptyVisitor


            if (this.clusterViewManager != null) {
                try {
                    this.clusterViewManager.stop();
                } catch (Exception e) {
                    this.logger.error("Cannot stop the server-side manager", e);
                    throw new EZBComponentException("Cannot stop the server-side manager", e);
                }
            }
        }
        this.logger.info("CMI extension stopped.");
View Full Code Here


        } else {
            throw new EZBContainerException("unknown session type for: " + sessionBean);
        }

        // Build runtime information
        SessionBeanInfo sessionBeanInfo = new SessionBeanInfo();
        sessionBeanInfo.setTransactionManagementType(sessionBean.getTransactionManagementType());
        sessionBeanInfo.setApplicationExceptions(sessionBean.getEjbJarDeployableMetadata().getApplicationExceptions());
        // Only for singleton
        if (sessionBean.isSingleton()) {
            sessionBeanInfo.setStartup(sessionBean.isStartup());
        }

        sessionFactory.setSessionBeanInfo(sessionBeanInfo);

        // Build WS deploy/time info
        if (sessionBean.getWebServiceMarker() != null) {
            // Bean is annotated with @WebService or @WebServiceprovider
            IWebServiceInfo info = createWebServiceInfo(sessionBean, factoryName);
            sessionBeanInfo.setWebServiceInfo(info);
        } // else this bean is not webservices annotated

        // get interfaces of bean
        IJLocal localItfs = sessionBean.getLocalInterfaces();
        IJRemote remoteItfs = sessionBean.getRemoteInterfaces();

        if (localItfs != null) {
            sessionBeanInfo.setLocalInterfaces(localItfs.getInterfaces());
            for (String itf : localItfs.getInterfaces()) {
                this.bindingReferences.add(createLocalItfRef(itf,
                                                             getEmbedded().getID(),
                                                             getId(),
                                                             factoryName,
                                                             sessionBean,
                                                             sessionFactory));
            }
        }
        if (remoteItfs != null) {
            sessionBeanInfo.setRemoteInterfaces(remoteItfs.getInterfaces());
            for (String itf : remoteItfs.getInterfaces()) {
                this.bindingReferences.add(createRemoteItfRef(itf,
                                                              getId(),
                                                              factoryName,
                                                              sessionBean,
View Full Code Here

                    }
                }
            }

            // Fill the Info structure
            WebServiceInfo info = new WebServiceInfo();

            // Read name
            info.setPortComponentName(name);

            if (portComponent != null) {

                // Read wsdl-location from the webservice-description parent element
                info.setWsdlLocation(portComponent.getParent().getWsdlFile());

                // Read service QName
                info.setServiceName(portComponent.getWsdlService());

                // Read port QName
                info.setPortName(portComponent.getWsdlPort());

                // Read protocol-binding
                info.setProtocolBinding(portComponent.getProtocolBinding());

                // Read enable-mtom
                info.setMTOMEnabled(portComponent.isMTOMEnabled());

                // Read service-endpoint-interface
                if  (!marker.isWebServiceProvider()) {
                    info.setServiceEndpointInterface(portComponent.getServiceEndpointInterface());
                }

                // Read HandlerChains
                info.setHandlerChains(portComponent.getHandlerChains());

            }

            // EasyBeans specific values ....
            // ---------------------------------------------------
            // manage endpoint-address
            info.setEndpointAddress(sessionBean.getWebServiceEndpointAddress());

            // manage context-root
            info.setContextRoot(sessionBean.getWebServiceContextRoot());

            // manage realm-name
            info.setRealmName(sessionBean.getWebServiceRealmName());

            // manage transport-guarantee
            info.setTransportGuarantee(sessionBean.getWebServiceTransportGuarantee());

            // manage auth-method
            info.setAuthMethod(sessionBean.getWebServiceAuthMethod());

            // manage http-methods
            info.setHttpMethods(sessionBean.getWebServiceHttpMethods());

            // manage wsdl-publication-directory
            if (endpoint != null) {
                info.setWsdlPublicationDirectory(endpoint.getWsdlPublicationDirectory());
            }

            return info;
        }
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

        if (isInjectedMethod(jMethod)) {
            return false;
        }

        // 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.isBusinessMethod();
    }
View Full Code Here

     * @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

        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

            metadataRemove = new EasyBeansEjbJarMethodMetadata(REMOVE_METHOD, bean);
            bean.addStandardMethodMetadata(metadataRemove);
        }

        // flag method as a remove method
        metadataRemove.setRemove(new JRemove());
        metadataRemove.setBusinessMethod(true);


        // Flag ejbXXX() method as business method (so interceptors are invoked)
        for (EasyBeansEjbJarMethodMetadata methodData : bean.getMethodMetadataCollection()) {
View Full Code Here

                        + "' referenced in the home/localhome of the bean '" + bean.getClassName() + "'.");
            }

            // Get all methods
            for (EasyBeansEjbJarMethodMetadata methodData : interfaceUsed.getMethodMetadataCollection()) {
                JMethod itfMethod = methodData.getJMethod();

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

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

        }

        // Add remove method
        EasyBeansEjbJarMethodMetadata metadataRemove = bean.getMethodMetadata(REMOVE_METHOD);
        // not present ? add it
        if (metadataRemove == null) {
            metadataRemove = new EasyBeansEjbJarMethodMetadata(REMOVE_METHOD, bean);
            bean.addStandardMethodMetadata(metadataRemove);
        }

        // flag method as a remove method
        metadataRemove.setRemove(new JRemove());
        metadataRemove.setBusinessMethod(true);


        // Flag ejbXXX() method as business method (so interceptors are invoked)
        for (EasyBeansEjbJarMethodMetadata methodData : bean.getMethodMetadataCollection()) {
          JMethod method = methodData.getJMethod();
          if (method.getName().startsWith("ejbActivate") || method.getName().startsWith("ejbCreate")) {
            if ("()V".equals(method.getDescriptor())) {
              methodData.setBusinessMethod(true);
            }
          }
        }
View Full Code Here

        // Get methods
        for (EasyBeansEjbJarMethodMetadata method : homeMetadata.getMethodMetadataCollection()) {
            // if method name begins with "create", it's matching
            if (method.getMethodName().startsWith("create")) {
                // Get return type
                JMethod jMethod = method.getJMethod();
                Type returnType = Type.getReturnType(jMethod.getDescriptor());
                String returnTypeClassname = returnType.getClassName();
                // Not yet present in the list ? add it
                if (!interfacesList.contains(returnTypeClassname)) {
                    interfacesList.add(returnTypeClassname.replace(".", "/"));
                }
View Full Code Here

TOP

Related Classes of org.ow2.asm.commons.EmptyVisitor

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.