|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.felix.framework.Felix
public class Felix
| Nested Class Summary | |
|---|---|
class |
Felix.FelixResolver
|
| Field Summary |
|---|
| Fields inherited from interface org.osgi.framework.Bundle |
|---|
ACTIVE, INSTALLED, RESOLVED, SIGNERS_ALL, SIGNERS_TRUSTED, START_ACTIVATION_POLICY, START_TRANSIENT, STARTING, STOP_TRANSIENT, STOPPING, UNINSTALLED |
| Constructor Summary | |
|---|---|
Felix(Map configMap)
This constructor creates a framework instance with a specified Map of configuration properties. |
|
| Method Summary | |
|---|---|
Enumeration |
findEntries(String path,
String filePattern,
boolean recurse)
|
org.osgi.framework.BundleContext |
getBundleContext()
|
long |
getBundleId()
|
URL |
getEntry(String name)
|
Enumeration |
getEntryPaths(String path)
|
Dictionary |
getHeaders()
|
Dictionary |
getHeaders(String locale)
|
long |
getLastModified()
|
String |
getLocation()
|
int |
getPersistentState()
|
org.osgi.framework.ServiceReference[] |
getRegisteredServices()
Returns an array of service references corresponding to the bundle's registered services. |
URL |
getResource(String name)
Returns a URL to a named resource in the bundle. |
Enumeration |
getResources(String name)
|
org.osgi.framework.ServiceReference[] |
getServicesInUse()
|
Map |
getSignerCertificates(int signersType)
|
int |
getState()
|
String |
getSymbolicName()
|
org.osgi.framework.Version |
getVersion()
|
boolean |
hasPermission(Object obj)
|
void |
init()
This method initializes the framework, which is comprised of resolving the system bundle, reloading any cached bundles, and activating the system bundle. |
Class |
loadClass(String name)
|
void |
setPersistentStateActive()
|
void |
setPersistentStateInactive()
|
void |
setPersistentStateUninstalled()
|
void |
start()
This method starts the framework instance, which will transition the framework from start level 0 to its active start level as specified in its configuration properties (1 by default). |
void |
start(int options)
|
void |
stop()
This method asynchronously shuts down the framework, it must be called at the end of a session in order to shutdown all active bundles. |
void |
stop(int options)
|
String |
toString()
|
void |
uninstall()
|
void |
update()
|
void |
update(InputStream is)
|
org.osgi.framework.FrameworkEvent |
waitForStop(long timeout)
This method will cause the calling thread to block until the framework shuts down. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.osgi.framework.launch.Framework |
|---|
getLocation, getSymbolicName |
| Methods inherited from interface org.osgi.framework.Bundle |
|---|
findEntries, getBundleContext, getEntry, getEntryPaths, getHeaders, getHeaders, getRegisteredServices, getResource, getResources, getServicesInUse, getSignerCertificates, getState, getVersion, loadClass |
| Constructor Detail |
|---|
public Felix(Map configMap)
This constructor creates a framework instance with a specified Map of configuration properties. Configuration properties are used internally by the framework to alter its default behavior. The configuration properties should have a String key and an Object value. The passed in Map is copied by the framework and all keys are converted to Strings.
Configuration properties are generally the sole means to configure the framework's default behavior; the framework does not typically refer to any system properties for configuration information. If a Map is supplied to this method for configuration properties, then the framework will consult the Map instance for any and all configuration properties. It is possible to specify a null for the configuration property map, in which case the framework will use its default behavior in all cases.
The following configuration properties can be specified (properties starting with "felix" are specific to Felix, while those starting with "org.osgi" are standard OSGi properties):
The Main class implements some functionality for default property file handling, which makes it possible to specify configuration properties and framework properties in files that are automatically loaded when starting the framework. If you plan to create your own framework instance, you may be able to take advantage of the features it provides; refer to its class documentation for more information.
The framework is not actually started until the start() method is called.
configMap - A map for obtaining configuration properties,
may be null.| Method Detail |
|---|
public long getBundleId()
getBundleId in interface org.osgi.framework.BundlegetBundleId in interface org.osgi.framework.launch.Frameworkpublic long getLastModified()
getLastModified in interface org.osgi.framework.Bundlepublic int getPersistentState()
public void setPersistentStateInactive()
public void setPersistentStateActive()
public void setPersistentStateUninstalled()
public boolean hasPermission(Object obj)
hasPermission in interface org.osgi.framework.Bundle
public void init()
throws org.osgi.framework.BundleException
init in interface org.osgi.framework.launch.Frameworkorg.osgi.framework.BundleException - if any error occurs.
public void start()
throws org.osgi.framework.BundleException
start in interface org.osgi.framework.Bundlestart in interface org.osgi.framework.launch.Frameworkorg.osgi.framework.BundleException - if any error occurs.
public void start(int options)
throws org.osgi.framework.BundleException
start in interface org.osgi.framework.Bundlestart in interface org.osgi.framework.launch.Frameworkorg.osgi.framework.BundleException
public void stop()
throws org.osgi.framework.BundleException
stop in interface org.osgi.framework.Bundlestop in interface org.osgi.framework.launch.Frameworkorg.osgi.framework.BundleException
public void stop(int options)
throws org.osgi.framework.BundleException
stop in interface org.osgi.framework.Bundlestop in interface org.osgi.framework.launch.Frameworkorg.osgi.framework.BundleException
public org.osgi.framework.FrameworkEvent waitForStop(long timeout)
throws InterruptedException
waitForStop in interface org.osgi.framework.launch.Frameworktimeout - A timeout value.
InterruptedException - If the thread was interrupted.
public void uninstall()
throws org.osgi.framework.BundleException
uninstall in interface org.osgi.framework.Bundleuninstall in interface org.osgi.framework.launch.Frameworkorg.osgi.framework.BundleException
public void update()
throws org.osgi.framework.BundleException
update in interface org.osgi.framework.Bundleupdate in interface org.osgi.framework.launch.Frameworkorg.osgi.framework.BundleException
public void update(InputStream is)
throws org.osgi.framework.BundleException
update in interface org.osgi.framework.Bundleupdate in interface org.osgi.framework.launch.Frameworkorg.osgi.framework.BundleExceptionpublic String toString()
public org.osgi.framework.BundleContext getBundleContext()
getBundleContext in interface org.osgi.framework.Bundlepublic URL getEntry(String name)
getEntry in interface org.osgi.framework.Bundlepublic Enumeration getEntryPaths(String path)
getEntryPaths in interface org.osgi.framework.Bundle
public Enumeration findEntries(String path,
String filePattern,
boolean recurse)
findEntries in interface org.osgi.framework.Bundlepublic Dictionary getHeaders()
getHeaders in interface org.osgi.framework.Bundlepublic Dictionary getHeaders(String locale)
getHeaders in interface org.osgi.framework.Bundlepublic String getLocation()
getLocation in interface org.osgi.framework.Bundlepublic URL getResource(String name)
getResource in interface org.osgi.framework.Bundle
public Enumeration getResources(String name)
throws IOException
getResources in interface org.osgi.framework.BundleIOExceptionpublic org.osgi.framework.ServiceReference[] getRegisteredServices()
getRegisteredServices in interface org.osgi.framework.Bundlepublic org.osgi.framework.ServiceReference[] getServicesInUse()
getServicesInUse in interface org.osgi.framework.Bundlepublic int getState()
getState in interface org.osgi.framework.Bundlepublic String getSymbolicName()
getSymbolicName in interface org.osgi.framework.Bundlepublic org.osgi.framework.Version getVersion()
getVersion in interface org.osgi.framework.Bundlepublic Map getSignerCertificates(int signersType)
getSignerCertificates in interface org.osgi.framework.Bundle
public Class loadClass(String name)
throws ClassNotFoundException
loadClass in interface org.osgi.framework.BundleClassNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||