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 aBundlefor 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 Modifier and Type Field Description private ObservationManager_observationManager-
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 voidconfigure(Configuration configuration)protected XMLResourceBundlecreate(String sourceURI, Locale locale, XMLResourceBundle parent)intgetPriority(Event event)Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.voidinitialize()voidinvalidateCatalogue(String location, String name, String localeName)Invalidate cataloguevoidobserve(Event event, Map<String,Object> transientVars)Observes an event.voidservice(ServiceManager smanager)booleansupports(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
-
-
-
-
Field Detail
-
_observationManager
private ObservationManager _observationManager
-
-
Constructor Detail
-
XMLResourceBundleFactory
public XMLResourceBundleFactory()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classXMLResourceBundleFactory- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classXMLResourceBundleFactory- Throws:
ConfigurationException
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
create
protected XMLResourceBundle create(String sourceURI, Locale locale, XMLResourceBundle parent)
- Overrides:
createin 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:ObserverRetrieves the priority to observe this event.
This can be used to process a supported event before others observers.- Specified by:
getPriorityin 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:ObserverChecks 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:ObserverObserves an event.- Specified by:
observein 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.
-
-