Examples of ContributionRuntimeException


Examples of org.apache.tuscany.sca.contribution.processor.ContributionRuntimeException

                      }
                    }
                    }
                  }  
              } catch (IOException ex) {
                throw new ContributionRuntimeException(ex);
              }             
                throw new ContributionRuntimeException(e);
            }
        }
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.processor.ContributionRuntimeException

            map.put(namespace, list);
        }       
        try {
            resolved = aggregate(list);
        } catch (IOException e) {
            throw new ContributionRuntimeException(e);
        }
        if (resolved != null && !resolved.isUnresolved()) {
            if (definition.isUnresolved() && definition.getSchema() == null && modelXSD != null) {
                // Update the unresolved model with schema information and mark it
                // resolved.  This information in the unresolved model is needed when
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.processor.ContributionRuntimeException

                        });
                    } catch (PrivilegedActionException e) {
                        throw (IOException) e.getException();
                    }
                } catch (IOException e) {
                    throw new ContributionRuntimeException(e);
                } catch (RuntimeException e) {
                    // find original cause of the problem
                    Throwable cause = e;
                    while (cause.getCause() != null && cause != cause.getCause()) {
                        cause = cause.getCause();
                    }
                    throw new ContributionRuntimeException(cause);
                }
                definition.setSchemaCollection(schemaCollection);
                definition.setSchema(schema);
                definition.setUnresolved(false);
            } else if (definition.getLocation() != null) {
                if (definition.getLocation().getFragment() != null) {
                    // It's an inline schema
                    return;
                }
                // Read an XSD document
                XmlSchema schema = null;
                for (XmlSchema d : schemaCollection.getXmlSchemas()) {
                    if (isSameNamespace(d.getTargetNamespace(), definition.getNamespace()))  {
                        if (d.getSourceURI().equals(definition.getLocation().toString())) {
                            schema = d;
                            break;
                        }
                    }
                }
                if (schema == null) {
                    InputSource xsd = null;
                    final XSDefinition finaldef = definition;
                    try {
                        try {
                            xsd = (InputSource) AccessController.doPrivileged(new PrivilegedExceptionAction<InputSource>() {
                                public InputSource run() throws IOException {
                                    return XMLDocumentHelper.getInputSource(finaldef.getLocation().toURL());
                                }
                            });
                        } catch (PrivilegedActionException e) {
                            throw (IOException) e.getException();
                        }
                    } catch (IOException e) {
                        throw new ContributionRuntimeException(e);
                    }
   
                    try {
                        final InputSource finalxsd = xsd;
                        try {
                            schema = (XmlSchema) AccessController.doPrivileged(new PrivilegedExceptionAction<XmlSchema>() {
                                public XmlSchema run() throws IOException {
                                    return schemaCollection.read(finalxsd, null);
                                }
                            });
                        } catch (PrivilegedActionException e) {
                            throw (IOException) e.getException();
                        }
   
                    } catch (IOException e) {
                        throw new ContributionRuntimeException(e);
                    } catch (RuntimeException e) {
                        // find original cause of the problem
                        Throwable cause = e;
                        while (cause.getCause() != null && cause != cause.getCause()) {
                            cause = cause.getCause();
                        }
                        throw new ContributionRuntimeException(cause);
                    }
                }
                definition.setSchemaCollection(schemaCollection);
                definition.setSchema(schema);
            }
View Full Code Here

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

        }
        XSDefinition resolved = null;
        try {
            resolved = aggregate(list);
        } catch (IOException e) {
            throw new ContributionRuntimeException(e);
        }
        if (resolved != null && !resolved.isUnresolved()) {
            return modelClass.cast(resolved);
        }
View Full Code Here

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

                    return null;
                }
                latestImportURI = url.toString();
                return XMLDocumentHelper.getInputSource(url);
            } catch (Exception e) {
                throw new ContributionRuntimeException(e);
            }
        }
View Full Code Here

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

                    return null;
                }
                latestImportURI = url.toString();
                return XMLDocumentHelper.getInputSource(url);
            } catch (IOException e) {             
                throw new ContributionRuntimeException(e);
            }
        }
View Full Code Here

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

        }
        XSDefinition resolved = null;
        try {
            resolved = aggregate(list);
        } catch (ContributionRuntimeException e) {
            throw new ContributionRuntimeException(e);
        }
        if (resolved != null && !resolved.isUnresolved()) {
            if (definition.isUnresolved() && definition.getSchema() == null && modelXSD != null) {
                // Update the unresolved model with schema information and mark it
                // resolved.  This information in the unresolved model is needed when
View Full Code Here

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

                // find original cause of the problem
                Throwable cause = e;
                while (cause.getCause() != null) {
                    cause = cause.getCause();
                }
                throw new ContributionRuntimeException(cause);
            }
            definition.setSchemaCollection(schemaCollection);
            definition.setSchema(schema);
            definition.setUnresolved(false);
        } else if (definition.getLocation() != null) {
            if (definition.getLocation().getFragment() != null) {
                // It's an inline schema
                // FIXME: We need to trigger the loading of the enclosing WSDL models
                return;
            }
            // Read an XSD document
            InputSource xsd;
            try {
              xsd = XMLDocumentHelper.getInputSource(definition.getLocation().toURL());
            } catch (IOException e) {
              throw new ContributionRuntimeException(e);
            }
            for (XmlSchema d : schemaCollection.getXmlSchemas()) {
                if (isSameNamespace(d.getTargetNamespace(), definition.getNamespace())) {
                    if (d.getSourceURI().equals(definition.getLocation().toString()))
                        return;
                }
            }
            XmlSchema schema = null;
            try {
                schema = schemaCollection.read(xsd, null);
            } catch (RuntimeException e) {
                // find original cause of the problem
                Throwable cause = e;
                while (cause.getCause() != null) {
                    cause = cause.getCause();
                }
                throw new ContributionRuntimeException(cause);
            }
            definition.setSchemaCollection(schemaCollection);
            definition.setSchema(schema);
        }
    }
View Full Code Here

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

            try {
                URL url = new URL(new URL(parentLocation), importLocation);
                latestImportURI = url.toString();
                return new InputSource(url.openStream());
            } catch (Exception e) {
                throw new ContributionRuntimeException(e);
            }
        }
View Full Code Here

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

            this.wsdlFactory = wsdlFactory;
        } else {
            try {
                this.wsdlFactory = javax.wsdl.factory.WSDLFactory.newInstance();
            } catch (WSDLException e) {
                throw new ContributionRuntimeException(e);
            }
        }
       
        wsdlExtensionRegistry = this.wsdlFactory.newPopulatedExtensionRegistry();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.