类 PackageAdminImpl
- java.lang.Object
-
- org.apache.felix.framework.PackageAdminImpl
-
- 所有已实现的接口:
PackageAdmin
public class PackageAdminImpl extends java.lang.Object implements PackageAdmin
-
-
字段概要
-
从接口继承的字段 org.osgi.service.packageadmin.PackageAdmin
BUNDLE_TYPE_FRAGMENT
-
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 BundlegetBundle(java.lang.Class clazz)Returns the bundle associated with this class if the class was loaded from a bundle, otherwise returns null.Bundle[]getBundles(java.lang.String symbolicName, java.lang.String versionRange)Returns all bundles that have a specified symbolic name and whose version is in the specified version range.intgetBundleType(Bundle bundle)Returns the special type of the specified bundle.ExportedPackagegetExportedPackage(java.lang.String name)Returns the exported package associated with the specified package name.ExportedPackage[]getExportedPackages(java.lang.String name)Gets the exported packages for the specified package name.ExportedPackage[]getExportedPackages(Bundle bundle)Returns the packages exported by the specified bundle.Bundle[]getFragments(Bundle bundle)Returns an array of attached fragment bundles for the specified bundle.Bundle[]getHosts(Bundle bundle)Returns the host bundles to which the specified fragment bundle is attached.RequiredBundle[]getRequiredBundles(java.lang.String symbolicName)Returns an array of required bundles having the specified symbolic name.voidrefreshPackages(Bundle[] bundles)The OSGi specification states that refreshing packages is asynchronous; this method simply notifies the package admin thread to do a refresh.booleanresolveBundles(Bundle[] bundles)Resolve the specified bundles.
-
-
-
方法详细资料
-
getBundle
public Bundle getBundle(java.lang.Class clazz)
Returns the bundle associated with this class if the class was loaded from a bundle, otherwise returns null.- 指定者:
getBundle在接口中PackageAdmin- 参数:
clazz- the class for which to determine its associated bundle.- 返回:
- the bundle associated with the specified class, otherwise null.
-
getBundles
public Bundle[] getBundles(java.lang.String symbolicName, java.lang.String versionRange)
Returns all bundles that have a specified symbolic name and whose version is in the specified version range. If no version range is specified, then all bundles with the specified symbolic name are returned. The array is sorted in descending version order.- 指定者:
getBundles在接口中PackageAdmin- 参数:
symbolicName- the target symbolic name.versionRange- the target version range.- 返回:
- an array of matching bundles sorted in descending version order.
- 另请参阅:
Constants.BUNDLE_VERSION_ATTRIBUTE
-
getBundleType
public int getBundleType(Bundle bundle)
从接口复制的说明:PackageAdminReturns the special type of the specified bundle. The bundle type values are: A bundle may be more than one type at a time. A type code is used to identify the bundle type for future extendability.If a bundle is not one or more of the defined types then 0x00000000 is returned.
- 指定者:
getBundleType在接口中PackageAdmin- 参数:
bundle- The bundle for which to return the special type.- 返回:
- The special type of the bundle.
-
getExportedPackage
public ExportedPackage getExportedPackage(java.lang.String name)
Returns the exported package associated with the specified package name. If there are more than one version of the package being exported, then the highest version is returned.- 指定者:
getExportedPackage在接口中PackageAdmin- 参数:
name- the name of the exported package to find.- 返回:
- the exported package or null if no matching package was found.
- 另请参阅:
PackageAdmin.getExportedPackages(String)
-
getExportedPackages
public ExportedPackage[] getExportedPackages(java.lang.String name)
从接口复制的说明:PackageAdminGets the exported packages for the specified package name.- 指定者:
getExportedPackages在接口中PackageAdmin- 参数:
name- The name of the exported packages to be returned.- 返回:
- An array of the exported packages, or
nullif no exported packages with the specified name exists.
-
getExportedPackages
public ExportedPackage[] getExportedPackages(Bundle bundle)
Returns the packages exported by the specified bundle.- 指定者:
getExportedPackages在接口中PackageAdmin- 参数:
bundle- the bundle whose exported packages are to be returned.- 返回:
- an array of packages exported by the bundle or null if the bundle does not export any packages.
-
getFragments
public Bundle[] getFragments(Bundle bundle)
从接口复制的说明:PackageAdminReturns an array of attached fragment bundles for the specified bundle. If the specified bundle is a fragment thennullis returned. If no fragments are attached to the specified bundle thennullis returned.This method does not attempt to resolve the specified bundle. If the specified bundle is not resolved then
nullis returned.- 指定者:
getFragments在接口中PackageAdmin- 参数:
bundle- The bundle whose attached fragment bundles are to be returned.- 返回:
- An array of fragment bundles or
nullif the bundle does not have any attached fragment bundles or the bundle is not resolved.
-
getHosts
public Bundle[] getHosts(Bundle bundle)
从接口复制的说明:PackageAdminReturns the host bundles to which the specified fragment bundle is attached.- 指定者:
getHosts在接口中PackageAdmin- 参数:
bundle- The fragment bundle whose host bundles are to be returned.- 返回:
- An array containing the host bundles to which the specified
fragment is attached or
nullif the specified bundle is not a fragment or is not attached to any host bundles.
-
getRequiredBundles
public RequiredBundle[] getRequiredBundles(java.lang.String symbolicName)
从接口复制的说明:PackageAdminReturns an array of required bundles having the specified symbolic name.If
nullis specified, then all required bundles will be returned.- 指定者:
getRequiredBundles在接口中PackageAdmin- 参数:
symbolicName- The bundle symbolic name ornullfor all required bundles.- 返回:
- An array of required bundles or
nullif no required bundles exist for the specified symbolic name.
-
refreshPackages
public void refreshPackages(Bundle[] bundles) throws java.lang.SecurityException
The OSGi specification states that refreshing packages is asynchronous; this method simply notifies the package admin thread to do a refresh.- 指定者:
refreshPackages在接口中PackageAdmin- 参数:
bundles- array of bundles to refresh or null to refresh any bundles in need of refreshing.- 抛出:
java.lang.SecurityException- If the caller does not haveAdminPermission[System Bundle,RESOLVE]and the Java runtime environment supports permissions.
-
resolveBundles
public boolean resolveBundles(Bundle[] bundles)
从接口复制的说明:PackageAdminResolve the specified bundles. The Framework must attempt to resolve the specified bundles that are unresolved. Additional bundles that are not included in the specified bundles may be resolved as a result of calling this method. A permissible implementation of this method is to attempt to resolve all unresolved bundles installed in the framework.If
nullis specified then the Framework will attempt to resolve all unresolved bundles. This method must not cause any bundle to be refreshed, stopped, or started. This method will not return until the operation has completed.- 指定者:
resolveBundles在接口中PackageAdmin- 参数:
bundles- The bundles to resolve ornullto resolve all unresolved bundles installed in the Framework.- 返回:
trueif all specified bundles are resolved;
-
-