if (INTENT.equals(qname)) { try { definition = loaderRegistry.load(reader, Intent.class, childContext); } catch (UnrecognizedElementException e) { throw new InstallException(e); definition = loaderRegistry.load(reader, PolicySet.class, childContext); } catch (UnrecognizedElementException e) { throw new InstallException(e); definition = loaderRegistry.load(reader, BindingType.class, childContext); } catch (UnrecognizedElementException e) { throw new InstallException(e); definition = loaderRegistry.load(reader, ImplementationType.class, childContext); } catch (UnrecognizedElementException e) { throw new InstallException(e);
public void processManifest(Contribution contribution, IntrospectionContext context) throws Fabric3Exception { ContributionManifest manifest; try { URL sourceUrl = contribution.getLocation(); URL manifestUrl = new URL("jar:" + sourceUrl.toExternalForm() + "!/WEB-INF/sca-contribution.xml"); ClassLoader cl = getClass().getClassLoader(); URI uri = contribution.getUri(); IntrospectionContext childContext = new DefaultIntrospectionContext(uri, cl); Source source = new UrlSource(manifestUrl); manifest = loader.load(source, ContributionManifest.class, childContext); if (childContext.hasErrors()) { context.addErrors(childContext.getErrors()); } if (childContext.hasWarnings()) { context.addWarnings(childContext.getWarnings()); } contribution.setManifest(manifest); } catch (Fabric3Exception e) { if (e.getCause() instanceof FileNotFoundException) { // ignore no manifest found } else { throw e; } } catch (MalformedURLException e) { // ignore no manifest found } }
public void processManifest(Contribution contribution, IntrospectionContext context) throws Fabric3Exception { ContributionManifest manifest; try { URL sourceUrl = contribution.getLocation(); URL manifestUrl = new URL("jar:" + sourceUrl.toExternalForm() + "!/WEB-INF/sca-contribution.xml"); ClassLoader cl = getClass().getClassLoader(); URI uri = contribution.getUri(); IntrospectionContext childContext = new DefaultIntrospectionContext(uri, cl); Source source = new UrlSource(manifestUrl); manifest = loader.load(source, ContributionManifest.class, childContext); if (childContext.hasErrors()) { context.addErrors(childContext.getErrors()); } if (childContext.hasWarnings()) { context.addWarnings(childContext.getWarnings()); } contribution.setManifest(manifest); } catch (Fabric3Exception e) { if (e.getCause() instanceof FileNotFoundException) { // ignore no manifest found } else { throw e; } } catch (MalformedURLException e) { // ignore no manifest found } }
public void processManifest(Contribution contribution, IntrospectionContext context) throws InstallException { ContributionManifest manifest; try { URL sourceUrl = contribution.getLocation(); URL manifestUrl = new URL("jar:" + sourceUrl.toExternalForm() + "!/WEB-INF/sca-contribution.xml"); ClassLoader cl = getClass().getClassLoader(); URI uri = contribution.getUri(); IntrospectionContext childContext = new DefaultIntrospectionContext(uri, cl); Source source = new UrlSource(manifestUrl); manifest = loader.load(source, ContributionManifest.class, childContext); if (childContext.hasErrors()) { context.addErrors(childContext.getErrors()); } if (childContext.hasWarnings()) { context.addWarnings(childContext.getWarnings()); } contribution.setManifest(manifest); } catch (LoaderException e) { if (e.getCause() instanceof FileNotFoundException) { // ignore no manifest found } else { throw new InstallException(e); } } catch (MalformedURLException e) { // ignore no manifest found } }
public static Composite createSystemComposite(URL compositeUrl, Contribution contribution, ClassLoader bootClassLoader, ImplementationProcessor processor) throws InitializationException { try { // load and introspect the system composite XML Loader loader = BootstrapLoaderFactory.createLoader(processor, XML_FACTORY); URI contributionUri = contribution.getUri(); IntrospectionContext introspectionContext = new DefaultIntrospectionContext(contributionUri, bootClassLoader, compositeUrl); Source source = new UrlSource(compositeUrl); Composite composite = loader.load(source, Composite.class, introspectionContext); if (introspectionContext.hasErrors()) { QName name = composite.getName(); List<ValidationFailure> errors = introspectionContext.getErrors(); List<ValidationFailure> warnings = introspectionContext.getWarnings(); throw new InvalidCompositeException(name, errors, warnings); } addContributionUri(contributionUri, composite); addResource(contribution, composite, compositeUrl); return composite; } catch (ContributionException e) { throw new InitializationException(e); } catch (LoaderException e) { throw new InitializationException(e); } }