public class BundleFragment extends AbstractBundle
Modifier and Type | Field and Description |
---|---|
protected BundleHost[] |
hosts
The resolved host that this fragment is attached to
|
bundledata, domain, framework, manifestLocalization, state, statechangeLock, stateChanging
ACTIVE, INSTALLED, RESOLVED, SIGNERS_ALL, SIGNERS_TRUSTED, START_ACTIVATION_POLICY, START_TRANSIENT, STARTING, STOP_TRANSIENT, STOPPING, UNINSTALLED
Constructor and Description |
---|
BundleFragment(BundleData bundledata,
Framework framework) |
Modifier and Type | Method and Description |
---|---|
protected BundleLoader |
getBundleLoader() |
protected BundleContextImpl |
getContext()
Return the current context for this bundle.
|
ServiceReference<?>[] |
getRegisteredServices()
Provides a list of
ServiceReference s for the services
registered by this bundle
or null if the bundle has no registered
services. |
URL |
getResource(String name)
Find the specified resource in this bundle.
|
Enumeration<URL> |
getResources(String name)
Find the specified resources from this bundle's class loader.
|
ServiceReference<?>[] |
getServicesInUse()
Provides a list of
ServiceReference s for the
services this bundle is using,
or null if the bundle is not using any services. |
protected boolean |
isFragment() |
protected void |
load()
Load the bundle.
|
protected Class<?> |
loadClass(String name,
boolean checkPermission)
This method loads a class from the bundle.
|
protected void |
refresh()
Refresh the bundle.
|
protected boolean |
reload(AbstractBundle newBundle)
Reload from a new bundle.
|
protected void |
startWorker(int options)
Internal worker to start a bundle.
|
protected void |
stopWorker(int options)
Internal worker to stop a bundle.
|
protected boolean |
unload()
Unload the bundle.
|
adapt, adapt0, beginStateChange, checkValid, close, compare, compareTo, completeStateChange, createBundle, findEntries, getBundle, getBundleContext, getBundleData, getBundleDescription, getBundleId, getDataFile, getEntry, getEntryPaths, getFragments, getFramework, getHeaders, getHeaders, getKey, getKeyHashCode, getLastModified, getLocation, getProtectionDomain, getResolutionFailureException, getResourceBundle, getRevisions, getSignerCertificates, getStartLevel, getState, getStateChanging, getSymbolicName, getVersion, hasPermission, isActivationPolicyUsed, isActive, isPersistentlyStarted, isResolved, loadBundleActivator, loadClass, readyToResume, resolve, resume, setStartLevel, setStatus, start, start, stop, stop, suspend, testStateChanging, toString, uninstall, uninstallWorker, uninstallWorkerPrivileged, update, update, updateWorker, updateWorkerPrivileged
protected BundleHost[] hosts
public BundleFragment(BundleData bundledata, Framework framework) throws BundleException
bundledata
- framework
- BundleException
protected void load()
load
in class AbstractBundle
protected boolean reload(AbstractBundle newBundle)
reload
in class AbstractBundle
newBundle
- Dummy Bundle which contains new data.protected void refresh()
refresh
in class AbstractBundle
protected boolean unload()
unload
in class AbstractBundle
protected Class<?> loadClass(String name, boolean checkPermission) throws ClassNotFoundException
loadClass
in class AbstractBundle
name
- the name of the desired Class.checkPermission
- indicates whether a permission check should be done.ClassNotFoundException
- if the class definition was not found.public URL getResource(String name)
name
- The name of the resource.
See java.lang.ClassLoader.getResource for a description of
the format of a resource name.IllegalStateException
- If this bundle has been uninstalled.Bundle.getEntry(String)
,
Bundle.findEntries(String, String, boolean)
public Enumeration<URL> getResources(String name)
Bundle
INSTALLED
, this method must
attempt to resolve this bundle before attempting to get the specified
resources. If this bundle cannot be resolved, then only this bundle must
be searched for the specified resources. Imported packages cannot be
searched when a bundle has not been resolved. If this bundle is a
fragment bundle then null
is returned.
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.
name
- The name of the resource. See
ClassLoader.getResources
for a description of the format
of a resource name.null
if
the resource could not be found or if this bundle is a fragment
bundle or if the caller does not have the appropriate
AdminPermission[this,RESOURCE]
, and the Java Runtime
Environment supports permissions.protected void startWorker(int options) throws BundleException
startWorker
in class AbstractBundle
options
- BundleException
protected void stopWorker(int options) throws BundleException
stopWorker
in class AbstractBundle
options
- BundleException
public ServiceReference<?>[] getRegisteredServices()
ServiceReference
s for the services
registered by this bundle
or null
if the bundle has no registered
services.
The list is valid at the time of the call to this method, but the framework is a very dynamic environment and services can be modified or unregistered at anytime.
ServiceReference
or null
.IllegalStateException
- If the
bundle has been uninstalled.ServiceRegistration
,
ServiceReference
public ServiceReference<?>[] getServicesInUse()
ServiceReference
s for the
services this bundle is using,
or null
if the bundle is not using any services.
A bundle is considered to be using a service if the bundle's
use count for the service is greater than zero.
The list is valid at the time of the call to this method, but the framework is a very dynamic environment and services can be modified or unregistered at anytime.
ServiceReference
or null
.IllegalStateException
- If the
bundle has been uninstalled.ServiceReference
protected boolean isFragment()
isFragment
in class AbstractBundle
protected BundleLoader getBundleLoader()
getBundleLoader
in class AbstractBundle
protected BundleContextImpl getContext()
getContext
in class AbstractBundle
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.