|
||||||||||
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.DefaultResourceFinder
public class DefaultResourceFinder
A default implementation of ResourceFinder.
Field Summary |
---|
Fields inherited from class org.norther.tammi.core.base.Adaptee |
---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
Constructor Summary | |
---|---|
DefaultResourceFinder()
Constructs a new finder. |
Method Summary | |
---|---|
void |
clearCached()
Clears all cached entries without notifying. |
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,Object> |
getCache(boolean... create)
Gets and optionally creates the cache. |
long |
getCacheCleared()
Gets the timestamp of the last cache clearing or expiration. |
String |
getDefaultBaseName()
Gets the default base name to be applied when an explicit one is not specified. |
String |
getDefaultEncoding()
Gets the encoding to use for property files. |
Locale |
getDefaultLocale()
Gets the default locale of resources. |
String |
getPlugInBaseName(String key)
Gets the base name of the resource bundle class associated with the specified plug-in key. |
String |
getPlugInKey()
Gets the default key for pluggable resource bundles of this resource finder. |
String |
getPlugInKey(Class<?> baseClass)
Gets the most specific key for pluggable resource bundles of this resource finder. |
String |
getPlugInKey(String baseName)
Gets the class specific key for pluggable resource bundles of this resource finder. |
long |
getRefreshed()
Gets the last refresh timestamp. |
LookupResourceBundle |
getResourceBundle(Locale... locale)
Gets the default resource bundle for the default base name and the specified locale. |
LookupResourceBundle |
getResourceBundle(String baseName,
ClassLoader loader,
Locale... locale)
Gets the appropriate resource bundle for the given base name, specified locale and class loader. |
LookupResourceBundle |
getResourceBundle(String baseName,
Locale... locale)
Gets the appropriate resource bundle for the given base name and specified locale. |
LookupResourceBundle |
getResourceBundle(String baseName,
String variant,
ClassLoader loader,
Locale... locale)
Gets the appropriate resource bundle for the given base name, specified locale, optional variant and class loader. |
protected LookupResourceBundle |
getResourceBundle(String baseName,
String localizedName,
ClassLoader loader,
Locale locale)
Gets the resource bundle for the given locale. |
LookupResourceBundle |
getResourceBundle(String baseName,
String variant,
Locale... locale)
Gets the appropriate resource bundle for the given base name, specified locale and optional variant. |
long |
getResourceCheckInterval()
Gets the default interval for checking validity of cached resource bundles of this resource finder. |
long |
getResourceCheckInterval(Class<?> baseClass)
Gets the most specific interval for checking validity of cached resource bundles of this resource finder. |
long |
getResourceCheckInterval(String className)
Gets the class specific interval for checking validity of cached resource bundles of this resource finder. |
String |
getResourceKey()
Gets the path finder key for resolving resource paths. |
ObjectName |
getSharedCacheName()
Gets the the shared cache of this client. |
boolean |
isCachingDisabled()
Checks whether the caching is disabled. |
void |
refresh()
Refreshes the MBean. |
void |
removeCache()
Removes the cache. |
void |
setCachingDisabled(boolean flag)
Sets the caching disabled flag. |
void |
setDefaultBaseName(String baseName)
Sets the default base name to be applied when an explicit one is not specified. |
void |
setDefaultEncoding(String encoding)
Sets the encoding to use for property files. |
void |
setDefaultLocale(Locale locale)
Sets the default locale of resources. |
void |
setPlugInKey(String key)
Sets the default key for pluggable resource bundles of this resource finder. |
void |
setPlugInKey(String baseName,
String key)
Sets the default key for pluggable resource bundles of this resource finder. |
void |
setResourceCheckInterval(long msecs)
Sets the default interval for checking validity of cached resource bundles of this resource finder. |
void |
setResourceCheckInterval(String className,
long msecs)
Sets the class specific interval of checking validity of cached resource bundles of this resource finder. |
void |
setResourceKey(String key)
Sets the path finder key for resolving resource paths. |
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, postmanaged, 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 DefaultResourceFinder()
Method Detail |
---|
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,Object>
public void setCachingDisabled(boolean flag)
CacheClient
setCachingDisabled
in interface CacheClient<String,Object>
flag
- the caching disabled flag.public void expireCached(long timestamp)
CacheClient
expireCached
in interface CacheClient<String,Object>
timestamp
- the timestamp of the expiration.public void expireFraction(long timestamp, float fraction)
CacheClient
expireFraction
in interface CacheClient<String,Object>
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,Object>
public ConcurrentMap<String,Object> getCache(boolean... create)
CacheClient
getCache
in interface CacheClient<String,Object>
create
- true to create a missing cache.
public void removeCache()
CacheClient
removeCache
in interface CacheClient<String,Object>
public ObjectName getSharedCacheName()
CacheClient
getSharedCacheName
in interface CacheClient<String,Object>
public void setSharedCacheName(ObjectName cache)
CacheClient
setSharedCacheName
in interface CacheClient<String,Object>
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 long getCacheCleared()
ResourceFinder
getCacheCleared
in interface ResourceFinder
public String getDefaultBaseName()
ResourceFinder
getDefaultBaseName
in interface ResourceFinder
public void setDefaultBaseName(String baseName)
ResourceFinder
setDefaultBaseName
in interface ResourceFinder
baseName
- the default base name.public Locale getDefaultLocale()
ResourceFinder
getDefaultLocale
in interface ResourceFinder
public void setDefaultLocale(Locale locale)
ResourceFinder
setDefaultLocale
in interface ResourceFinder
locale
- the default locale.public String getDefaultEncoding()
ResourceFinder
getDefaultEncoding
in interface ResourceFinder
public void setDefaultEncoding(String encoding)
ResourceFinder
setDefaultEncoding
in interface ResourceFinder
encoding
- the encoding for property files.public String getResourceKey()
ResourceFinder
getResourceKey
in interface ResourceFinder
public void setResourceKey(String key)
ResourceFinder
setResourceKey
in interface ResourceFinder
key
- the path finder key.public String getPlugInKey()
ResourceFinder
getPlugInKey
in interface ResourceFinder
public void setPlugInKey(String key)
ResourceFinder
setPlugInKey
in interface ResourceFinder
key
- the plug-in key.public String getPlugInKey(String baseName)
ResourceFinder
getPlugInKey
in interface ResourceFinder
baseName
- the base name of the resource bundle class.
public void setPlugInKey(String baseName, String key)
ResourceFinder
setPlugInKey
in interface ResourceFinder
baseName
- the base name of the resource bundle class.key
- the plug-in key.public String getPlugInKey(Class<?> baseClass)
ResourceFinder
getPlugInKey
in interface ResourceFinder
baseClass
- the base class of the resource bundle.
public String getPlugInBaseName(String key)
ResourceFinder
Note that if there are several base names associated with the same key, an arbitrary one of the alternatives is returned.
getPlugInBaseName
in interface ResourceFinder
key
- the plug-in key.
public long getResourceCheckInterval()
ResourceFinder
getResourceCheckInterval
in interface ResourceFinder
public void setResourceCheckInterval(long msecs)
ResourceFinder
setResourceCheckInterval
in interface ResourceFinder
msecs
- the check interval in milliseconds (-1 = only once).public long getResourceCheckInterval(String className)
ResourceFinder
getResourceCheckInterval
in interface ResourceFinder
className
- the base name of the resource bundle class.
public void setResourceCheckInterval(String className, long msecs)
ResourceFinder
setResourceCheckInterval
in interface ResourceFinder
className
- the base name of the resource bundle class.msecs
- the check interval in milliseconds (-1 = only once).public long getResourceCheckInterval(Class<?> baseClass)
ResourceFinder
getResourceCheckInterval
in interface ResourceFinder
baseClass
- the base class of the resource bundle.
public LookupResourceBundle getResourceBundle(Locale... locale)
ResourceFinder
getResourceBundle
in interface ResourceFinder
locale
- the locale to apply.
public LookupResourceBundle getResourceBundle(String baseName, Locale... locale)
ResourceFinder
getResourceBundle
in interface ResourceFinder
baseName
- the base name of the resource bundle.locale
- the locale to apply.
public LookupResourceBundle getResourceBundle(String baseName, String variant, Locale... locale)
ResourceFinder
getResourceBundle
in interface ResourceFinder
baseName
- the base name of the resource bundle.variant
- an optional variant.locale
- the locale to apply.
public LookupResourceBundle getResourceBundle(String baseName, ClassLoader loader, Locale... locale)
ResourceFinder
getResourceBundle
in interface ResourceFinder
baseName
- the base name of the resource bundle.loader
- the class loader to load the resource from.locale
- the locale to apply.
public LookupResourceBundle getResourceBundle(String baseName, String variant, ClassLoader loader, Locale... locale)
ResourceFinder
getResourceBundle
in interface ResourceFinder
baseName
- the base name of the resource bundle.variant
- an optional variant.loader
- the class loader to load the resource from.locale
- the locale to apply.
protected LookupResourceBundle getResourceBundle(String baseName, String localizedName, ClassLoader loader, Locale locale)
baseName
- the base name.localizedName
- the localized name.loader
- the class loader.locale
- the locale.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |