|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.cocoon.util.AbstractLogEnabled
org.apache.cocoon.i18n.XMLResourceBundleFactory
This is the XMLResourceBundleFactory, the method for getting and creating XMLResourceBundles.
| Nested Class Summary |
| Nested classes inherited from class 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.cocoon.util.AbstractLogEnabled |
getLogger, setLogger |
| 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 ServiceableServiceException
public void configure(Configuration configuration)
throws ConfigurationException
configure in interface Configurableconfiguration - the configuration
ConfigurationExceptionpublic void dispose()
dispose in interface Disposableprotected String getDirectory()
public Bundle select(String name,
String locale)
throws Exception
select in interface BundleFactoryname - bundle namelocale - locale name
Exception - if a bundle is not found
public Bundle select(String name,
Locale locale)
throws Exception
select in interface BundleFactoryname - bundle namelocale - locale
Exception - if a bundle is not found
public Bundle select(String directory,
String name,
String localeName)
throws Exception
select in interface BundleFactorydirectory - catalogue base location (URI)name - bundle namelocaleName - locale name
Exception - if a bundle is not found
public Bundle select(String directory,
String name,
Locale locale)
throws Exception
select in interface BundleFactorydirectory - catalogue base location (URI)name - bundle namelocale - locale
Exception - if a bundle is not found
public Bundle select(String[] directories,
String name,
Locale locale)
throws Exception
select in interface BundleFactorydirectories - catalogue base location (URI)name - bundle namelocale - locale
Exception - if a bundle is not foundpublic void release(Bundle bundle)
BundleFactory
release in interface BundleFactorybundle - the bundleprotected Locale getParentLocale(Locale locale)
locale - the locale
protected String getCacheKey(String[] directories,
int index,
String name,
Locale locale)
throws SourceException
SourceException
protected String getSourceURI(String base,
String name,
Locale locale)
throws SourceException
base - the base URI for the cataloguesname - the name of the cataloguelocale - the locale of the bundle
SourceExceptionprotected 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 | ||||||||||