org.osgi.framework.connect.ConnectContent Maven / Gradle / Ivy
Show all versions of aspectjtools Show documentation
/*
* Copyright (c) OSGi Alliance (2019, 2020). 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.framework.connect;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.Optional;
import org.osgi.annotation.versioning.ConsumerType;
import org.osgi.framework.Bundle;
import org.osgi.framework.launch.Framework;
import org.osgi.framework.namespace.IdentityNamespace;
import org.osgi.framework.wiring.BundleRevisions;
/**
* A {@code ConnectContent} provides a {@link Framework} instance access to the
* content of a {@link ConnectModule}.
*
* A framework may {@link #open() open} and {@link #close() close} the content
* for a {@link ConnectModule} multiple times while the {@code ConnectContent}
* is in use by the framework. The framework must close the
* {@code ConnectContent} once the {@code ConnectContent} is no longer used as
* the content of a current bundle revision or an in use bundle revision.
*
* An entry in a {@code ConnectContent} is identified by a path name that is a
* solidus ('/' \u002F
) separated path. A {@code ConnectContent}
* may treat directories as entries. A directory entry path name will end with a
* solidus. A directory entry may be located using a path name that omits the
* trailing solidus.
*
* @see BundleRevisions
* @ThreadSafe
* @author $Id: 9e455f9d467f0e38daea0ea52a59a5ccb8c81257 $
*/
@ConsumerType
public interface ConnectContent {
/**
* The {@code osgi.identity}
* {@link IdentityNamespace#CAPABILITY_TAGS_ATTRIBUTE tags} attribute value
* used by the framework to tag connect bundle revisions.
*/
String TAG_OSGI_CONNECT = "osgi.connect";
/**
* Returns the Manifest headers and values of this {@code ConnectContent}.
*
* @return An {@code Optional} containing the Manifest headers and values
* for this {@code ConnectContent}, or an empty {@code Optional} if
* the framework should handle parsing the Manifest of the content
* itself.
* @throws IllegalStateException If this {@code ConnectContent} has been
* closed.
*/
Optional