|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 |
Constructor Summary | |
---|---|
DefaultResourceMap()
Constructs a new map. |
Method Summary | |
---|---|
void |
addResourceBundleName(String qualifier,
String baseName)
Adds a resource bundle name for the qualified name. |
void |
addResourceBundleNames(String qualifier,
String[] baseNames)
Adds resource bundle names for the qualified name. |
void |
clearCached()
Clears all cached entries without notifying. |
void |
clearResourceBundleNames()
Clears all resource bundle names. |
void |
clearResourceBundleNames(String qualifier)
Clears all resource bundle names of the qualified name. |
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<String,String> |
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. |
String[] |
getResourceBundleNames(String qualifier)
Gets the qualified resource bundle names. |
ObjectName |
getResourceFinderName()
Gets the resource finder of this map. |
ObjectName |
getSharedCacheName()
Gets the the shared cache of this client. |
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<String> |
qualifierSet()
Returns a read-only set of resource qualifiers. |
void |
refresh()
Refreshes the MBean. |
void |
removeCache()
Removes the cache. |
void |
removeResourceBundleName(String qualifier,
String baseName)
Removes a 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,
Locale... locale)
Resolves a localized object for the qualified name, key and locale. |
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,
Locale... locale)
Resolves a localized string for the qualified name, key and locale. |
String[] |
resolveLocalizedStrings(String name,
String key,
Locale... locale)
Resolves a localized string array for the qualified name, key and locale. |
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 a resource bundle name for the qualified name. |
void |
setResourceBundleNames(String qualifier,
String[] baseNames)
Sets the resource bundle names of the qualified name. |
void |
setResourceFinderName(ObjectName finder)
Sets the resource finder of this map. |
void |
setSharedCacheName(ObjectName cache)
Sets the shared cache of this client. |
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 Manageable
postmanaged
in class Adaptee
public void unmanaged() throws Exception
Manageable
unmanaged
in interface Manageable
unmanaged
in class Adaptee
Exception
- if the adaptee refused to be unmanaged.public boolean isCachingDisabled()
CacheClient
isCachingDisabled
in interface CacheClient<String,String>
public void setCachingDisabled(boolean flag)
CacheClient
setCachingDisabled
in interface CacheClient<String,String>
flag
- the caching disabled flag.public void expireCached(long timestamp)
CacheClient
expireCached
in interface CacheClient<String,String>
timestamp
- the timestamp of the expiration.public void expireFraction(long timestamp, float fraction)
CacheClient
expireFraction
in interface CacheClient<String,String>
timestamp
- the timestamp of the expiration.fraction
- the fraction of entries to expire (0.0..1.0).public void clearCached()
CacheClient
clearCached
in interface CacheClient<String,String>
public ConcurrentMap<String,String> getCache(boolean... create)
CacheClient
getCache
in interface CacheClient<String,String>
create
- true to create a missing cache.
public void removeCache()
CacheClient
removeCache
in interface CacheClient<String,String>
public ObjectName getSharedCacheName()
CacheClient
getSharedCacheName
in interface CacheClient<String,String>
public void setSharedCacheName(ObjectName cache)
CacheClient
setSharedCacheName
in interface CacheClient<String,String>
cache
- the object name of the shared cache or a query.public void refresh()
Refreshable
refresh
in interface Refreshable
public long getRefreshed()
Refreshable
getRefreshed
in interface Refreshable
public ObjectName getResourceFinderName()
ResourceMap
getResourceFinderName
in interface ResourceMap
public void setResourceFinderName(ObjectName finder)
ResourceMap
setResourceFinderName
in interface ResourceMap
finder
- the object name of the resource finder or a query.public String getPlugInBaseName(String key)
ResourceMap
getPlugInBaseName
in interface ResourceMap
key
- the plug-in key.
public ObjectName getFallbackResourcesName()
ResourceMap
getFallbackResourcesName
in interface ResourceMap
public void setFallbackResourcesName(ObjectName fallback)
ResourceMap
setFallbackResourcesName
in interface ResourceMap
fallback
- the object name of the fallback resources or a query.public String getDefaultBaseName()
ResourceMap
getDefaultBaseName
in interface ResourceMap
public void setDefaultBaseName(String baseName)
ResourceMap
setDefaultBaseName
in interface ResourceMap
baseName
- the base name of the default bundle.public String[] getResourceBundleNames(String qualifier)
ResourceMap
getResourceBundleNames
in interface ResourceMap
qualifier
- the resource qualifier.
public void setResourceBundleNames(String qualifier, String[] baseNames)
ResourceMap
setResourceBundleNames
in interface ResourceMap
qualifier
- the resource qualifier.baseNames
- the base names of the resource bundles.public void setResourceBundleName(String qualifier, String baseName)
ResourceMap
setResourceBundleName
in interface ResourceMap
qualifier
- the resource qualifier.baseName
- the base name of the resource bundle.public void addResourceBundleNames(String qualifier, String[] baseNames)
ResourceMap
addResourceBundleNames
in interface ResourceMap
qualifier
- the resource qualifier.baseNames
- the base names of the resource bundles.public void addResourceBundleName(String qualifier, String baseName)
ResourceMap
addResourceBundleName
in interface ResourceMap
qualifier
- the resource qualifier.baseName
- the base name of the resource bundle.public void removeResourceBundleName(String qualifier, String baseName)
ResourceMap
removeResourceBundleName
in interface ResourceMap
qualifier
- the resource qualifier.baseName
- the base name of the resource bundle.public void clearResourceBundleNames(String qualifier)
ResourceMap
clearResourceBundleNames
in interface ResourceMap
qualifier
- the resource qualifier.public void clearResourceBundleNames()
ResourceMap
clearResourceBundleNames
in interface ResourceMap
public Set<String> qualifierSet()
ResourceMap
qualifierSet
in interface ResourceMap
public String resolveResourceBundleName(String name)
ResourceMap
resolveResourceBundleName
in interface ResourceMap
name
- the qualified name.
public LookupResourceBundle resolveResourceBundle(String name, Locale... locale)
ResourceMap
resolveResourceBundle
in interface ResourceMap
name
- the qualified name.locale
- the locale.
public Object resolveLocalizedResource(String name, String key, Locale... locale)
Localizer
If the qualified name is a wildcard "*", the first mapped resource regardless of its package is returned.
resolveLocalizedResource
in interface Localizer
name
- the qualified name.key
- the resource key.locale
- the locale.
public Object resolveLocalizedObject(String name, String key, Locale... locale)
Localizer
resolveLocalizedObject
in interface Localizer
name
- the qualified name.key
- the resource key.locale
- the locale.
public String resolveLocalizedString(String name, String key, Locale... locale)
Localizer
resolveLocalizedString
in interface Localizer
name
- the qualified name.key
- the resource key.locale
- the locale.
public String[] resolveLocalizedStrings(String name, String key, Locale... locale)
Localizer
resolveLocalizedStrings
in interface Localizer
name
- 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 |