|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knopflerfish.framework.Framework
public class Framework
This class contains references to all common data structures inside the framework.
Field Summary | |
---|---|
Bundles |
bundles
All bundle in this framework. |
static boolean |
isDoubleCheckedLockingSafe
Is it safe to use double-checked locking or not. |
static int |
javaVersionMajor
|
static int |
javaVersionMicro
|
static int |
javaVersionMinor
|
protected static java.util.Map |
props
The "System" properties for this framework instance. |
static boolean |
UNREGISTERSERVICE_VALID_DURING_UNREGISTERING
|
Constructor Summary | |
---|---|
Framework(java.lang.Object m)
Contruct a framework. |
Method Summary | |
---|---|
long |
getBundleId(java.lang.String location)
Retrieve bundle id of the bundle that has the given unique location. |
java.lang.String |
getBundleLocation(long id)
Retrieve location of the bundle that has the given unique identifier. |
FileTree |
getDataStorage(long id)
Get private bundle data storage file handle. |
static java.util.Dictionary |
getProperties()
|
static java.lang.String |
getProperty(java.lang.String key)
Retrieve the value of the named framework property. |
static boolean |
getProperty(java.lang.String key,
boolean def)
Retrieve the boolean value of the named framework property, with a default value. |
static java.lang.String |
getProperty(java.lang.String key,
java.lang.String def)
Retrieve the value of the named framework property, with a default value. |
BundleContext |
getSystemBundleContext()
Get the bundle context used by the system bundle. |
static java.util.Properties |
getSystemProperties()
Get a copy of the current system properties. |
protected static void |
initProperties()
|
long |
installBundle(java.lang.String location,
java.io.InputStream in)
Install a bundle from the given location. |
void |
launch(long startBundle)
Start this Framework. |
static void |
setProperties(java.util.Dictionary newProps)
|
static void |
setProperty(java.lang.String key,
java.lang.String val)
|
void |
shutdown()
Stop this Framework, suspending all started contexts. |
void |
startBundle(long id)
Start a bundle. |
void |
stopBundle(long id)
Stop a bundle. |
void |
uninstallBundle(long id)
Uninstall a bundle. |
void |
updateBundle(long id)
Update a bundle. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.util.Map props
public Bundles bundles
public static final boolean UNREGISTERSERVICE_VALID_DURING_UNREGISTERING
public static int javaVersionMajor
public static int javaVersionMinor
public static int javaVersionMicro
public static final boolean isDoubleCheckedLockingSafe
Constructor Detail |
---|
public Framework(java.lang.Object m) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public void launch(long startBundle) throws BundleException
If the Framework is already started, this method does nothing. If the Framework is not started, this method will:
Bundle.start()
method.
Reports any exceptions that occur during startup using
FrameworkErrorEvents
.FrameworkEvent
through the
FrameworkListener.frameworkStarted
method.If this Framework is not launched, it can still install, uninstall, start and stop bundles. (It does these tasks without broadcasting events, however.) Using Framework without launching it allows for off-line debugging of the Framework.
startBundle
- If it is specified with a value larger than 0,
then the bundle with that id is started.
Otherwise start all suspended bundles.
BundleException
public void shutdown()
If the framework is not started, this method does nothing. If the framework is started, this method will:
Bundle.stop()
method except that the persistent
state of the bundle will continue to be started.
Reports any exceptions that occur during stopping using
FrameworkErrorEvents
.
public long installBundle(java.lang.String location, java.io.InputStream in) throws BundleException
location
- The location identifier of the bundle to install.in
- The InputStream from which the bundle will be read.
BundleException
- If the install failed.public void startBundle(long id) throws BundleException
id
- Id of bundle to start.
BundleException
- If start failed.public void stopBundle(long id) throws BundleException
id
- Id of bundle to stop.
BundleException
- If stop failed.public void uninstallBundle(long id) throws BundleException
id
- Id of bundle to stop.
BundleException
- If uninstall failed.public void updateBundle(long id) throws BundleException
id
- Id of bundle to update.
BundleException
- If update failed.public java.lang.String getBundleLocation(long id)
id
- The identifier of the bundle to retrieve.
null
if the identifier doesn't match any installed bundle.public long getBundleId(java.lang.String location)
location
- The location of the bundle to retrieve.
-1
if the location doesn't match any installed bundle.public FileTree getDataStorage(long id)
public static java.lang.String getProperty(java.lang.String key)
public static java.lang.String getProperty(java.lang.String key, java.lang.String def)
public static boolean getProperty(java.lang.String key, boolean def)
public static void setProperty(java.lang.String key, java.lang.String val)
public static void setProperties(java.util.Dictionary newProps)
public static java.util.Dictionary getProperties()
public static java.util.Properties getSystemProperties()
protected static void initProperties()
public BundleContext getSystemBundleContext()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |