org.apache.struts2.osgi
Class FelixOsgiHost

java.lang.Object
  extended by org.apache.struts2.osgi.FelixOsgiHost
All Implemented Interfaces:
OsgiHost

public class FelixOsgiHost
extends Object
implements OsgiHost

Apache felix implementation of an OsgiHost See http://felix.apache.org/site/apache-felix-framework-launching-and-embedding.html
Servlet config params:

struts.osgi.clearBundleCache: Defaults to "true" delete installed bundles when the comntainer starts

struts.osgi.logLevel: Defaults to "1". Felix log level. 1 = error, 2 = warning, 3 = information, and 4 = debug

struts.osgi.runLevel: Defaults to "3". Run level to start the container.


Field Summary
 
Fields inherited from interface org.apache.struts2.osgi.OsgiHost
OSGI_BUNDLE_CONTEXT, OSGI_HEADER_STRUTS_ENABLED
 
Constructor Summary
FelixOsgiHost()
           
 
Method Summary
protected  void addAutoStartBundles(Properties configProps)
           
protected  void addExportedPackages(Properties strutsConfigProps, Properties configProps)
           
protected  void addSpringOSGiSupport()
           
 void destroy()
           
 Map<String,org.osgi.framework.Bundle> getActiveBundles()
           
 org.osgi.framework.BundleContext getBundleContext()
           
 Map<String,org.osgi.framework.Bundle> getBundles()
          This bundle map will not change, but the status of the bundles can change over time.
protected  List<String> getBundlesInDir(String dir)
           
protected  String getJarUrl(Class clazz)
           
protected  Properties getProperties(String fileName)
           
protected  Map<String,String> getRunLevelDirs(String dir)
          Return a list of directories under a directory whose name is a number
protected  String getVersion(URL url)
          Gets the version used to export the packages.
protected static String getVersionFromString(String str)
          Extracts numbers followed by "." or "-" from the string and joins them with "."
 void init(javax.servlet.ServletContext servletContext)
           
protected  void replaceSystemPackages(Properties properties)
           
protected  void startFelix()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FelixOsgiHost

public FelixOsgiHost()
Method Detail

startFelix

protected void startFelix()

addAutoStartBundles

protected void addAutoStartBundles(Properties configProps)

getRunLevelDirs

protected Map<String,String> getRunLevelDirs(String dir)
Return a list of directories under a directory whose name is a number


getBundlesInDir

protected List<String> getBundlesInDir(String dir)

addSpringOSGiSupport

protected void addSpringOSGiSupport()

getJarUrl

protected String getJarUrl(Class clazz)

replaceSystemPackages

protected void replaceSystemPackages(Properties properties)

addExportedPackages

protected void addExportedPackages(Properties strutsConfigProps,
                                   Properties configProps)

getVersion

protected String getVersion(URL url)
Gets the version used to export the packages. it tries to get it from MANIFEST.MF, or the file name


getVersionFromString

protected static String getVersionFromString(String str)
Extracts numbers followed by "." or "-" from the string and joins them with "."


getProperties

protected Properties getProperties(String fileName)

getBundles

public Map<String,org.osgi.framework.Bundle> getBundles()
This bundle map will not change, but the status of the bundles can change over time. Use getActiveBundles() for active bundles

Specified by:
getBundles in interface OsgiHost

getActiveBundles

public Map<String,org.osgi.framework.Bundle> getActiveBundles()
Specified by:
getActiveBundles in interface OsgiHost

getBundleContext

public org.osgi.framework.BundleContext getBundleContext()
Specified by:
getBundleContext in interface OsgiHost

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface OsgiHost
Throws:
Exception

init

public void init(javax.servlet.ServletContext servletContext)
Specified by:
init in interface OsgiHost


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.