org.apache.struts2.osgi
Class OsgiConfigurationProvider

java.lang.Object
  extended by org.apache.struts2.osgi.OsgiConfigurationProvider
All Implemented Interfaces:
PackageProvider, java.util.EventListener, org.osgi.framework.BundleListener

public class OsgiConfigurationProvider
extends java.lang.Object
implements PackageProvider, org.osgi.framework.BundleListener

Struts package provider that starts the OSGi container and deelgates package loading


Constructor Summary
OsgiConfigurationProvider()
           
 
Method Summary
 void bundleChanged(org.osgi.framework.BundleEvent bundleEvent)
          Listens to bundle event to load/unload config
 void destroy()
           
 void init(Configuration configuration)
           
protected  void loadConfigFromBundle(org.osgi.framework.Bundle bundle)
          Loads XML config as well as Convention config from a bundle Limitation: Constants and Beans are ignored on XML config
 void loadPackages()
           
 boolean needsReload()
           
protected  void onBundleStopped(org.osgi.framework.Bundle bundle)
          This method is called when a bundle is stopped, so the config that is related to it is removed
 void setBundleAccessor(BundleAccessor acc)
           
 void setObjectFactory(ObjectFactory factory)
           
 void setServletContext(javax.servlet.ServletContext servletContext)
           
 void setVelocityManager(VelocityManager vm)
           
protected  boolean shouldProcessBundle(org.osgi.framework.Bundle bundle)
          Checks for "Struts2-Enabled" header in the bundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsgiConfigurationProvider

public OsgiConfigurationProvider()
Method Detail

init

public void init(Configuration configuration)
          throws ConfigurationException
Specified by:
init in interface PackageProvider
Throws:
ConfigurationException

loadPackages

public void loadPackages()
                  throws ConfigurationException
Specified by:
loadPackages in interface PackageProvider
Throws:
ConfigurationException

loadConfigFromBundle

protected void loadConfigFromBundle(org.osgi.framework.Bundle bundle)
Loads XML config as well as Convention config from a bundle Limitation: Constants and Beans are ignored on XML config


shouldProcessBundle

protected boolean shouldProcessBundle(org.osgi.framework.Bundle bundle)
Checks for "Struts2-Enabled" header in the bundle


needsReload

public boolean needsReload()
Specified by:
needsReload in interface PackageProvider

setObjectFactory

public void setObjectFactory(ObjectFactory factory)

setBundleAccessor

public void setBundleAccessor(BundleAccessor acc)

setVelocityManager

public void setVelocityManager(VelocityManager vm)

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)

destroy

public void destroy()

bundleChanged

public void bundleChanged(org.osgi.framework.BundleEvent bundleEvent)
Listens to bundle event to load/unload config

Specified by:
bundleChanged in interface org.osgi.framework.BundleListener

onBundleStopped

protected void onBundleStopped(org.osgi.framework.Bundle bundle)
This method is called when a bundle is stopped, so the config that is related to it is removed

Parameters:
bundle - the bundle that stopped


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