com.esf.core.system.bootstrap.service
Interface IBootstrapService


public interface IBootstrapService

A service for managing ESF bootstrapping. Configuration will be accepted in the form of an XML file. The XML file to be used is by default in ESF_HOME/configuration/.esf/com.esf.core.system.bootstap/services.xml. The form of the XML file is as follows: org.apache.felix.webconsole-1.0.0.jar LOG_LEVEL_WARNING com.esf.util.algorithm.crc LOG_LEVEL_WARNING This is essentially an extension to Equinox's standard config.ini file. At this point you can set the ESF log level with this mechanism. However, this may be extended in the future to provide additional controls on the ESF start up system. Copyright (c) 2009 Eurotech Inc. All rights reserved.


Field Summary
static java.lang.String SERVICE_NAME
          Reports the class name representing this interface.
 
Method Summary
 void addBundle(java.lang.String bundleName, int logLevel)
          adds a bundle to the bootstrap service.xml file.
 void findAndLoadBundle(java.lang.String bundleName, java.lang.String logLevel)
          finds and loads a specific bundle from the default bundlefiles directory.
 void findAndLoadBundle(java.lang.String bundleName, java.lang.String bundleDirectoryName, java.lang.String logLevel)
          finds and loads a specific bundle from the specified directory.
 java.lang.String[] getFailedToLoadBundles()
          returns a list of unsuccessfully loaded bundles that the @IBootstrapService attempted to load
 java.lang.String[] getLoadedBundles()
          returns a list of successfully loaded bundles that were loaded using the @IBootstrapService
 java.lang.String[] getLoadedDropinBundles()
          returns a list of successfully loaded 'dropin' bundles that were loaded using the @IBootstrapService
 java.lang.String[] getLoadedJunitBundles()
          returns a list of successfully loaded 'junit' bundles that were loaded using the @IBootstrapService
 java.lang.String getLogLevel(java.lang.String bundleSymbolicName)
          gets the log level as set in the services.xml file
 void startBundle(java.lang.String directory, java.lang.String bundleName)
          starts a bundle that has been previously loaded via the Bootstrap service
 void stopBundle(java.lang.String bundleSymbolicName)
          stops a bundle that has been previously started via the Bootstrap service
 void unloadBundle(java.lang.String bundleSymbolicName)
          unloads (uninstalls) a bundle that has been previously installed to the framework.
 

Field Detail

SERVICE_NAME

static final java.lang.String SERVICE_NAME
Reports the class name representing this interface.

Method Detail

getLoadedBundles

java.lang.String[] getLoadedBundles()
returns a list of successfully loaded bundles that were loaded using the @IBootstrapService

Returns:
an array of @String representing the bundle names that were loaded at ESF startup

getLoadedDropinBundles

java.lang.String[] getLoadedDropinBundles()
returns a list of successfully loaded 'dropin' bundles that were loaded using the @IBootstrapService

Returns:
an array of @String representing the bundle names that were loaded at ESF startup from the ESF dropins directory

getLoadedJunitBundles

java.lang.String[] getLoadedJunitBundles()
returns a list of successfully loaded 'junit' bundles that were loaded using the @IBootstrapService

Returns:
an array of @String representing the bundle names that were loaded at ESF startup from the ESF junit directory

getFailedToLoadBundles

java.lang.String[] getFailedToLoadBundles()
returns a list of unsuccessfully loaded bundles that the @IBootstrapService attempted to load

Returns:
an array of @String representing the bundle names that failed to load even though they were defined in the services.xml file to be loaded

getLogLevel

java.lang.String getLogLevel(java.lang.String bundleSymbolicName)
gets the log level as set in the services.xml file

Parameters:
bundleSymbolicName - the symbolic name of the bundle to get the log level of
Returns:
a @String representing the log level currently defined

findAndLoadBundle

void findAndLoadBundle(java.lang.String bundleName,
                       java.lang.String logLevel)
finds and loads a specific bundle from the default bundlefiles directory. This is useful for dynamic agents that control items such as usb modems that may be removed or inserted and runtime. All bundles loaded via this method are started.

Parameters:
bundleName - the symbolic name of the bundle to find and load
logLevel - the ESF log level to use

findAndLoadBundle

void findAndLoadBundle(java.lang.String bundleName,
                       java.lang.String bundleDirectoryName,
                       java.lang.String logLevel)
finds and loads a specific bundle from the specified directory. This is useful for dynamic agents that control items such as usb modems that may be removed or inserted and runtime.

Parameters:
bundleName - the symbolic name of the bundle to find and load
bundleDirectoryName - the name of the directory where the bundle resides
logLevel - the ESF log level to use

startBundle

void startBundle(java.lang.String directory,
                 java.lang.String bundleName)
starts a bundle that has been previously loaded via the Bootstrap service

Parameters:
directory - the directory where the bundle is located
bundleName - the name of the bundle

stopBundle

void stopBundle(java.lang.String bundleSymbolicName)
stops a bundle that has been previously started via the Bootstrap service

Parameters:
bundleSymbolicName - the symbolic name of the bundle to start

unloadBundle

void unloadBundle(java.lang.String bundleSymbolicName)
unloads (uninstalls) a bundle that has been previously installed to the framework. If is is running it is stopped before being uninstalled.

Parameters:
bundleSymbolicName - the symbolic name of the bundle to uninstall

addBundle

void addBundle(java.lang.String bundleName,
               int logLevel)
adds a bundle to the bootstrap service.xml file.

Parameters:
bundleName - the name of the bundle to add
logLevel - the ESF log level to use