nl.gx.webmanager.services.framework.spi
Interface Framework

All Known Implementing Classes:
FrameworkBase, SpringFrameworkBase

public interface Framework

FrameWork may be used to access the serviceframework from the outside (eg servlet / spring bean) independent of OSGi framework implementation. FIXME: is the a servicecontainer or a frameworkconfig... maybe split it up?

Author:
bramk

Field Summary
static java.lang.String CLUSTERING_NODEID_PROP
          Java setting key used to configure the cluster wide unique identifier for this instance.
static java.lang.String CLUSTERING_READONLY_PROP
          Java setting key used to configure an instance as master or slave.
 
Method Summary
 java.lang.String getBaseDirectory()
          Get the applications basedirectorty.
 java.lang.String getBundleDirectory()
          Get the framework bundledirectorty.
 java.lang.String getCacheDirectory()
          Get the framework cachedirectorty.
 java.lang.String getClusterNodeId()
          Provides the configured cluster identifier for this node.
 java.lang.String getEditionDirectory()
          Get the framework edition bundle directory.
 java.lang.String getRepositoryDirectory()
          Get the JCR repositorydirectorty.
 java.lang.Object getService(java.lang.String name)
          Provide an easy access to services based on service name.
 java.lang.Object getService(java.lang.String name, java.lang.String filter)
          Provides easy access to services based on service name and optional filter.
 java.lang.Object[] getServices(java.lang.String name)
          Provide an easy access to services based on service name.
 java.lang.Object[] getServices(java.lang.String name, java.lang.String filter)
          Provides easy access to services based on service name and optional filter.
 java.lang.String getWebrootDirectory()
          Get the webrootdirectory.
 boolean isAvailable()
          Check whether the OSGi impl is running and available.
 boolean isClusterMasterNode()
          Indicates if this instance is a master node.
 boolean isStarting()
          Check whether the framework is starting up.
 void setBaseDirectory(java.lang.String path)
          Set the applications basedirectorty.
 void setBundleDirectory(java.lang.String path)
          Set the framework bundledirectorty.
 void setCacheDirectory(java.lang.String path)
          Set the applications cachedirectorty.
 void setEditionDirectory(java.lang.String path)
          Set the framework edition bundle directory.
 void setFrameworkStartLevel(int startLevel, boolean blocking)
          Changes the active start level of the OSGi framework.
 void setInstallMap(java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> installMap)
          Public setter provided for DI.
 void setProperties(java.util.Properties properties)
          Public setter provided for DI.
 void setRepositoryDirectory(java.lang.String path)
          Set the applications JCR repositorydirectorty.
 void setWebrootDirectory(java.lang.String path)
          Set the applications webrootdirectory.
 void start()
          Start the OSGi impl.
 void stop()
          Stop the OSGi impl.
 

Field Detail

CLUSTERING_READONLY_PROP

static final java.lang.String CLUSTERING_READONLY_PROP
Java setting key used to configure an instance as master or slave.

See Also:
Constant Field Values

CLUSTERING_NODEID_PROP

static final java.lang.String CLUSTERING_NODEID_PROP
Java setting key used to configure the cluster wide unique identifier for this instance.

See Also:
Constant Field Values
Method Detail

start

void start()
           throws FrameworkException
Start the OSGi impl. Must be called at init.

Throws:
FrameworkException - when start fails

stop

void stop()
          throws FrameworkException
Stop the OSGi impl. Should be called at shutdown.

Throws:
FrameworkException - when shutdown fails

isStarting

boolean isStarting()
Check whether the framework is starting up.

Returns:
True if the OSGi impl is busy starting up.

isAvailable

boolean isAvailable()
Check whether the OSGi impl is running and available.

Returns:
True if the OSGi impl is up and running. If isStarting() is false and this returns false, then the framework is unavailable (error).

setBaseDirectory

void setBaseDirectory(java.lang.String path)
                      throws ConfigurationException
Set the applications basedirectorty. Public setter provided for DI.

Parameters:
path - absolute path to the basedirectory on the filesystem.
Throws:
ConfigurationException - when the directory is not accessible

getBaseDirectory

java.lang.String getBaseDirectory()
Get the applications basedirectorty.

Returns:
absolute path of the basedirectory

setBundleDirectory

void setBundleDirectory(java.lang.String path)
                        throws ConfigurationException
