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
Fields Modifier and Type Field Description static String
CLUSTERING_NODEID_PROP
Java setting key used to configure the cluster wide unique identifier for this instance.static String
CLUSTERING_READONLY_PROP
Java setting key used to configure an instance as master or slave.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getBaseDirectory()
Get the applications basedirectorty.String
getBundleDirectory()
Get the framework bundledirectorty.String
getCacheDirectory()
Get the framework cachedirectorty.String
getClusterNodeId()
Provides the configured cluster identifier for this node.String
getEditionDirectory()
Get the framework edition bundle directory.String
getRepositoryDirectory()
Get the JCR repositorydirectorty.Object
getService(String name)
Provide an easy access to services based on service name.Object
getService(String name, String filter)
Provides easy access to services based on service name and optional filter.Object[]
getServices(String name)
Provide an easy access to services based on service name.Object[]
getServices(String name, String filter)
Provides easy access to services based on service name and optional filter.String
getWebrootDirectory()
Get the webrootdirectory.String
getWorkDirectory()
Get the applications workdirectoryboolean
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(String path)
Set the applications basedirectorty.void
setBundleDirectory(String path)
Set the framework bundledirectorty.void
setCacheDirectory(String path)
Set the applications cachedirectorty.void
setEditionDirectory(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(Map<Integer,List<String>> installMap)
Public setter provided for DI.void
setProperties(Properties properties)
Public setter provided for DI.void
setRepositoryDirectory(String path)
Set the applications JCR repositorydirectorty.void
setWebrootDirectory(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 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 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(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
String getBaseDirectory()
Get the applications basedirectorty.- Returns:
- absolute path of the basedirectory
-
getWorkDirectory
String getWorkDirectory()
Get the applications workdirectory- Returns:
- absolute path of the workdirectory
-
setBundleDirectory
void setBundleDirectory(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
String getEditionDirectory()
Get the framework edition bundle directory.- Returns:
- absolute path of the edition bundle directory
-
setEditionDirectory
void setEditionDirectory(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
String getBundleDirectory()
Get the framework bundledirectorty.- Returns:
- absolute path of the bundledirectory
-
setCacheDirectory
void setCacheDirectory(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
String getCacheDirectory()
Get the framework cachedirectorty.- Returns:
- absolute path of the cachedirectorty
-
setRepositoryDirectory
void setRepositoryDirectory(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
String getWebrootDirectory()
Get the webrootdirectory.- Returns:
- absolute path of the webrootdirectory
-
setWebrootDirectory
void setWebrootDirectory(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
String getRepositoryDirectory()
Get the JCR repositorydirectorty.- Returns:
- absolute path of the repositorydirectorty
-
setProperties
void setProperties(Properties properties)
Public setter provided for DI.- Parameters:
properties
- startupproperties provided for the concrete framework implementation.
-
setInstallMap
void setInstallMap(Map<Integer,List<String>> installMap)
Public setter provided for DI.- Parameters:
installMap
- map containing bundlenames to be installed for any startlevel.
-
getService
Object getService(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:
Exception
- when something went wrongFrameworkException
-
getService
Object getService(String name, 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 interfacefilter
- LDAP filter for serviceregistration- Returns:
- an instance of the service (if available)
- Throws:
Exception
- when something went wrongFrameworkException
-
getServices
Object[] getServices(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:
Exception
- when something went wrongFrameworkException
-
getServices
Object[] getServices(String name, 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 interfacefilter
- LDAP filter for serviceregistration- Returns:
- available service instances
- Throws:
Exception
- when something went wrongFrameworkException
-
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
String getClusterNodeId()
Provides the configured cluster identifier for this node.- Returns:
- the string identifier for this node.
-
-