Package org.ow2.util.ee.metadata.common.api.struct

Examples of org.ow2.util.ee.metadata.common.api.struct.IJaxwsWebServiceRef


        // Now, search the MBean of this context
        ObjectName contextObjectName = null;
        try {
            contextObjectName = new ObjectName(buildObjectName(warDeployable));
        } catch (MalformedObjectNameException e) {
            throw new DeployerException("Cannot get the ObjectName for the WAR deployable '" + warDeployable + "'.", e);
        } catch (NullPointerException e) {
            throw new DeployerException("Cannot get the ObjectName for the WAR deployable '" + warDeployable + "'.", e);
        }

        // Now, search if the MBean of this context is present
        try {
            if (!MBeanServerHelper.getMBeanServerServer().isRegistered(contextObjectName)) {
                throw new DeployerException("There is no MBean with the ObjectName '" + contextObjectName
                        + "' in the MBean Server for the WAR deployable '" + warDeployable + "'.");
            }
        } catch (JMXRemoteException e) {
            throw new DeployerException("Cannot check if the MBean with the ObjectName '" + contextObjectName
                    + "'is registered in the MBean Server for the WAR deployable '" + warDeployable + "'.");
        }

        // Undeploy
        try {
            MBeanServerHelper.getMBeanServerServer().invoke(contextObjectName, DESTROY_OPERATION, null, null);
        } catch (InstanceNotFoundException e) {
            throw new DeployerException("Cannot remove the context '" + contextRoot + "' of the war deployable '"
                    + warDeployable + "'.", e);
        } catch (MBeanException e) {
            throw new DeployerException("Cannot remove the context '" + contextRoot + "' of the war deployable '"
                    + warDeployable + "'.", e);
        } catch (ReflectionException e) {
            throw new DeployerException("Cannot remove the context '" + contextRoot + "' of the war deployable '"
                    + warDeployable + "'.", e);
        } catch (JMXRemoteException e) {
            throw new DeployerException("Cannot remove the context '" + contextRoot + "' of the war deployable '"
                    + warDeployable + "'.", e);
        }

        logger.info("The context ''{0}'' of the War ''{1}'' has been undeployed", contextRoot, warDeployable);
    }
View Full Code Here


        // Build Engine object name
        ObjectName engineObjectName = null;
        try {
            engineObjectName = new ObjectName(ENGINE_OBJECT_NAME);
        } catch (MalformedObjectNameException e) {
            throw new DeployerException("Cannot build Tomcat Engine MBean.", e);
        } catch (NullPointerException e) {
            throw new DeployerException("Cannot build Tomcat Engine MBean.", e);
        }

        // Ask the MBean server
        Set<ObjectName> objectNames = null;
        try {
            // Get the list
            objectNames = MBeanServerHelper.getMBeanServerServer().queryNames(engineObjectName, null);
        } catch (JMXRemoteException e) {
            throw new DeployerException("Cannot get Tomcat Engine MBean.", e);
        }

        // Find objects ?
        if (objectNames.size() == 0) {
            throw new DeployerException("No Tomcat Engine MBean was found in the MBean server");
        }

        // Return the domain of this object name
        return (objectNames.iterator().next());
    }
View Full Code Here

    private String getDefaultHost() throws DeployerException {
        ObjectName engineObjectName = getEngineObjectName();
        try {
            return MBeanServerHelper.getMBeanServerServer().getAttribute(engineObjectName, "defaultHost").toString();
        } catch (AttributeNotFoundException e) {
            throw new DeployerException("Cannot get the default host on the object name '" + engineObjectName + "'.", e);
        } catch (InstanceNotFoundException e) {
            throw new DeployerException("Cannot get the default host on the object name '" + engineObjectName + "'.", e);
        } catch (MBeanException e) {
            throw new DeployerException("Cannot get the default host on the object name '" + engineObjectName + "'.", e);
        } catch (ReflectionException e) {
            throw new DeployerException("Cannot get the default host on the object name '" + engineObjectName + "'.", e);
        } catch (JMXRemoteException e) {
            throw new DeployerException("Cannot get the default host on the object name '" + engineObjectName + "'.", e);
        }
    }
View Full Code Here

        }

        // Client Archive ?
        if (CARDeployable.class.isInstance(deployable)) {
            // Create metadata
            ICarDeployableMetadata carDeployableMetadata = null;
            try {
                carDeployableMetadata = new CarDeployableMetadataFactory().createDeployableMetadata(CARDeployable.class
                        .cast(deployable), classLoader);
            } catch (DeployableMetadataException e) {
                throw new ArchiveInjectionException("Unable to get metadata on archive '" + this.archive + "'.", e);
            }

            // Use only common part
            this.metadataCollection = carDeployableMetadata.getCarClassMetadataCollection();
        } else {
            // TODO : adapt for other archives
            throw new UnsupportedOperationException("Can only manage injection for Client Deployable. Deployable found is '"
                    + deployable + "'.");
        }
