@ConsumerType
public interface ConnectContent
ConnectContent provides a Framework instance access to the
content of a ConnectModule.
A framework may open and close the content
for a ConnectModule multiple times while the ConnectContent
is in use by the framework. The framework must close the
ConnectContent once the ConnectContent is no longer used as
the content of a current bundle revision or an in use bundle revision.
An entry in a ConnectContent is identified by a path name that is a
solidus ('/' /) separated path. A 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.
BundleRevisions| Modifier and Type | Interface and Description |
|---|---|
static interface |
ConnectContent.ConnectEntry
Represents the entry of a
ConnectContent. |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TAG_OSGI_CONNECT
The
osgi.identity
tags attribute value
used by the framework to tag connect bundle revisions. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this
ConnectContent. |
java.util.Optional<java.lang.ClassLoader> |
getClassLoader()
Returns a class loader for this
ConnectContent. |
java.lang.Iterable<java.lang.String> |
getEntries()
Returns the entry names available in this
ConnectContent. |
java.util.Optional<ConnectContent.ConnectEntry> |
getEntry(java.lang.String path)
Returns the
ConnectContent.ConnectEntry for the specified path name in this
content. |
java.util.Optional<java.util.Map<java.lang.String,java.lang.String>> |
getHeaders()
Returns the Manifest headers and values of this
ConnectContent. |
void |
open()
Opens this
ConnectContent. |
static final java.lang.String TAG_OSGI_CONNECT
osgi.identity
tags attribute value
used by the framework to tag connect bundle revisions.java.util.Optional<java.util.Map<java.lang.String,java.lang.String>> getHeaders()
ConnectContent.Optional containing the Manifest headers and values
for this ConnectContent, or an empty Optional if
the framework should handle parsing the Manifest of the content
itself.java.lang.IllegalStateException - If this ConnectContent has been
closed.java.lang.Iterable<java.lang.String> getEntries()
throws java.io.IOException
ConnectContent.Iterable which can supply the available entry names.java.io.IOException - If an error occurs reading this
ConnectContent.java.lang.IllegalStateException - If this ConnectContent has been
closed.java.util.Optional<ConnectContent.ConnectEntry> getEntry(java.lang.String path)
ConnectContent.ConnectEntry for the specified path name in this
content.
The empty value is returned if an entry with the
specified path name does not exist. The path must not start with a
"/" and is relative to the root of this content. A connect
entry for a directory will have a path name that ends with a slash ('/').
path - The path name of the entry.Optional containing the ConnectContent.ConnectEntry for the
specified path, or an empty Optional if no entry for
specified path can be found.java.lang.IllegalStateException - If this ConnectContent has been
closed.java.util.Optional<java.lang.ClassLoader> getClassLoader()
ConnectContent.
This method is called by the framework for resolved bundles only and will be called at most once while a bundle is
resolved. If a bundle associated with a ConnectModule is
refreshed and resolved again, the framework will ask the
ConnectContent for the class loader again. This allows for a
ConnectContent to reuse or create a new class loader each time
the bundle revision is resolved.
Optional containing the class loader for this
ConnectContent, or an empty Optional if framework
should handle creating a class loader for the bundle revision
associated with this ConnectContent.java.lang.IllegalStateException - If this ConnectContent has been
closed.void open() throws java.io.IOException
ConnectContent.
The framework will open the content when it needs to access the content
for a bundle revision associated with this ConnectContent. The
framework may defer calling this method until requests to access the
bundle revision content are made.
java.io.IOException - If an error occurred opening this
ConnectContent.void close()
throws java.io.IOException
ConnectContent.java.io.IOException - If an error occurred closing this
ConnectContent.Copyright © OSGi Alliance (2000, 2020). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0