/** * All the BND magic happens here. * * @param jarInputStream On what to operate. * @param instructions BND instructions from user API * @param symbolicName Mandatory Header. In case user does not set it. * @return Bundle Jar Stream * @throws Exception Problems go here */ private InputStream createBundle( InputStream jarInputStream, Properties instructions, String symbolicName) throws Exception { NullArgumentException.validateNotNull(jarInputStream, "Jar URL"); NullArgumentException.validateNotNull(instructions, "Instructions"); NullArgumentException.validateNotEmpty(symbolicName, "Jar info"); final Jar jar = new Jar("dot", sink(jarInputStream)); final Properties properties = new Properties(); properties.putAll(instructions); final Analyzer analyzer = new Analyzer(); analyzer.setJar(jar); analyzer.setProperties(properties); // throw away already existing headers that we overwrite: analyzer.mergeManifest(jar.getManifest()); checkMandatoryProperties(analyzer, jar, symbolicName); Manifest manifest = analyzer.calcManifest(); jar.setManifest(manifest); return createInputStream(jar); }
public AbstractFilterFactory( BundleContext bundleContext, String applicationName, Integer priority) { validateNotNull(bundleContext, "bundleContext"); validateNotEmpty(applicationName, "applicationName"); validateNotNull(priority, "priority"); this.bundleContext = bundleContext; setApplicationName(applicationName); setPriority(priority); }
/** * Construct an instance of {@code AbstractContentAggregator} with the specified arguments. * * @param bundleContext The bundle context. This argument must not be {@code null}. * @param applicationName The application name. This argument must not be {@code null} or empty. * @param aggregationPoint The aggregation point id. This argument must not be {@code null} or * empty. * @param destination The destination id. This argument must not be {@code null} or empty. * @throws IllegalArgumentException Thrown if one or some or all arguments are {@code null} or * empty. * @since 1.0.0 */ protected AbstractAggregatedSource( BundleContext bundleContext, String applicationName, String aggregationPoint, String destination) throws IllegalArgumentException { super(bundleContext, applicationName, aggregationPoint); validateNotEmpty(destination, "destination"); setDestination(destination); }
protected final List<Component> createComponents(String wicketId) { validateNotEmpty(wicketId, "wicketId"); List<ContentSource<?>> contents = getContents(wicketId); List<Component> items = new ArrayList<Component>(); for (ContentSource<?> content : contents) { Component comp = content.createSourceComponent("portal-item"); if (comp != null) { items.add(comp); } } return items; }