<commit_before>/*
 * Copyright (c) OSGi Alliance (2008). All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.osgi.service.framework;

import java.util.Map;
import org.osgi.framework.*;
import org.osgi.framework.launch.Framework;

/**
 * Framework service that is used to create composite bundles.
 * <p>
 * If present, there will only be a single instance of this service registered
 * with the Framework.
 * 
 * @ThreadSafe
 * @version $Revision: 5897 $
 */
// TODO javadoc needs review
public interface CompositeBundleFactory {
	/**
	 * Manifest header (named &quot;CompositeServiceFilter-Import;) identifying
	 * the service filters that are used by a child composite bundle to select
	 * services that will be registered into a child framework from a parent
	 * composite bundle.
	 */
	public static final String COMPOSITE_SERVICE_FILTER_IMPORT = "CompositeServiceFilter-Import";

	/**
	 * Manifest header (named &quot;CompositeServiceFilter-Export;) identifying
	 * the service filters that are used by a parent composite bundle to select
	 * services that will be registered into a parent framework from a child
	 * composite bundle.
	 */
	public static final String COMPOSITE_SERVICE_FILTER_EXPORT = "CompositeServiceFilter-Export";

	/**
	 * Creates a new child <code>CompositeBundle</code>. The child composite
	 * bundle has a new child <code>Framework</code> associated with it and a
	 * companion composite bundle which is installed in the child framework.
	 * Composite bundles share packages and services between a parent framework
	 * and a child framework.
	 * <p>
	 * The following steps are required to create a child composite bundle:
	 * <ol>
	 * <li>If a bundle containing the same location string is already installed,
	 * then if the Bundle object is a child <code>LinkBundle</code> then that
	 * composite bundle is returned; otherwise a BundleException is thrown
	 * indicating that an incompatible bundle is already installed at the
	 * specified location.</li>
	 * <li>The child composite bundle's associated resources are allocated. The
	 * associated resources minimally consist of a unique identifier and a
	 * persistent storage area. If this step fails, a BundleException is thrown.
	 * The compositeManifest map is used to provide the headers for the child
	 * composite bundle and its companion composite bundle.
	 * <p>
	 * If composite manifest map does not contain the following header(s) then a
	 * BundleException is thrown:
	 * <ul>
	 * <li> {@link Constants#BUNDLE_SYMBOLICNAME Bundle-SymbolicName} the
	 * symbolic name used for the child composite bundle and its companion
	 * composite bundle.
	 * </ul>
	 * </p>
	 * The composite manifest map may optionally contain the following
	 * header(s):
	 * <ul>
	 * <li> {@link Constants#BUNDLE_VERSION Bundle-Version} the bundle version
	 * used for the child composite bundle and its companion composite bundle.
	 * <li> {@link Constants#IMPORT_PACKAGE Import-Package} the packages which
	 * are imported from the parent framework by the child composite bundle and
	 * are exported to the child framework by the companion composite bundle.</li>
	 * <li>{@link Constants#EXPORT_PACKAGE Export-Package} the packages which
	 * are imported from the child framework by the companion composite bundle
	 * and are exported to the parent framework by the child composite bundle.</li>
	 * <li>{@link #COMPOSITE_SERVICE_FILTER_IMPORT LinkServiceFilter-Import} the
	 * service filters which are acquired from the parent framework by the child
	 * composite bundle and are registered in the child framework by the
	 * companion composite bundle.</li>
	 * <li>{@link #COMPOSITE_SERVICE_FILTER_EXPORT LinkServiceFilter-Export} the
	 * service filters which are acquired from the child framework by the
	 * companion composite bundle and are registered in the parent framework by
	 * the child composite bundle.</li>
	 * </ul><commit_msg>bug 905  - list invalid manifest headers  - specify restriction on Bundle-ManifestVersion<commit_after>/*
 * Copyright (c) OSGi Alliance (2008). All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.osgi.service.framework;

import java.util.Map;
import org.osgi.framework.*;
import org.osgi.framework.launch.Framework;

/**
 * Framework service that is used to create composite bundles.
 * <p>
 * If present, there will only be a single instance of this service registered
 * with the Framework.
 * 
 * @ThreadSafe
 * @version $Revision: 5897 $
 */
// TODO javadoc needs review
public interface CompositeBundleFactory {
	/**
	 * Manifest header (named &quot;CompositeServiceFilter-Import;) identifying
	 * the service filters that are used by a child composite bundle to select
	 * services that will be registered into a child framework from a parent
	 * composite bundle.
	 */
	public static final String COMPOSITE_SERVICE_FILTER_IMPORT = "CompositeServiceFilter-Import";