View Full Code Here

        // Client Archive ?
        if (CARDeployable.class.isInstance(deployable)) {
            // Create metadata
            ICarDeployableMetadata carDeployableMetadata = null;
            try {
                carDeployableMetadata = new CarDeployableMetadataFactory().createDeployableMetadata(CARDeployable.class
                        .cast(deployable), classLoader);
            } catch (DeployableMetadataException e) {
                throw new ArchiveInjectionException("Unable to get metadata on archive '" + this.archive + "'.", e);
            }
View Full Code Here

            // inject field
            injectEJB(jejb, sharedMetadata, clazz, instance);
        }

        // Inject Resources
        IJAnnotationResource jAnnotationResource = sharedMetadata.getJAnnotationResource();
        if (jAnnotationResource != null) {
            // Update interface name
            jAnnotationResource.setType(getInterfaceName(sharedMetadata));

            // inject field
            injectResource(jAnnotationResource, sharedMetadata, clazz, instance);
        }
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

            // inject field
            injectPersistenceUnit(jJavaxPersistenceUnit, sharedMetadata, clazz, instance);
        }

        // Inject WebServiceRef
        IJaxwsWebServiceRef jaxwsWSR = sharedMetadata.getJaxwsWebServiceRef();
        if (jaxwsWSR != null) {

            // Update type name
            jaxwsWSR.setType(getInterfaceName(sharedMetadata));

            // Inject field
            injectWebServiceRef(jaxwsWSR, sharedMetadata, clazz, instance);
        }
    }
View Full Code Here

        // Iterates on each reference
        for (ServiceRef reference : references) {
            String name = reference.getName();

            IJaxwsWebServiceRef ref = namedReferences.get(name);

            // Found a matching reference name
            if (ref != null) {

                // Update WSDL location
                ref.setWsdlLocation(reference.getWsdlLocation());

                // Update port component refs
                List<PortComponentRef> easyBeansPortCompentRefs = reference.getPortComponentRefs();
                if (easyBeansPortCompentRefs != null) {
                    for (PortComponentRef easyBeansPortComponentRef : easyBeansPortCompentRefs) {
                        String serviceEndpointInterface = easyBeansPortComponentRef.getServiceEndpointInterface();

                        // matching port component ref ?
                        IPortComponentRef portComponentRef = ref.getPortComponentRef(serviceEndpointInterface);
                        if (portComponentRef == null) {
                            // no matching found, create a new one
                            portComponentRef = new org.ow2.util.ee.metadata.common.impl.xml.struct.PortComponentRef();
                            portComponentRef.setServiceEndpointInterface(serviceEndpointInterface);
                            List<IPortComponentRef> existingList = ref.getPortComponentRefs();
                            // add
                            existingList.add(portComponentRef);
                            // set the new list
                            ref.setPortComponentRefs(existingList);
                        }
                        // Set the properties
                        portComponentRef.setStubProperties(easyBeansPortComponentRef.getProperties());
                    }
                }
View Full Code Here

        // Init a default map
        Map<String, IJaxwsWebServiceRef> references;
        references = new HashMap<String, IJaxwsWebServiceRef>();

        // Class level annotations (must have a name)
        IJaxwsWebServiceRef ref = classAnnotationMetadata.getJaxwsWebServiceRef();
        if (ref != null) {
            references.put(ref.getName(), ref);
        }

        List<IJaxwsWebServiceRef> refs = classAnnotationMetadata.getJaxwsWebServiceRefs();
        if ((refs != null) && (!refs.isEmpty())) {
            for (IJaxwsWebServiceRef classLevelReference : refs) {
                references.put(classLevelReference.getName(), classLevelReference);
            }
        }

        // Field level annotations (may have a name, if not set, use field name)
        Collection<EasyBeansEjbJarFieldMetadata> fields = classAnnotationMetadata.getStandardFieldMetadataCollection();
        if ((fields != null) && (!fields.isEmpty())) {
            for (EasyBeansEjbJarFieldMetadata field : fields) {
                IJaxwsWebServiceRef fieldReference = field.getJaxwsWebServiceRef();
                if (fieldReference != null) {
                    String refName = fieldReference.getName();
                    // Is there a usable name ?
                    if (refName == null) {
                        // If not, use the field name
                        refName = field.getFieldName();
                    }
                    references.put(refName, fieldReference);
                }
            }
        }

        // Method level annotations (may have a name, if not set, use property method name)
        Collection<EasyBeansEjbJarMethodMetadata> methods = classAnnotationMetadata.getMethodMetadataCollection();
        if ((methods != null) && (!methods.isEmpty())) {
            for (EasyBeansEjbJarMethodMetadata methodMetadata : methods) {
                IJaxwsWebServiceRef methodReference = methodMetadata.getJaxwsWebServiceRef();
                if (methodReference != null) {
                    String refName = methodReference.getName();
                    // Is there a usable name ?
                    if (refName == null) {
                        // If not, use the method's property name
                        String methodName = methodMetadata.getJMethod().getName();
                        methodName = methodName.substring("set".length());
View Full Code Here

TOP

Related Classes of org.ow2.util.ee.metadata.common.api.struct.IJaxwsWebServiceRef

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.