|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.osgi.framework.internal.core.AbstractBundle
org.eclipse.osgi.framework.internal.core.BundleHost
public class BundleHost
Field Summary | |
---|---|
protected BundleContextImpl |
context
The BundleContext that represents this Bundle and all of its fragments |
protected BundleFragment[] |
fragments
The List of BundleFragments |
Fields inherited from class org.eclipse.osgi.framework.internal.core.AbstractBundle |
---|
bundledata, domain, framework, manifestLocalization, state, statechangeLock, stateChanging |
Fields inherited from interface org.osgi.framework.Bundle |
---|
ACTIVE, INSTALLED, RESOLVED, START_ACTIVATION_POLICY, START_TRANSIENT, STARTING, STOP_TRANSIENT, STOPPING, UNINSTALLED |
Constructor Summary | |
---|---|
BundleHost(BundleData bundledata,
Framework framework)
|
Method Summary | |
---|---|
protected void |
attachFragment(BundleFragment fragment)
Attaches a fragment to this BundleHost. |
protected BundleContextImpl |
createContext()
Create a BundleContext for this bundle. |
protected BundleLoader |
getBundleLoader()
|
protected BundleContextImpl |
getContext()
Return the current context for this bundle. |
protected Bundle[] |
getFragments()
|
protected BundleLoaderProxy |
getLoaderProxy()
|
ServiceReference[] |
getRegisteredServices()
Provides a list of ServiceReferenceImpl s for the services
registered by this bundle
or null if the bundle has no registered
services. |
java.net.URL |
getResource(java.lang.String name)
Find the specified resource in this bundle. |
java.util.Enumeration |
getResources(java.lang.String name)
Find the specified resources from this bundle. |
ServiceReference[] |
getServicesInUse()
Provides a list of ServiceReferenceImpl s for the
services this bundle is using,
or null if the bundle is not using any services. |
protected void |
load()
Load the bundle. |
protected java.lang.Class |
loadClass(java.lang.String name,
boolean checkPermission)
This method loads a class from the bundle. |
protected boolean |
readyToResume()
This method does the following Return false if the bundle is a fragment Return false if the bundle is not at the correct start-level Return false if the bundle is not persistently marked for start Return true if the bundle's activation policy is persistently ignored Return true if the bundle does not define an activation policy Transition to STARTING state and Fire LAZY_ACTIVATION event Return false |
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. |
Methods inherited from class org.eclipse.osgi.framework.internal.core.AbstractBundle |
---|
beginStateChange, checkValid, close, compare, compareTo, completeStateChange, createBundle, findEntries, findLocalEntryPaths, getBundleContext, getBundleData, getBundleDescription, getBundleId, getEntry, getEntryPaths, getHeaders, getHeaders, getHosts, getKey, getKeyHashCode, getLastModified, getLocation, getProtectionDomain, getResolutionFailureMessage, getResourceBundle, getStartLevel, getState, getStateChanging, getSymbolicName, getVersion, hasPermission, isActive, isFragment, isResolved, loadBundleActivator, loadClass, resolve, resume, setStatus, start, start, stop, stop, suspend, testStateChanging, toString, uninstall, uninstallWorker, uninstallWorkerPrivileged, unresolvePermissions, update, update, updateWorker, updateWorkerPrivileged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected BundleContextImpl context
protected BundleFragment[] fragments
Constructor Detail |
---|
public BundleHost(BundleData bundledata, Framework framework) throws BundleException
BundleException
Method Detail |
---|
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 java.lang.Class loadClass(java.lang.String name, boolean checkPermission) throws java.lang.ClassNotFoundException
loadClass
in class AbstractBundle
name
- the name of the desired Class.checkPermission
- indicates whether a permission check should be done.
java.lang.ClassNotFoundException
- if the class definition was not found.public java.net.URL getResource(java.lang.String name)
name
- The name of the resource.
See java.lang.ClassLoader.getResource for a description of
the format of a resource name.
java.lang.IllegalStateException
- If this bundle has been uninstalled.Bundle.getEntry(java.lang.String)
,
Bundle.findEntries(java.lang.String, java.lang.String, boolean)
public java.util.Enumeration getResources(java.lang.String name) throws java.io.IOException
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.
name
- The name of the resource. See
java.lang.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.
java.io.IOException
- If there is an I/O error.protected void startWorker(int options) throws BundleException
startWorker
in class AbstractBundle
options
- the start options
BundleException
protected boolean readyToResume()
AbstractBundle
readyToResume
in class AbstractBundle
protected BundleContextImpl createContext()
protected BundleContextImpl getContext()
getContext
in class AbstractBundle
protected void stopWorker(int options) throws BundleException
stopWorker
in class AbstractBundle
options
- the stop options
BundleException
public ServiceReference[] getRegisteredServices()
ServiceReferenceImpl
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.
ServiceReferenceImpl
or null
.
java.lang.IllegalStateException
- If the
bundle has been uninstalled.ServiceRegistrationImpl
,
ServiceReferenceImpl
public ServiceReference[] getServicesInUse()
ServiceReferenceImpl
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.
ServiceReferenceImpl
or null
.
java.lang.IllegalStateException
- If the
bundle has been uninstalled.ServiceReferenceImpl
protected Bundle[] getFragments()
getFragments
in class AbstractBundle
protected void attachFragment(BundleFragment fragment) throws BundleException
fragment
- The fragment bundle to attach
return true if the fragment successfully attached; false if the fragment
could not be logically inserted at the end of the fragment chain.
BundleException
protected BundleLoader getBundleLoader()
getBundleLoader
in class AbstractBundle
protected BundleLoaderProxy getLoaderProxy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |