org.outerj.xreporter.resource
Class ResourceManagerImpl

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.outerj.xreporter.resource.ResourceManagerImpl
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.logger.LogEnabled, ResourceManager, org.apache.avalon.framework.activity.Startable, org.apache.avalon.framework.thread.ThreadSafe

public class ResourceManagerImpl
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements ResourceManager, org.apache.avalon.framework.thread.ThreadSafe, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Startable

An implementation of ResourceManager.

This implementation will run a management thread (by default every 5 seconds) to check if any of the user resource bundles have changed.


Field Summary
protected  org.outerj.xreporter.resource.ResourceManagerImpl.ManagementThread managementThread
           
protected  int managementThreadIntervalMs
           
protected  org.apache.avalon.framework.logger.Logger missingResourceLogger
           
protected  java.util.HashMap userBundles
           
 
Fields inherited from interface org.outerj.xreporter.resource.ResourceManager
ROLE
 
Constructor Summary
ResourceManagerImpl()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
 Resources getBundle(java.lang.String baseName, java.util.Locale locale)
           
 ResourceHandle getHandle(java.util.Locale locale)
           
 Resources getUserBundle(java.lang.String name, java.util.Locale locale)
          User bundles are bundles that are maintained by the user of the application, this in contrast with built-in bundels.
 void initialize()
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

missingResourceLogger

protected org.apache.avalon.framework.logger.Logger missingResourceLogger

userBundles

protected java.util.HashMap userBundles

managementThreadIntervalMs

protected int managementThreadIntervalMs

managementThread

protected org.outerj.xreporter.resource.ResourceManagerImpl.ManagementThread managementThread
Constructor Detail

ResourceManagerImpl

public ResourceManagerImpl()
Method Detail

getHandle

public ResourceHandle getHandle(java.util.Locale locale)
Specified by:
getHandle in interface ResourceManager

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable
Throws:
java.lang.Exception

getBundle

public Resources getBundle(java.lang.String baseName,
                           java.util.Locale locale)
Specified by:
getBundle in interface ResourceManager

getUserBundle

public Resources getUserBundle(java.lang.String name,
                               java.util.Locale locale)
Description copied from interface: ResourceManager
User bundles are bundles that are maintained by the user of the application, this in contrast with built-in bundels. They are retrieved by a logical name.

Specified by:
getUserBundle in interface ResourceManager

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface org.apache.avalon.framework.activity.Startable
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Specified by:
stop in interface org.apache.avalon.framework.activity.Startable
Throws:
java.lang.Exception