/** * Synthesizes a composite from a collection of composites using inclusion. * * @param composites the composites to synthesize * @return the synthesized composite */ private Composite synthesizeComposite(List<Composite> composites) { Composite synthesized = new Composite(SYNTHETIC_COMPOSITE); for (Composite composite : composites) { Include include = new Include(); include.setName(composite.getName()); include.setIncluded(composite); synthesized.add(include); } return synthesized; }
/** * Creates a wrapper used to include a composite at the domain level. The wrapper is thrown away during the inclusion. * * @param deployable the deployable being included * @return the composite wrapper * @throws DeploymentException if there is an error creating the composite wrapper */ private Composite createWrapper(QName deployable) throws DeploymentException { Composite composite = contributionHelper.findComposite(deployable); // In order to include a composite at the domain level, it must first be wrapped in a composite that includes it. // This wrapper is thrown away during the inclusion. Composite wrapper = new Composite(deployable); Include include = new Include(); include.setName(deployable); include.setIncluded(composite); wrapper.add(include); return wrapper; }
Include include = new Include(); include.setName(name); include.setIncluded(composite);
private Include loadFromSideFile(QName name, ClassLoader cl, URI contributionUri, URL url, XMLStreamReader reader, IntrospectionContext context) { Include include = new Include(); IntrospectionContext childContext = new DefaultIntrospectionContext(cl, contributionUri, url); Composite composite; try { composite = registry.load(url, Composite.class, childContext); } catch (LoaderException e) { InvalidValue failure = new InvalidValue("Error loading include", reader); context.addError(failure); return include; } if (childContext.hasErrors()) { context.addErrors(childContext.getErrors()); } if (childContext.hasWarnings()) { context.addWarnings(childContext.getWarnings()); } include.setName(name); include.setScdlLocation(url); include.setIncluded(composite); return include; }