org.apache.karaf.shell.dev.framework
Class Framework

java.lang.Object
  extended by org.apache.karaf.shell.dev.framework.Framework
Direct Known Subclasses:
Equinox, Felix

public abstract class Framework
extends Object

Class to represent the underlying OSGi framework


Constructor Summary
Framework(File base)
          Create a instance of this framework in the given base directory
 
Method Summary
abstract  void disableDebug(File directory)
          Disable the OSGI framework's debug logging
abstract  void enableDebug(File directory)
          Enable the OSGi framework's debug logging
 List<String> getConfig()
          Access the contents of the etc/config.properties file
abstract  String getName()
          Get the underlying OSGi framework name
protected  List<String> readPropertyFile(File config)
           
protected  void removeConfigProperty(String key)
          Remove an existing key from the etc/config.properties file
protected  void saveConfigProperties()
           
protected  void setConfigProperty(String key, String value)
          Set a new key and value in the etc/config.properties - if the given key already exists, the existing value will be overwritten
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Framework

public Framework(File base)
Create a instance of this framework in the given base directory

Parameters:
base - the base directory
Method Detail

getName

public abstract String getName()
Get the underlying OSGi framework name


enableDebug

public abstract void enableDebug(File directory)
                          throws IOException
Enable the OSGi framework's debug logging

Parameters:
directory - the directory containing the Karaf installation
Throws:
IOException - when a problem occurs configuring debug settings

disableDebug

public abstract void disableDebug(File directory)
                           throws IOException
Disable the OSGI framework's debug logging

Parameters:
directory - the Karaf base installation directory
Throws:
IOException - when a problem occurs removing debug configuration settings

saveConfigProperties

protected void saveConfigProperties()
                             throws IOException
Throws:
IOException

readPropertyFile

protected List<String> readPropertyFile(File config)
                                 throws IOException
Throws:
IOException

setConfigProperty

protected void setConfigProperty(String key,
                                 String value)
                          throws IOException
Set a new key and value in the etc/config.properties - if the given key already exists, the existing value will be overwritten

Parameters:
key - property key
value - property value
Throws:
IOException - if the etc/config.properties file can not be read

removeConfigProperty

protected void removeConfigProperty(String key)
                             throws IOException
Remove an existing key from the etc/config.properties file

Parameters:
key - the key
Throws:
IOException - if the etc/config.properties file can not be read

getConfig

public List<String> getConfig()
                       throws IOException
Access the contents of the etc/config.properties file

Returns:
the contents of the file
Throws:
IOException - if the etc/config.properties file can not be read


Copyright © 2007-2013 FuseSource, Corp.. All Rights Reserved.