Set the framework bundledirectorty. Public setter provided for DI.

Parameters:
path - absolute path to the bundledirectory on the filesystem.
Throws:
ConfigurationException - when the directory is not accessible

getEditionDirectory

java.lang.String getEditionDirectory()
Get the framework edition bundle directory.

Returns:
absolute path of the edition bundle directory

setEditionDirectory

void setEditionDirectory(java.lang.String path)
                         throws ConfigurationException
Set the framework edition bundle directory. Public setter provided for DI.

Parameters:
path - absolute path to the edition bundle on the filesystem.
Throws:
ConfigurationException - when the directory is not accessible

getBundleDirectory

java.lang.String getBundleDirectory()
Get the framework bundledirectorty.

Returns:
absolute path of the bundledirectory

setCacheDirectory

void setCacheDirectory(java.lang.String path)
                       throws ConfigurationException
Set the applications cachedirectorty. Public setter provided for DI.

Parameters:
path - absolute path to the cachedirectory on the filesystem.
Throws:
ConfigurationException - when the directory is not accessible

getCacheDirectory

java.lang.String getCacheDirectory()
Get the framework cachedirectorty.

Returns:
absolute path of the cachedirectorty

setRepositoryDirectory

void setRepositoryDirectory(java.lang.String path)
                            throws ConfigurationException
Set the applications JCR repositorydirectorty. Public setter provided for DI.

Parameters:
path - absolute path to the repositorydirectorty on the filesystem.
Throws:
ConfigurationException - when the directory is not accessible

getWebrootDirectory

java.lang.String getWebrootDirectory()
Get the webrootdirectory.

Returns:
absolute path of the webrootdirectory

setWebrootDirectory

void setWebrootDirectory(java.lang.String path)
                         throws ConfigurationException
Set the applications webrootdirectory. Public setter provided for DI.

Parameters:
path - absolute path to the webrootdirectory on the filesystem.
Throws:
ConfigurationException - when the directory is not accessible

getRepositoryDirectory

java.lang.String getRepositoryDirectory()
Get the JCR repositorydirectorty.

Returns:
absolute path of the repositorydirectorty

setProperties

void setProperties(java.util.Properties properties)
Public setter provided for DI.

Parameters:
properties - startupproperties provided for the concrete framework implementation.

setInstallMap

void setInstallMap(java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> installMap)
Public setter provided for DI.

Parameters:
installMap - map containing bundlenames to be installed for any startlevel.

getService

java.lang.Object getService(java.lang.String name)
                            throws FrameworkException
Provide an easy access to services based on service name.

Parameters:
name - fully qualified name of the requested service interface.
Returns:
an instance of the service (if available)
Throws:
java.lang.Exception - when something went wrong
FrameworkException

getService

java.lang.Object getService(java.lang.String name,
                            java.lang.String filter)
                            throws FrameworkException
Provides easy access to services based on service name and optional filter.

Parameters:
name - fully qualified name of the requested service interface
filter - LDAP filter for serviceregistration
Returns:
an instance of the service (if available)
Throws:
java.lang.Exception - when something went wrong
FrameworkException

getServices

java.lang.Object[] getServices(java.lang.String name)
                               throws FrameworkException
Provide an easy access to services based on service name.

Parameters:
name - fully qualified name of the requested service interface.
Returns:
available service instances
Throws:
java.lang.Exception - when something went wrong
FrameworkException

getServices

java.lang.Object[] getServices(java.lang.String name,
                               java.lang.String filter)
                               throws FrameworkException
Provides easy access to services based on service name and optional filter.

Parameters:
name - fully qualified name of the requested service interface
filter - LDAP filter for serviceregistration
Returns:
available service instances
Throws:
java.lang.Exception - when something went wrong
FrameworkException

setFrameworkStartLevel

void setFrameworkStartLevel(int startLevel,
                            boolean blocking)
Changes the active start level of the OSGi framework.

Parameters:
startLevel - the start level to set the framwork start level to.
blocking - if true, wait for the framework to reach the new startlevel.

isClusterMasterNode

boolean isClusterMasterNode()
Indicates if this instance is a master node.

Returns:
true if this is a master node, else false.

getClusterNodeId

java.lang.String getClusterNodeId()
Provides the configured cluster identifier for this node.

Returns:
the string identifier for this node.


Copyright © 2007-2011 GX Software BV. All Rights Reserved.