|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.locale.DefaultResourceMap
public class DefaultResourceMap
A default implementation of ResourceMap.
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.acorn.locale.Localizer |
|---|
ANY_NAME |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
DefaultResourceMap()
Constructs a new map. |
|
| Method Summary | |
|---|---|
void |
clearCached()
Clears all cached entries without notifying. |
void |
clearResourceBundleNames()
Clears all resource bundle names. |
void |
expireCached(long timestamp)
Expires all cached entries notifying them about expiration. |
void |
expireFraction(long timestamp,
float fraction)
Expires the specified fraction of cached entries notifying them about expiration. |
ConcurrentMap |
getCache(boolean create)
Gets and optionally creates the cache. |
String |
getDefaultBaseName()
Gets the default base name. |
protected String |
getFallbackBaseName()
Gets the fallback base name. |
protected LookupResourceBundle |
getFallbackBundle(String key,
Locale locale)
Gets the fallback bundle for the specified key and locale. |
ObjectName |
getFallbackResourcesName()
Gets the fallback resources of this map. |
String |
getPlugInBaseName(String key)
Gets the base name of the resource bundle class associated with the specified plug-in key. |
long |
getRefreshed()
Gets the last refresh timestamp. |
LookupResourceBundle |
getResourceBundle(String baseName)
Gets a resource bundle for the specified base name. |
LookupResourceBundle |
getResourceBundle(String baseName,
Locale locale)
Gets a resource bundle for the specified base name and locale. |
String |
getResourceBundleName(String qualifier)
Gets the qualified resource bundle name. |
ObjectName |
getResourceFinderName()
Gets the resource finder of this map. |
boolean |
isCachingDisabled()
Checks whether the caching is disabled. |
void |
postmanaged()
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time. |
Set |
qualifierSet()
Returns a read-only set of resource qualifiers. |
void |
refresh()
Refreshes the MBean. |
void |
removeCache()
Removes the cache. |
void |
removeResourceBundleName(String qualifier)
Removes the resource bundle name of the qualified name. |
protected LookupResourceBundle |
resolveFallbackBundle(String name,
String key,
Locale locale)
Resolves a fallback bundle for the qualified name, key and locale. |
protected String |
resolveFallbackBundleName(String name)
Resolves a fallback bundle name for the qualified name. |
protected Object |
resolveFallbackResource(String name,
String key,
Locale locale)
Resolves a localized resource for the qualified name, key and locale. |
Object |
resolveLocalizedObject(String name,
String key)
Resolves a localized object for the qualified name and key. |
Object |
resolveLocalizedObject(String name,
String key,
Locale locale)
Resolves a localized object for the qualified name, key and locale. |
Object |
resolveLocalizedResource(String name,
String key)
Resolves a localized resource for the qualified name and key. |
Object |
resolveLocalizedResource(String name,
String key,
Locale locale)
Resolves a localized resource for the qualified name, key and locale. |
String |
resolveLocalizedString(String name,
String key)
Resolves a localized string for the qualified name and key. |
String |
resolveLocalizedString(String name,
String key,
Locale locale)
Resolves a localized string for the qualified name, key and locale. |
String[] |
resolveLocalizedStrings(String name,
String key)
Resolves a localized string array for the qualified name and key. |
String[] |
resolveLocalizedStrings(String name,
String key,
Locale locale)
Resolves a localized string array for the qualified name, key and locale. |
LookupResourceBundle |
resolveResourceBundle(String name)
Resolves a resource bundle for the qualified name. |
LookupResourceBundle |
resolveResourceBundle(String name,
Locale locale)
Resolves a resource bundle for the qualified name and locale. |
String |
resolveResourceBundleName(String name)
Resolves a resource bundle name for the qualified name. |
void |
setCachingDisabled(boolean flag)
Sets the caching disabled flag. |
void |
setDefaultBaseName(String baseName)
Sets the default base name. |
void |
setFallbackResourcesName(ObjectName fallback)
Sets the fallback resources of this map. |
void |
setResourceBundleName(String qualifier,
String baseName)
Sets the resource bundle name of the qualified name. |
void |
setResourceFinderName(ObjectName finder)
Sets the resource finder of this map. |
void |
unmanaged()
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time. |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultResourceMap()
| Method Detail |
|---|
public void postmanaged()
Manageable
postmanaged in interface Manageablepostmanaged in class Adaptee
public void unmanaged()
throws Exception
Manageable
unmanaged in interface Manageableunmanaged in class AdapteeException - if the adaptee refused to be unmanaged.public boolean isCachingDisabled()
CacheClient
isCachingDisabled in interface CacheClientpublic void setCachingDisabled(boolean flag)
CacheClient
setCachingDisabled in interface CacheClientflag - the caching disabled flag.public void expireCached(long timestamp)
CacheClient
expireCached in interface CacheClienttimestamp - the timestamp of the expiration.
public void expireFraction(long timestamp,
float fraction)
CacheClient
expireFraction in interface CacheClienttimestamp - the timestamp of the expiration.fraction - the fraction of entries to expire (0.0..1.0).public void clearCached()
CacheClient
clearCached in interface CacheClientpublic ConcurrentMap getCache(boolean create)
CacheClient
getCache in interface CacheClientcreate - true to create a missing cache.
public void removeCache()
CacheClient
removeCache in interface CacheClientpublic void refresh()
Refreshable
refresh in interface Refreshablepublic long getRefreshed()
Refreshable
getRefreshed in interface Refreshablepublic ObjectName getResourceFinderName()
ResourceMap
getResourceFinderName in interface ResourceMappublic void setResourceFinderName(ObjectName finder)
ResourceMap
setResourceFinderName in interface ResourceMapfinder - the object name of the resource finder or a query.public String getPlugInBaseName(String key)
ResourceMap
getPlugInBaseName in interface ResourceMapkey - the plug-in key.
public ObjectName getFallbackResourcesName()
ResourceMap
getFallbackResourcesName in interface ResourceMappublic void setFallbackResourcesName(ObjectName fallback)
ResourceMap
setFallbackResourcesName in interface ResourceMapfallback - the object name of the fallback resources or a query.public String getDefaultBaseName()
ResourceMap
getDefaultBaseName in interface ResourceMappublic void setDefaultBaseName(String baseName)
ResourceMap
setDefaultBaseName in interface ResourceMapbaseName - the base name of the default bundle.public String getResourceBundleName(String qualifier)
ResourceMap
getResourceBundleName in interface ResourceMapqualifier - the resource qualifier.
public void setResourceBundleName(String qualifier,
String baseName)
ResourceMap
setResourceBundleName in interface ResourceMapqualifier - the resource qualifier.baseName - the base name of the resource bundle.public void removeResourceBundleName(String qualifier)
ResourceMap
removeResourceBundleName in interface ResourceMapqualifier - the resource qualifier.public void clearResourceBundleNames()
ResourceMap
clearResourceBundleNames in interface ResourceMappublic Set qualifierSet()
ResourceMap
qualifierSet in interface ResourceMappublic LookupResourceBundle getResourceBundle(String baseName)
ResourceMap
getResourceBundle in interface ResourceMapbaseName - the base name.
public LookupResourceBundle getResourceBundle(String baseName,
Locale locale)
ResourceMap
getResourceBundle in interface ResourceMapbaseName - the base name.locale - the locale.
public String resolveResourceBundleName(String name)
ResourceMap
resolveResourceBundleName in interface ResourceMapname - the qualified name.
public LookupResourceBundle resolveResourceBundle(String name)
ResourceMap
resolveResourceBundle in interface ResourceMapname - the qualified name.
public LookupResourceBundle resolveResourceBundle(String name,
Locale locale)
ResourceMap
resolveResourceBundle in interface ResourceMapname - the qualified name.locale - the locale.
public Object resolveLocalizedResource(String name,
String key)
LocalizerIf the qualified name is a wildcard "*", the first mapped resource regardless of its package is returned.
resolveLocalizedResource in interface Localizername - the qualified name.key - the resource key.
public Object resolveLocalizedResource(String name,
String key,
Locale locale)
LocalizerIf the qualified name is a wildcard "*", the first mapped resource regardless of its package is returned.
resolveLocalizedResource in interface Localizername - the qualified name.key - the resource key.locale - the locale.
public Object resolveLocalizedObject(String name,
String key)
Localizer
resolveLocalizedObject in interface Localizername - the qualified name.key - the resource key.
public Object resolveLocalizedObject(String name,
String key,
Locale locale)
Localizer
resolveLocalizedObject in interface Localizername - the qualified name.key - the resource key.locale - the locale.
public String resolveLocalizedString(String name,
String key)
Localizer
resolveLocalizedString in interface Localizername - the qualified name.key - the resource key.
public String resolveLocalizedString(String name,
String key,
Locale locale)
Localizer
resolveLocalizedString in interface Localizername - the qualified name.key - the resource key.locale - the locale.
public String[] resolveLocalizedStrings(String name,
String key)
Localizer
resolveLocalizedStrings in interface Localizername - the qualified name.key - the resource key.
public String[] resolveLocalizedStrings(String name,
String key,
Locale locale)
Localizer
resolveLocalizedStrings in interface Localizername - the qualified name.key - the resource key.locale - the locale.
protected String getFallbackBaseName()
protected LookupResourceBundle getFallbackBundle(String key,
Locale locale)
key - the resource key.locale - the locale.
protected String resolveFallbackBundleName(String name)
name - the qualified name.
protected LookupResourceBundle resolveFallbackBundle(String name,
String key,
Locale locale)
name - the qualified name.key - the resource key.locale - the locale.
protected Object resolveFallbackResource(String name,
String key,
Locale locale)
name - the qualified name.key - the resource key.locale - the locale.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||