Package org.apache.tuscany.sca.contribution.processor

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


            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

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

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

            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

                // 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;
                try {
                    xsd = XMLDocumentHelper.getInputSource(definition.getLocation().toURL());
                } catch (IOException e) {
                    throw new ContributionRuntimeException(e);
                }

                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()) {
                        cause = cause.getCause();
                    }
                    throw new ContributionRuntimeException(cause);
                }
            }
            definition.setSchemaCollection(schemaCollection);
            definition.setSchema(schema);
        }
View Full Code Here

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

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

            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

                // 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;
                try {
                    xsd = XMLDocumentHelper.getInputSource(definition.getLocation().toURL());
                } catch (IOException e) {
                    throw new ContributionRuntimeException(e);
                }

                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()) {
                        cause = cause.getCause();
                    }
                    throw new ContributionRuntimeException(cause);
                }
            }
            definition.setSchemaCollection(schemaCollection);
            definition.setSchema(schema);
        }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.processor.ContributionRuntimeException

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.