|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.i18n.XMLResourceBundleFactory
public class XMLResourceBundleFactory
This is the XMLResourceBundleFactory, the method for getting and creating XMLResourceBundles.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.cocoon.i18n.BundleFactory |
---|
BundleFactory.ConfigurationKeys |
Field Summary | |
---|---|
protected Store |
cache
Store of the loaded bundles |
protected ServiceManager |
manager
Service Manager |
protected SourceResolver |
resolver
Source resolver |
Fields inherited from interface org.apache.cocoon.i18n.BundleFactory |
---|
ROLE |
Constructor Summary | |
---|---|
XMLResourceBundleFactory()
|
Method Summary | |
---|---|
void |
configure(Configuration configuration)
Configure the component. |
void |
dispose()
Disposes this component. |
protected String |
getCacheKey(String[] directories,
int index,
String name,
Locale locale)
Creates a cache key for the bundle. |
protected String |
getDirectory()
Returns the root directory to all bundles. |
protected Locale |
getParentLocale(Locale locale)
Returns the next locale up the parent hierarchy. |
protected String |
getSourceURI(String base,
String name,
Locale locale)
Maps a bundle name and locale to a bundle source URI. |
void |
release(Bundle bundle)
Releases a bundle back to the bundle factory when it's not needed anymore. |
Bundle |
select(String[] directories,
String name,
Locale locale)
Select a bundle based on the catalogue base location, bundle name, and the locale. |
Bundle |
select(String name,
Locale locale)
Select a bundle based on the bundle name and the locale. |
Bundle |
select(String name,
String locale)
Select a bundle based on the bundle name and the locale name. |
Bundle |
select(String directory,
String name,
Locale locale)
Select a bundle based on the catalogue base location, bundle name, and the locale. |
Bundle |
select(String directory,
String name,
String localeName)
Select a bundle based on the catalogue base location, bundle name, and the locale name. |
protected XMLResourceBundle |
selectCached(String cacheKey)
Selects a bundle from the cache, and reloads it if needed. |
void |
service(ServiceManager manager)
|
protected void |
updateCache(String cacheKey,
XMLResourceBundle bundle)
Stores bundle in the cache. |
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 |
---|
protected ServiceManager manager
protected SourceResolver resolver
protected Store cache
Constructor Detail |
---|
public XMLResourceBundleFactory()
Method Detail |
---|
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
configuration
- the configuration
ConfigurationException
public void dispose()
dispose
in interface Disposable
protected String getDirectory()
public Bundle select(String name, String locale) throws ComponentException
select
in interface BundleFactory
name
- bundle namelocale
- locale name
ComponentException
- if a bundle is not foundpublic Bundle select(String name, Locale locale) throws ComponentException
select
in interface BundleFactory
name
- bundle namelocale
- locale
ComponentException
- if a bundle is not foundpublic Bundle select(String directory, String name, String localeName) throws ComponentException
select
in interface BundleFactory
directory
- catalogue base location (URI)name
- bundle namelocaleName
- locale name
ComponentException
- if a bundle is not foundpublic Bundle select(String directory, String name, Locale locale) throws ComponentException
select
in interface BundleFactory
directory
- catalogue base location (URI)name
- bundle namelocale
- locale
ComponentException
- if a bundle is not foundpublic Bundle select(String[] directories, String name, Locale locale) throws ComponentException
select
in interface BundleFactory
directories
- catalogue base location (URI)name
- bundle namelocale
- locale
ComponentException
- if a bundle is not foundpublic void release(Bundle bundle)
BundleFactory
release
in interface BundleFactory
bundle
- the bundleprotected Locale getParentLocale(Locale locale)
locale
- the locale
protected String getCacheKey(String[] directories, int index, String name, Locale locale) throws ComponentException
ComponentException
protected String getSourceURI(String base, String name, Locale locale) throws ComponentException
base
- the base URI for the cataloguesname
- the name of the cataloguelocale
- the locale of the bundle
ComponentException
protected XMLResourceBundle selectCached(String cacheKey)
cacheKey
- caching key of the bundle
protected void updateCache(String cacheKey, XMLResourceBundle bundle)
cacheKey
- caching key of the bundlebundle
- bundle to be placed in the cache
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |