|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.osgi.framework.internal.core.Framework
public class Framework
Core OSGi Framework class.
| Field Summary | |
|---|---|
protected boolean |
active
Has the framework been started |
protected FrameworkAdaptor |
adaptor
FrameworkAdaptor specific functions. |
protected static AliasMapper |
aliasMapper
The AliasMapper used to alias OS Names. |
protected static int |
BATCHEVENT_BEGIN
|
protected static int |
BATCHEVENT_END
|
protected static int |
BUNDLEEVENT
|
protected static int |
BUNDLEEVENTSYNC
|
protected BundleRepository |
bundles
The bundles installed in the framework |
boolean |
compatibiltyBootDelegation
|
boolean |
contextBootDelegation
|
protected EventManager |
eventManager
EventManager for event delivery. |
protected static int |
FRAMEWORKEVENT
|
protected PackageAdminImpl |
packageAdmin
Package Admin object. |
static java.lang.String |
PROP_EQUINOX_SECURITY
|
static java.lang.String |
PROP_FRAMEWORK_THREAD
|
protected java.util.Properties |
properties
Framework properties object. |
static java.lang.String |
SECURITY_OSGI
|
protected SecurityAdmin |
securityAdmin
PermissionAdmin and ConditionalPermissionAdmin impl. |
protected StartLevelManager |
startLevelManager
Startlevel object. |
protected InternalSystemBundle |
systemBundle
System Bundle object |
static java.lang.String |
THREAD_NORMAL
|
| Constructor Summary | |
|---|---|
Framework(FrameworkAdaptor adaptor)
Constructor for the Framework instance. |
|
| Method Summary | ||
|---|---|---|
static java.util.Collection<BundleContext> |
asBundleContexts(java.util.Collection<? extends BundleContext> c)
Coerce the generic type of a collection from Collection |
|
protected void |
checkAdminPermission(Bundle bundle,
java.lang.String action)
Check for specific AdminPermission (RFC 73) |
|
void |
close()
This method is called to destory the framework instance. |
|
FrameworkAdaptor |
getAdaptor()
|
|
protected AbstractBundle[] |
getAllBundles()
Retrieve a list of all installed bundles. |
|
AbstractBundle |
getBundle(long id)
Retrieve the bundle that has the given unique identifier. |
|
protected AbstractBundle |
getBundleByLocation(java.lang.String location)
Locate an installed bundle with a given identity. |
|
protected AbstractBundle[] |
getBundleBySymbolicName(java.lang.String symbolicName)
Locate an installed bundle with a given symbolic name |
|
AbstractBundle |
getBundleBySymbolicName(java.lang.String symbolicName,
Version version)
Retrieve the bundle that has the given symbolic name and version. |
|
protected BundleRepository |
getBundles()
Retrieve the BundleRepository of all installed bundles. |
|
protected java.io.File |
getDataFile(AbstractBundle bundle,
java.lang.String filename)
Creates a File object for a file in the persistent
storage area provided for the bundle by the framework. |
|
ClassLoaderDelegateHook[] |
getDelegateHooks()
|
|
static java.lang.reflect.Field |
getField(java.lang.Class<?> clazz,
java.lang.Class<?> type,
boolean instance)
|
|
PackageAdminImpl |
getPackageAdmin()
|
|
java.lang.String |
getProperty(java.lang.String key)
Retrieve the value of the named environment property. |
|
protected java.lang.String |
getProperty(java.lang.String key,
java.lang.String def)
Retrieve the value of the named environment property. |
|
ServiceRegistry |
getServiceRegistry()
|
|
BundleContextImpl |
getSystemBundleContext()
|
|
protected void |
initialize(FrameworkAdaptor initAdaptor)
Initialize the framework to an unlaunched state. |
|
protected void |
initializeProperties(java.util.Properties adaptorProperties)
Initialize the System properties by copying properties from the adaptor properties object. |
|
protected void |
installSecurityManager()
This is necessary for running from a JXE, otherwise the SecurityManager is set much later than we would like! |
|
protected AbstractBundle |
installWorker(java.lang.String location,
java.security.PrivilegedExceptionAction<AbstractBundle> action,
BundleContext origin)
Worker method to install a bundle. |
|
protected AbstractBundle |
installWorkerPrivileged(java.lang.String location,
java.net.URLConnection source,
java.security.AccessControlContext callerContext)
Worker method to install a bundle. |
|
protected boolean |
isActive()
This method return the state of the framework. |
|
boolean |
isBootDelegationPackage(java.lang.String name)
|
|
boolean |
isRefreshDuplicateBSNAllowed()
|
|
boolean |
isServiceAssignableTo(Bundle registrant,
Bundle client,
java.lang.String className,
java.lang.Class<?> serviceClass)
Used by ServiceReferenceImpl for isAssignableTo |
|
void |
launch()
Start the framework. |
|
|
newListenerQueue()
|
|
void |
publishBundleEvent(int type,
Bundle bundle)
Deliver a BundleEvent to SynchronousBundleListeners (synchronous). |
|
void |
publishBundleEventPrivileged(BundleEvent event)
|
|
void |
publishFrameworkEvent(int type,
Bundle bundle,
java.lang.Throwable throwable)
Deliver a FrameworkEvent. |
|
void |
publishFrameworkEvent(int type,
Bundle bundle,
java.lang.Throwable throwable,
FrameworkListener... listeners)
|
|
void |
publishFrameworkEventPrivileged(FrameworkEvent event,
FrameworkListener... callerListeners)
|
|
protected void |
resumeBundle(AbstractBundle bundle)
Resume a bundle. |
|
void |
run()
|
|
protected java.lang.Object |
setProperty(java.lang.String key,
java.lang.String value)
Set a system property. |
|
void |
shutdown(int eventType)
Stop the framework. |
|
protected boolean |
suspendBundle(AbstractBundle bundle,
boolean lock)
Suspend a bundle. |
|
FrameworkEvent |
waitForStop(long timeout)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROP_FRAMEWORK_THREAD
public static final java.lang.String THREAD_NORMAL
public static final java.lang.String PROP_EQUINOX_SECURITY
public static final java.lang.String SECURITY_OSGI
protected FrameworkAdaptor adaptor
protected java.util.Properties properties
protected boolean active
protected BundleRepository bundles
protected PackageAdminImpl packageAdmin
protected SecurityAdmin securityAdmin
protected StartLevelManager startLevelManager
protected static final int BUNDLEEVENT
protected static final int BUNDLEEVENTSYNC
protected static final int FRAMEWORKEVENT
protected static final int BATCHEVENT_BEGIN
protected static final int BATCHEVENT_END
protected EventManager eventManager
protected InternalSystemBundle systemBundle
public final boolean contextBootDelegation
public final boolean compatibiltyBootDelegation
protected static AliasMapper aliasMapper
| Constructor Detail |
|---|
public Framework(FrameworkAdaptor adaptor)
| Method Detail |
|---|
protected void initialize(FrameworkAdaptor initAdaptor)
public FrameworkAdaptor getAdaptor()
public ClassLoaderDelegateHook[] getDelegateHooks()
public ServiceRegistry getServiceRegistry()
protected void initializeProperties(java.util.Properties adaptorProperties)
protected boolean isActive()
public void close()
public void launch()
public void shutdown(int eventType)
public java.lang.String getProperty(java.lang.String key)
org.osgi.framework.version
org.osgi.framework.vendor
org.osgi.framework.language
org.osgi.framework.os.name
org.osgi.framework.os.version
org.osgi.framework.processor
Note: These last four properties are used by the Bundle-NativeCode
manifest header's matching algorithm for selecting native code.
key - The name of the requested property.
null if
the property is undefined.
protected java.lang.String getProperty(java.lang.String key,
java.lang.String def)
org.osgi.framework.version
org.osgi.framework.vendor
org.osgi.framework.language
org.osgi.framework.os.name
org.osgi.framework.os.version
org.osgi.framework.processor
Note: These last four properties are used by the Bundle-NativeCode
manifest header's matching algorithm for selecting native code.
key - The name of the requested property.def - A default value is the requested property is not present.
protected java.lang.Object setProperty(java.lang.String key,
java.lang.String value)
key - The name of the property to set.value - The value to set.
protected AbstractBundle installWorker(java.lang.String location,
java.security.PrivilegedExceptionAction<AbstractBundle> action,
BundleContext origin)
throws BundleException
location - The location identifier of the bundle to install.action - A PrivilegedExceptionAction which calls the real worker.
AbstractBundleof the installed bundle.
BundleException - If the action throws an error.
protected AbstractBundle installWorkerPrivileged(java.lang.String location,
java.net.URLConnection source,
java.security.AccessControlContext callerContext)
throws BundleException
location - The location identifier of the bundle to install.source - The URLConnection from which the bundle will be read.
AbstractBundleof the installed bundle.
BundleException - If the provided stream cannot be read.public AbstractBundle getBundle(long id)
id - The identifier of the bundle to retrieve.
AbstractBundleobject, or null if the
identifier doesn't match any installed bundle.public BundleContextImpl getSystemBundleContext()
public PackageAdminImpl getPackageAdmin()
public AbstractBundle getBundleBySymbolicName(java.lang.String symbolicName,
Version version)
symbolicName - The symbolic name of the bundle to retrieveversion - The version of the bundle to retrieve
AbstractBundleobject, or null if the
identifier doesn't match any installed bundle.protected BundleRepository getBundles()
protected AbstractBundle[] getAllBundles()
AbstractBundleobjects, one object per installed
bundle.protected void resumeBundle(AbstractBundle bundle)
bundle - Bundle to resume.
protected boolean suspendBundle(AbstractBundle bundle,
boolean lock)
bundle - Bundle to suspend.lock - true if state change lock should be held when returning from
this method.
protected AbstractBundle getBundleByLocation(java.lang.String location)
location - string for the bundle
protected AbstractBundle[] getBundleBySymbolicName(java.lang.String symbolicName)
symbolicName - The symbolic name for the bundle
protected java.io.File getDataFile(AbstractBundle bundle,
java.lang.String filename)
File object for a file in the persistent
storage area provided for the bundle by the framework. If the adaptor
does not have file system support, this method will return null.
A File object for the base directory of the persistent
storage area provided for the context bundle by the framework can be
obtained by calling this method with the empty string ("") as the
parameter.
protected void checkAdminPermission(Bundle bundle,
java.lang.String action)
protected void installSecurityManager()
public void publishFrameworkEvent(int type,
Bundle bundle,
java.lang.Throwable throwable)
publishFrameworkEvent in interface EventPublishertype - FrameworkEvent type.bundle - Affected bundle or null for system bundle.throwable - Related exception or null.FrameworkEvent
public void publishFrameworkEvent(int type,
Bundle bundle,
java.lang.Throwable throwable,
FrameworkListener... listeners)
public void publishFrameworkEventPrivileged(FrameworkEvent event,
FrameworkListener... callerListeners)
public void publishBundleEvent(int type,
Bundle bundle)
type - BundleEvent type.bundle - Affected bundle or null.public void publishBundleEventPrivileged(BundleEvent event)
public static java.util.Collection<BundleContext> asBundleContexts(java.util.Collection<? extends BundleContext> c)
c - Collection to be coerced.
public <K,V,E> ListenerQueue<K,V,E> newListenerQueue()
public static java.lang.reflect.Field getField(java.lang.Class<?> clazz,
java.lang.Class<?> type,
boolean instance)
public void run()
run in interface java.lang.Runnable
public FrameworkEvent waitForStop(long timeout)
throws java.lang.InterruptedException
java.lang.InterruptedException
public boolean isServiceAssignableTo(Bundle registrant,
Bundle client,
java.lang.String className,
java.lang.Class<?> serviceClass)
registrant - Bundle registering serviceclient - Bundle desiring to use serviceclassName - class name to useserviceClass - class of original service object
public boolean isBootDelegationPackage(java.lang.String name)
public boolean isRefreshDuplicateBSNAllowed()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||