	/**
	 * Manifest header (named &quot;CompositeServiceFilter-Export;) identifying
	 * the service filters that are used by a parent composite bundle to select
	 * services that will be registered into a parent framework from a child
	 * composite bundle.
	 */
	public static final String COMPOSITE_SERVICE_FILTER_EXPORT = "CompositeServiceFilter-Export";

	/**
	 * Creates a new child <code>CompositeBundle</code>. The child composite
	 * bundle has a new child <code>Framework</code> associated with it and a
	 * companion composite bundle which is installed in the child framework.
	 * Composite bundles share packages and services between a parent framework
	 * and a child framework.
	 * <p>
	 * The following steps are required to create a child composite bundle:
	 * <ol>
	 * <li>If a bundle containing the same location string is already installed,
	 * then if the Bundle object is a child <code>LinkBundle</code> then that
	 * composite bundle is returned; otherwise a BundleException is thrown
	 * indicating that an incompatible bundle is already installed at the
	 * specified location.</li>
	 * <li>The child composite bundle's associated resources are allocated. The
	 * associated resources minimally consist of a unique identifier and a
	 * persistent storage area. If this step fails, a BundleException is thrown.
	 * The compositeManifest map is used to provide the headers for the child
	 * composite bundle and its companion composite bundle.
	 * <p>
	 * If composite manifest map does not contain the following header(s) then a
	 * BundleException is thrown:
	 * <ul>
	 * <li> {@link Constants#BUNDLE_SYMBOLICNAME Bundle-SymbolicName} the
	 * symbolic name used for the child composite bundle and its companion
	 * composite bundle.
	 * </ul>
	 * </p>
	 * The composite manifest map may optionally contain the following
	 * header(s):
	 * <ul>
	 * <li> {@link Constants#BUNDLE_VERSION Bundle-Version} the bundle version
	 * used for the child composite bundle and its companion composite bundle.</li>
	 * <li> {@link Constants#IMPORT_PACKAGE Import-Package} the packages which
	 * are imported from the parent framework by the child composite bundle and
	 * are exported to the child framework by the companion composite bundle.</li>
	 * <li>{@link Constants#EXPORT_PACKAGE Export-Package} the packages which
	 * are imported from the child framework by the companion composite bundle
	 * and are exported to the parent framework by the child composite bundle.</li>
	 * <li>{@link #COMPOSITE_SERVICE_FILTER_IMPORT CompositeServiceFilter-Import} the
	 * service filters which are acquired from the parent framework by the child
	 * composite bundle and are registered in the child framework by the
	 * companion composite bundle.</li>
	 * <li>{@link #COMPOSITE_SERVICE_FILTER_EXPORT CompositeServiceFilter-Export} the
	 * service filters which are acquired from the child framework by the
	 * companion composite bundle and are registered in the parent framework by
	 * the child composite bundle.</li>
	 * <li>{@link Constants#BUNDLE_MANIFESTVERSION Bundle-ManifestVersion} the 
	 * bundle manifest version.  If this header is not specified then the default
	 * is to use version 2.  A BundleException is thrown if this header is 
	 * specified and the version is less than 2.</li>
	 * </ul>
	 * The composite manifest map must not contain the following headers. If a 
	 * composite manifest map does contain one of the following headers then 
	 * a BundleException is thrown:
	 * <ul>
	 * <li> {@link Constants#BUNDLE_ACTIVATIONPOLICY Bundle-ActivationPolicy}</li>
	 * <li> {@link Constants#BUNDLE_ACTIVATOR Bundle-Activator}</li>
	 * <li> {@link Constants#BUNDLE_CLASSPATH Bundle-ClassPath}</li>
	 * <li> {@link Constants#BUNDLE_LOCALIZATION Bundle-Localization}</li>
	 * <li> {@link Constants#BUNDLE_NATIVECODE Bundle-NativeCode}</li>
	 * <li> {@link Constants#DYNAMICIMPORT_PACKAGE DynamicImport-Package}</li>
	 * <li> {@link Constants#FRAGMENT_HOST Fragment-Host}</li>
	 * <li> {@link Constants#REQUIRE_BUNDLE Require-Bundle}</li>
	 * </ul>
{'fraction_non_alphanumeric': 0.07280151379344686, 'fraction_numerical': 0.0028881585499452244, 'mean_word_length': 4.2575916230366495, 'pattern_counts': {'":': 0, '<': 80, '<?xml version=': 0, '>': 80, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7662985', 'n_tokens_mistral': 2638, 'n_tokens_neox': 2454, 'n_words': 1190}