Package org.ametys.core.cocoon
Class XMLResourceBundleFactory
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.i18n.XMLResourceBundleFactory
-
- org.ametys.core.cocoon.XMLResourceBundleFactory
-
- All Implemented Interfaces:
Observer
,Disposable
,Initializable
,Component
,Configurable
,LogEnabled
,Serviceable
,ThreadSafe
,BundleFactory
public class XMLResourceBundleFactory extends XMLResourceBundleFactory implements Observer, Initializable
This XMLResourceBundleFactory creates aBundle
for XML resources which can be invalidated
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cocoon.i18n.BundleFactory
BundleFactory.ConfigurationKeys
-
-
Field Summary
-
Fields inherited from class org.apache.cocoon.i18n.XMLResourceBundleFactory
cache, directory, interval, manager, resolver
-
Fields inherited from interface org.apache.cocoon.i18n.BundleFactory
ROLE
-
Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description XMLResourceBundleFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Configuration configuration)
protected XMLResourceBundle
create(String sourceURI, Locale locale, XMLResourceBundle parent)
int
getPriority(Event event)
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.void
initialize()
void
invalidateCatalogue(String location, String name, String localeName)
Invalidate cataloguevoid
observe(Event event, Map<String,Object> transientVars)
Observes an event.void
service(ServiceManager smanager)
boolean
supports(Event event)
Checks if the event is supported.-
Methods inherited from class org.apache.cocoon.i18n.XMLResourceBundleFactory
dispose, getCacheKey, getDirectory, getParentLocale, getSourceURI, release, select, select, select, select, select, selectCached, updateCache
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Constructor Detail
-
XMLResourceBundleFactory
public XMLResourceBundleFactory()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classXMLResourceBundleFactory
- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classXMLResourceBundleFactory
- Throws:
ConfigurationException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
create
protected XMLResourceBundle create(String sourceURI, Locale locale, XMLResourceBundle parent)
- Overrides:
create
in classXMLResourceBundleFactory
-
invalidateCatalogue
public void invalidateCatalogue(String location, String name, String localeName) throws ComponentException
Invalidate catalogue- Parameters:
location
- catalogue base location (URI)name
- bundle namelocaleName
- locale name- Throws:
ComponentException
- If an error occurred
-
getPriority
public int getPriority(Event event)
Description copied from interface:Observer
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.- Specified by:
getPriority
in interfaceObserver
- Parameters:
event
- the event.- Returns:
- the priority where 0 the max priority and Integer.MAX_VALUE the min priority.
-
supports
public boolean supports(Event event)
Description copied from interface:Observer
Checks if the event is supported. If true, the observe(Event) method will be called.
-
observe
public void observe(Event event, Map<String,Object> transientVars) throws Exception
Description copied from interface:Observer
Observes an event.- Specified by:
observe
in interfaceObserver
- Parameters:
event
- the event.transientVars
- transientVars passed from one Observer to another when processing a single Event. This may allow optimizations between observers.- Throws:
Exception
- if an error occurs. All exceptions will be logged but not propagated, as the observation mechanism should never fail.
-
-