Package org.apache.tuscany.sca.contribution.service

Examples of org.apache.tuscany.sca.contribution.service.ContributionReadException


    public WSDLDefinition read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException {
        try {
            return indexRead(artifactURL);
        } catch (Exception e) {
            throw new ContributionReadException(e);
        }
    }
View Full Code Here


                } catch (IOException e) {
                    // ignore
                }
            }
        } catch (XMLStreamException e) {
            ContributionReadException ce = new ContributionReadException(e);
            throw ce;
        }
    }
View Full Code Here

        try {
            rootFolder = new File(packageSourceURL.toURI());
            if (rootFolder.isDirectory()) {
                if (!rootFolder.exists()) {
                    throw new ContributionReadException(rootFolder.getAbsolutePath());
                }

                traverse(artifacts, rootFolder, rootFolder);
            }

        } catch (URISyntaxException e) {
            throw new ContributionReadException(packageSourceURL.toExternalForm(), e);
        }

        return artifacts;
    }
View Full Code Here

            return contribution;

        } catch (ContributionReadException e) {
            throw e;
        } catch (ContributionResolveException e) {
            throw new ContributionReadException(e);
        } catch (MalformedURLException e) {
            throw new ContributionReadException(e);
        }
    }
View Full Code Here

            }

            return workspace;
           
        } catch (XMLStreamException e) {
            throw new ContributionReadException(e);
        } catch (IOException e) {
            throw new ContributionReadException(e);
        } finally {
            try {
                if (urlStream != null) {
                    urlStream.close();
                    urlStream = null;
View Full Code Here

                    reader.next();
                }
            }
        }
        catch (XMLStreamException e) {
            ContributionReadException ex = new ContributionReadException(e);
            error("XMLStreamException", reader, ex);
        }
       
        return resourceImport;
    }
View Full Code Here

        DeploymentLoader loader = new DeploymentLoader();
        AppModule appModule = null;
        try {
            appModule = loader.load(new File(jarFilePath));
        } catch (OpenEJBException e) {
            throw new ContributionReadException(e);
        }

        // Set the Thread context class loader as the module's class loader and all the Web and EJB modules
        // inside. Otherwise, SCA annotations could not be processed
        // TODO: Eliminate the use of reflection for setting the class loader
        java.lang.reflect.Field field = null;
        try {
            field = appModule.getClass().getDeclaredField("classLoader");
        } catch (SecurityException e) {
            throw new ContributionReadException(e);
        } catch (NoSuchFieldException e) {
            throw new ContributionReadException(e);
        }
        field.setAccessible(true);
        try{
            field.set(appModule, Thread.currentThread().getContextClassLoader());
        } catch (IllegalArgumentException e) {
            throw new ContributionReadException(e);
        } catch (IllegalAccessException e) {
            throw new ContributionReadException(e);
        }
       
        for(EjbModule ejbModule:appModule.getEjbModules()) {
            java.lang.reflect.Field field1 = null;
            try {
                field1 = ejbModule.getClass().getDeclaredField("classLoader");
            } catch (SecurityException e) {
                throw new ContributionReadException(e);
            } catch (NoSuchFieldException e) {
                throw new ContributionReadException(e);
            }
            field1.setAccessible(true);
            try {
                field1.set(ejbModule, Thread.currentThread().getContextClassLoader());
            } catch (IllegalArgumentException e) {
                throw new ContributionReadException(e);
            } catch (IllegalAccessException e) {
                throw new ContributionReadException(e);
            }
        }

        for(WebModule webModule:appModule.getWebModules()) {
            java.lang.reflect.Field field1 = null;
            try {
                field1 = webModule.getClass().getDeclaredField("classLoader");
            } catch (SecurityException e) {
                throw new ContributionReadException(e);
            } catch (NoSuchFieldException e) {
                throw new ContributionReadException(e);
            }
            field1.setAccessible(true);
            try {
                field1.set(webModule, Thread.currentThread().getContextClassLoader());
            } catch (IllegalArgumentException e) {
                throw new ContributionReadException(e);
            } catch (IllegalAccessException e) {
                throw new ContributionReadException(e);
            }
        }

        // Process deployment descriptor files
        ReadDescriptors readDescriptors = new ReadDescriptors();
        try {
            readDescriptors.deploy(appModule);
        } catch (OpenEJBException e) {
            throw new ContributionReadException(e);
        }

        // Process annotations
        AnnotationDeployer annDeployer = new AnnotationDeployer();
        try {
            annDeployer.deploy(appModule);
        } catch (OpenEJBException e) {
            throw new ContributionReadException(e);
        }

        return appModule;
    }
View Full Code Here

        OperationSelectorJMSUserProp opSelector = new OperationSelectorJMSUserProp();
        String propertyName = reader.getAttributeValue(null, OperationSelectorJMSUserProp.OPERATION_SELECTOR_JMS_USERPROP_ATTR);
        if (propertyName != null && propertyName.length() > 0) {
            opSelector.setPropertyName(propertyName);
        } else {
            throw new ContributionReadException(OperationSelectorJMSUserProp.OPERATION_SELECTOR_JMS_USERPROP_QNAME.toString() + ": " +
                    OperationSelectorJMSUserProp.OPERATION_SELECTOR_JMS_USERPROP_ATTR + " is a required attribute.");
        }
       
        return opSelector;
    }
View Full Code Here

            switch (event) {
                case START_ELEMENT: {
                    if (END_POINT_REFERENCE.equals(reader.getName().getLocalPart())) {
                        if (wsdlElement != null && (wsdlElementIsBinding == null || !wsdlElementIsBinding)) {
                          error("MustUseWsdlBinding", reader, wsdlElement);
                            throw new ContributionReadException(wsdlElement + " must use wsdl.binding when using wsa:EndpointReference");
                        }
                        wsBinding.setEndPointReference(EndPointReferenceHelper.readEndPointReference(reader));
                    } else if (Constants.OPERATION_QNAME.equals(reader.getName())) {
                        confOp = configuredOperationProcessor.read(reader);
                        if (confOp != null) {
View Full Code Here

            ContributionMetadata contribution = (ContributionMetadata)staxProcessor.read(reader);

            return contribution;
           
        } catch (XMLStreamException e) {
          ContributionReadException ex = new ContributionReadException(e);
          error("XMLStreamException", inputFactory, ex);
          throw ex;
        } catch (IOException e) {
          ContributionReadException ex = new ContributionReadException(e);
          error("IOException", inputFactory, ex);
            throw ex;
        } finally {
            try {
                if (urlStream != null) {
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.service.ContributionReadException

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.