类 BundleWiringImpl
- java.lang.Object
-
- org.apache.felix.framework.BundleWiringImpl
-
- 所有已实现的接口:
BundleReference,BundleWiring,Wiring
public class BundleWiringImpl extends java.lang.Object implements BundleWiring
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classBundleWiringImpl.BundleClassLoaderstatic classBundleWiringImpl.BundleClassLoaderJava5
-
字段概要
字段 修饰符和类型 字段 说明 static intEAGER_ACTIVATIONstatic intLAZY_ACTIVATIONstatic intLISTRESOURCES_DEBUG-
从接口继承的字段 org.osgi.framework.wiring.BundleWiring
FINDENTRIES_RECURSE, LISTRESOURCES_LOCAL, LISTRESOURCES_RECURSE
-
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddDynamicWire(BundleWire wire)voiddispose()java.util.List<java.net.URL>findEntries(java.lang.String path, java.lang.String filePattern, int options)Returns entries in this bundle wiring'sbundle revisionand its attached fragment revisions.BundlegetBundle()Returns theBundleobject associated with thisBundleReference.java.util.List<BundleCapability>getCapabilities(java.lang.String namespace)Returns the capabilities provided by this bundle wiring.java.lang.ClassgetClassByDelegation(java.lang.String name)java.lang.ClassLoadergetClassLoader()Returns the class loader for this bundle wiring.BundleRevisiongetImportedPackageSource(java.lang.String pkgName)java.util.List<NativeLibrary>getNativeLibraries()java.util.List<Wire>getProvidedResourceWires(java.lang.String namespace)Returns theWires to the providedcapabilitiesof this wiring.java.util.List<BundleWire>getProvidedWires(java.lang.String namespace)Returns theBundleWires to the providedcapabilitiesof this bundle wiring.java.util.List<Wire>getRequiredResourceWires(java.lang.String namespace)Returns theWires to therequirementsin use by this wiring.java.util.List<BundleWire>getRequiredWires(java.lang.String namespace)Returns theBundleWires to therequirementsin use by this bundle wiring.java.util.List<BundleRequirement>getRequirements(java.lang.String namespace)Returns the requirements of this bundle wiring.BundleRevisiongetResource()Returns the resource associated with this wiring.java.net.URLgetResourceByDelegation(java.lang.String name)java.util.List<Capability>getResourceCapabilities(java.lang.String namespace)Returns the capabilities provided by this wiring.java.util.List<Requirement>getResourceRequirements(java.lang.String namespace)Returns the requirements of this wiring.java.util.EnumerationgetResourcesByDelegation(java.lang.String name)BundleRevisiongetRevision()Returns the bundle revision for the bundle in this bundle wiring.booleanhasPackageSource(java.lang.String pkgName)booleanisCurrent()Returnstrueif this bundle wiring is the current bundle wiring.booleanisInUse()Returnstrueif this bundle wiring is in use.java.util.Collection<java.lang.String>listResources(java.lang.String path, java.lang.String filePattern, int options)Returns the names of resources visible to this bundle wiring'sclass loader.java.lang.StringtoString()
-
-
-
方法详细资料
-
toString
public java.lang.String toString()
- 覆盖:
toString在类中java.lang.Object
-
dispose
public void dispose()
-
hasPackageSource
public boolean hasPackageSource(java.lang.String pkgName)
-
getImportedPackageSource
public BundleRevision getImportedPackageSource(java.lang.String pkgName)
-
isCurrent
public boolean isCurrent()
从接口复制的说明:BundleWiringReturnstrueif this bundle wiring is the current bundle wiring. The bundle wiring for a bundle is the current bundle wiring if it is the most recent bundle wiring for the current bundle revision. All bundles with non-current, in use bundle wirings are consideredremoval pending.- 指定者:
isCurrent在接口中BundleWiring- 返回:
trueif this bundle wiring is the current bundle wiring;falseotherwise.
-
isInUse
public boolean isInUse()
从接口复制的说明:BundleWiringReturnstrueif this bundle wiring is in use. A bundle wiring is in use if it is thecurrentwiring or if some other in use bundle wiring is dependent upon it. Once a bundle wiring is no longer in use, it is considered stale and is discarded by the framework.- 指定者:
isInUse在接口中BundleWiring- 返回:
trueif this bundle wiring is in use;falseotherwise.
-
getResourceCapabilities
public java.util.List<Capability> getResourceCapabilities(java.lang.String namespace)
从接口复制的说明:BundleWiringReturns the capabilities provided by this wiring.Only capabilities considered by the resolver are returned. For example, capabilities with
effectivedirective not equal toresolveare not returned.A capability may not be required by any wiring and thus there may be no
wiresfor the capability.A wiring for a non-fragment resource provides a subset of the declared capabilities from the resource and all attached fragment resources†. Not all declared capabilities may be provided since some may be discarded. For example, if a package is declared to be both exported and imported, only one is selected and the other is discarded.
A wiring for a fragment resource with a symbolic name must provide exactly one
osgi.identitycapability.† The
osgi.identitycapability provided by attached fragment resource must not be included in the capabilities of the host wiring.This method returns the same value as
BundleWiring.getCapabilities(String).- 指定者:
getResourceCapabilities在接口中BundleWiring- 指定者:
getResourceCapabilities在接口中Wiring- 参数:
namespace- The namespace of the capabilities to return ornullto return the capabilities from all namespaces.- 返回:
- A list containing a snapshot of the
Capabilitys, or an empty list if this wiring provides no capabilities in the specified namespace. For a given namespace, the list contains the capabilities in the order the capabilities were specified in the manifests of theresourceand the attached fragment resources† of this wiring. There is no ordering defined between capabilities in different namespaces.
-
getCapabilities
public java.util.List<BundleCapability> getCapabilities(java.lang.String namespace)
从接口复制的说明:BundleWiringReturns the capabilities provided by this bundle wiring.Only capabilities considered by the resolver are returned. For example, capabilities with
effectivedirective not equal toresolveare not returned.A capability may not be required by any bundle wiring and thus there may be no
wiresfor the capability.A bundle wiring for a non-fragment revision provides a subset of the declared capabilities from the bundle revision and all attached fragment revisions†. Not all declared capabilities may be provided since some may be discarded. For example, if a package is declared to be both exported and imported, only one is selected and the other is discarded.
A bundle wiring for a fragment revision with a symbolic name must provide exactly one
identitycapability.† The
identitycapability provided by attached fragment revisions must not be included in the capabilities of the host bundle wiring.- 指定者:
getCapabilities在接口中BundleWiring- 参数:
namespace- The namespace of the capabilities to return ornullto return the capabilities from all namespaces.- 返回:
- A list containing a snapshot of the
BundleCapabilitys, or an empty list if this bundle wiring provides no capabilities in the specified namespace. If this bundle wiring is notin use,nullwill be returned. For a given namespace, the list contains the capabilities in the order the capabilities were specified in the manifests of thebundle revisionand the attached fragments† of this bundle wiring. There is no ordering defined between capabilities in different namespaces.
-
getResourceRequirements
public java.util.List<Requirement> getResourceRequirements(java.lang.String namespace)
从接口复制的说明:BundleWiringReturns the requirements of this wiring.Only requirements considered by the resolver are returned. For example, requirements with
effectivedirective not equal toresolveare not returned.A wiring for a non-fragment resource has a subset of the declared requirements from the resource and all attached fragment resources. Not all declared requirements may be present since some may be discarded. For example, if a package is declared to be optionally imported and is not actually imported, the requirement must be discarded.
This method returns the same value as
BundleWiring.getRequirements(String).- 指定者:
getResourceRequirements在接口中BundleWiring- 指定者:
getResourceRequirements在接口中Wiring- 参数:
namespace- The namespace of the requirements to return ornullto return the requirements from all namespaces.- 返回:
- A list containing a snapshot of the
Requirements, or an empty list if this wiring uses no requirements in the specified namespace. For a given namespace, the list contains the requirements in the order the requirements were specified in the manifests of theresourceand the attached fragment resources of this wiring. There is no ordering defined between requirements in different namespaces.
-
getRequirements
public java.util.List<BundleRequirement> getRequirements(java.lang.String namespace)
从接口复制的说明:BundleWiringReturns the requirements of this bundle wiring.Only requirements considered by the resolver are returned. For example, requirements with
effectivedirective not equal toresolveare not returned.A bundle wiring for a non-fragment revision has a subset of the declared requirements from the bundle revision and all attached fragment revisions. Not all declared requirements may be present since some may be discarded. For example, if a package is declared to be optionally imported and is not actually imported, the requirement must be discarded.
- 指定者:
getRequirements在接口中BundleWiring- 参数:
namespace- The namespace of the requirements to return ornullto return the requirements from all namespaces.- 返回:
- A list containing a snapshot of the
BundleRequirements, or an empty list if this bundle wiring uses no requirements in the specified namespace. If this bundle wiring is notin use,nullwill be returned. For a given namespace, the list contains the requirements in the order the requirements were specified in the manifests of thebundle revisionand the attached fragments of this bundle wiring. There is no ordering defined between requirements in different namespaces.
-
getNativeLibraries
public java.util.List<NativeLibrary> getNativeLibraries()
-
getProvidedResourceWires
public java.util.List<Wire> getProvidedResourceWires(java.lang.String namespace)
从接口复制的说明:BundleWiringReturns theWires to the providedcapabilitiesof this wiring.This method returns the same value as
BundleWiring.getProvidedWires(String).- 指定者:
getProvidedResourceWires在接口中BundleWiring- 指定者:
getProvidedResourceWires在接口中Wiring- 参数:
namespace- The namespace of the capabilities for which to return wires ornullto return the wires for the capabilities in all namespaces.- 返回:
- A list containing a snapshot of the
Wires for thecapabilitiesof this wiring, or an empty list if this wiring has no capabilities in the specified namespace. For a given namespace, the list contains the wires in the order the capabilities were specified in the manifests of theresourceand the attached fragment resources of this wiring. There is no ordering defined between capabilities in different namespaces.
-
getProvidedWires
public java.util.List<BundleWire> getProvidedWires(java.lang.String namespace)
从接口复制的说明:BundleWiringReturns theBundleWires to the providedcapabilitiesof this bundle wiring.- 指定者:
getProvidedWires在接口中BundleWiring- 参数:
namespace- The namespace of the capabilities for which to return wires ornullto return the wires for the capabilities in all namespaces.- 返回:
- A list containing a snapshot of the
BundleWires for thecapabilitiesof this bundle wiring, or an empty list if this bundle wiring has no capabilities in the specified namespace. If this bundle wiring is notin use,nullwill be returned. For a given namespace, the list contains the wires in the order the capabilities were specified in the manifests of thebundle revisionand the attached fragments of this bundle wiring. There is no ordering defined between capabilities in different namespaces.
-
getRequiredResourceWires
public java.util.List<Wire> getRequiredResourceWires(java.lang.String namespace)
从接口复制的说明:BundleWiringReturns theWires to therequirementsin use by this wiring.This method returns the same value as
BundleWiring.getRequiredWires(String).- 指定者:
getRequiredResourceWires在接口中BundleWiring- 指定者:
getRequiredResourceWires在接口中Wiring- 参数:
namespace- The namespace of the requirements for which to return wires ornullto return the wires for the requirements in all namespaces.- 返回:
- A list containing a snapshot of the
Wires for therequirementsof this wiring, or an empty list if this wiring has no requirements in the specified namespace. For a given namespace, the list contains the wires in the order the requirements were specified in the manifests of theresourceand the attached fragment resources of this wiring. There is no ordering defined between requirements in different namespaces.
-
getRequiredWires
public java.util.List<BundleWire> getRequiredWires(java.lang.String namespace)
从接口复制的说明:BundleWiringReturns theBundleWires to therequirementsin use by this bundle wiring.This method may return different results if this bundle wiring establishes additional wires to more requirements. For example, dynamically importing a package will establish a new wire to the dynamically imported package.
- 指定者:
getRequiredWires在接口中BundleWiring- 参数:
namespace- The namespace of the requirements for which to return wires ornullto return the wires for the requirements in all namespaces.- 返回:
- A list containing a snapshot of the
BundleWires for therequirementsof this bundle wiring, or an empty list if this bundle wiring has no requirements in the specified namespace. If this bundle wiring is notin use,nullwill be returned. For a given namespace, the list contains the wires in the order the requirements were specified in the manifests of thebundle revisionand the attached fragments of this bundle wiring followed by dynamically established wires, if any, in the order they were established. There is no ordering defined between requirements in different namespaces.
-
addDynamicWire
public void addDynamicWire(BundleWire wire)
-
getResource
public BundleRevision getResource()
从接口复制的说明:BundleWiringReturns the resource associated with this wiring.This method returns the same value as
BundleWiring.getRevision().- 指定者:
getResource在接口中BundleWiring- 指定者:
getResource在接口中Wiring- 返回:
- The resource associated with this wiring.
-
getRevision
public BundleRevision getRevision()
从接口复制的说明:BundleWiringReturns the bundle revision for the bundle in this bundle wiring. Since a bundle update can change the entries in a bundle, different bundle wirings for the same bundle can have different bundle revisions.The bundle object
referencedby the returnedBundleRevisionmay return different information than the returnedBundleRevisionsince the returnedBundleRevisionmay refer to an older revision of the bundle.- 指定者:
getRevision在接口中BundleWiring- 返回:
- The bundle revision for this bundle wiring.
- 另请参阅:
BundleRevision.getWiring()
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
从接口复制的说明:BundleWiringReturns the class loader for this bundle wiring. Since a bundle refresh creates a new bundle wiring for a bundle, different bundle wirings for the same bundle will have different class loaders.- 指定者:
getClassLoader在接口中BundleWiring- 返回:
- The class loader for this bundle wiring. If this bundle wiring is
not
in useor this bundle wiring is for a fragment revision,nullwill be returned.
-
findEntries
public java.util.List<java.net.URL> findEntries(java.lang.String path, java.lang.String filePattern, int options)从接口复制的说明:BundleWiringReturns entries in this bundle wiring'sbundle revisionand its attached fragment revisions. This bundle wiring's class loader is not used to search for entries. Only the contents of this bundle wiring's bundle revision and its attached fragment revisions are searched for the specified entries.This method takes into account that the "contents" of this bundle wiring can have attached fragments. This "bundle space" is not a namespace with unique members; the same entry name can be present multiple times. This method therefore returns a list of URL objects. These URLs can come from different JARs but have the same path name. This method can either return only entries in the specified path or recurse into subdirectories returning entries in the directory tree beginning at the specified path.
URLs for directory entries must have their path end with "/".
Note: Jar and zip files are not required to include directory entries. URLs to directory entries will not be returned if the bundle contents do not contain directory entries.
- 指定者:
findEntries在接口中BundleWiring- 参数:
path- The path name in which to look. The path is always relative to the root of this bundle wiring and may begin with "/". A path value of "/" indicates the root of this bundle wiring.filePattern- The file name pattern for selecting entries in the specified path. The pattern is only matched against the last element of the entry path. If the entry is a directory then the trailing "/" is not used for pattern matching. Substring matching is supported, as specified in the Filter specification, using the wildcard character ("*"). Ifnullis specified, this is equivalent to "*" and matches all files.options- The options for listing resource names. SeeBundleWiring.FINDENTRIES_RECURSE. The method must ignore unrecognized options.- 返回:
- An unmodifiable list of URL objects for each matching entry, or
an empty list if no matching entry could be found, if this bundle
wiring is for a fragment revision or if the caller does not have
the appropriate
AdminPermission[bundle,RESOURCE]and the Java Runtime Environment supports permissions. The list is ordered such that entries from thebundle revisionare returned first followed by the entries from attached fragment revisions in attachment order. If this bundle wiring is notin use,nullmust be returned. - 另请参阅:
Bundle.findEntries(String, String, boolean)
-
listResources
public java.util.Collection<java.lang.String> listResources(java.lang.String path, java.lang.String filePattern, int options)从接口复制的说明:BundleWiringReturns the names of resources visible to this bundle wiring'sclass loader. The returned names can be used to access the resources via this bundle wiring's class loader.- Only the resource names for resources in bundle wirings will be returned. The names of resources visible to a bundle wiring's parent class loader, such as the bootstrap class loader, must not be included in the result.
- Only established wires will be examined for resources. This method must not cause new wires for dynamic imports to be established.
- 指定者:
listResources在接口中BundleWiring- 参数:
path- The path name in which to look. The path is always relative to the root of this bundle wiring's class loader and may begin with "/". A path value of "/" indicates the root of this bundle wiring's class loader.filePattern- The file name pattern for selecting resource names in the specified path. The pattern is only matched against the last element of the resource path. If the resource is a directory then the trailing "/" is not used for pattern matching. Substring matching is supported, as specified in the Filter specification, using the wildcard character ("*"). Ifnullis specified, this is equivalent to "*" and matches all files.options- The options for listing resource names. SeeBundleWiring.LISTRESOURCES_LOCALandBundleWiring.LISTRESOURCES_RECURSE. This method must ignore unrecognized options.- 返回:
- An unmodifiable collection of resource names for each matching
resource, or an empty collection if no matching resource could be
found, if this bundle wiring is for a fragment revision or if the
caller does not have the appropriate
AdminPermission[bundle,RESOURCE]and the Java Runtime Environment supports permissions. The collection is unordered and must contain no duplicate resource names. If this bundle wiring is notin use,nullmust be returned.
-
getBundle
public Bundle getBundle()
从接口复制的说明:BundleReferenceReturns theBundleobject associated with thisBundleReference.- 指定者:
getBundle在接口中BundleReference- 返回:
- The
Bundleobject associated with thisBundleReference.
-
getResourcesByDelegation
public java.util.Enumeration getResourcesByDelegation(java.lang.String name)
-
getClassByDelegation
public java.lang.Class getClassByDelegation(java.lang.String name) throws java.lang.ClassNotFoundException- 抛出:
java.lang.ClassNotFoundException
-
getResourceByDelegation
public java.net.URL getResourceByDelegation(java.lang.String name)
-
-