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 java.lang.Object

Class to represent the underlying OSGi framework


Constructor Summary
Framework(java.io.File base)
          Create a instance of this framework in the given base directory
 
Method Summary
abstract  void disableDebug(java.io.File directory)
          Disable the OSGI framework's debug logging
abstract  void enableDebug(java.io.File directory)
          Enable the OSGi framework's debug logging
 java.util.List<java.lang.String> getConfig()
          Access the contents of the etc/config.properties file
abstract  java.lang.String getName()
          Get the underlying OSGi framework name
protected  java.util.List<java.lang.String> readPropertyFile(java.io.File config)
           
protected  void removeConfigProperty(java.lang.String key)
          Remove an existing key from the etc/config.properties file
protected  void saveConfigProperties()
           
protected  void setConfigProperty(java.lang.String key, java.lang.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(java.io.File base)
Create a instance of this framework in the given base directory

Parameters:
base - the base directory
Method Detail

getName

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


enableDebug

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

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

disableDebug

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

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

saveConfigProperties

protected void saveConfigProperties()
                             throws java.io.IOException
Throws:
java.io.IOException

readPropertyFile

protected java.util.List<java.lang.String> readPropertyFile(java.io.File config)
                                                     throws java.io.IOException
Throws:
java.io.IOException

setConfigProperty

protected void setConfigProperty(java.lang.String key,
                                 java.lang.String value)
                          throws java.io.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:
java.io.IOException - if the etc/config.properties file can not be read

removeConfigProperty

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

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

getConfig

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

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


Copyright © 2007-2011 Apache Software Foundation. All Rights Reserved.