|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunbbayes.util.ResourceController
public class ResourceController
This class is used to facilite the use of the diverses files of resources of the project. It contains methods to get this resources. Altered this class in order to use singleton pattern and make it possible to change the classloader/locales dinamically (e.g. plugins). If any classloader modification is needed, you may extend/implement a new ClassLoader and set it as this class' default classloader (as a example, you may implement a network classloader and set it as this singleton instance's default classloader). The plugin support is implemented by setting the default classloader as the plugin classloader.
Field Summary | |
---|---|
static ResourceBundle |
RS_GUI
Call to ResourceController.newInstance().getBundle(GuiResources.class.getName()) |
Constructor Summary | |
---|---|
protected |
ResourceController()
Default constructor is made protected just to make it easy to extend. |
Method Summary | |
---|---|
ResourceBundle |
getBundle(String baseName)
Obtains a ResourceBundle using current configuration of locale and classloader. |
ResourceBundle |
getBundle(String baseName,
Locale locale,
ClassLoader classLoader)
Delegator to ResourceBundle.getBundle(baseName, locale, classLoader) |
ClassLoader |
getDefaultClassLoader()
The default class loader to be used in order to load the resources. |
Locale |
getDefaultLocale()
This is the locale to be used in order to load the resource file. |
String |
getExtensionPointID()
ID of the extension point, used by plugin loader to load Resources plugins. |
UnBBayesPluginContextHolder |
getUnBBayesPluginContextHolder()
|
protected ClassLoader |
loadPluginClassLoader()
Obtains a ClassLoader which loads classes bound by plugins. |
static ResourceController |
newInstance()
|
void |
setDefaultClassLoader(ClassLoader defaultClassLoader)
The default class loader to be used in order to load the resources. |
void |
setDefaultLocale(Locale defaultLocale)
This is the locale to be used in order to load the resource file. |
void |
setExtensionPointID(String extensionPointID)
ID of the extension point, used by plugin loader to load Resources plugins. |
void |
setUnBBayesPluginContextHolder(UnBBayesPluginContextHolder unbbayesPluginContextHolder)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static ResourceBundle RS_GUI
Constructor Detail |
---|
protected ResourceController()
UnBBayesPluginContextHolder
in order
to obtain the plugin classloader and sets it as the default classloader
using #loadPluginClassLoader()
Method Detail |
---|
protected ClassLoader loadPluginClassLoader()
public static ResourceController newInstance()
public ClassLoader getDefaultClassLoader()
public void setDefaultClassLoader(ClassLoader defaultClassLoader)
defaultClassLoader
- the defaultClassLoader to setpublic Locale getDefaultLocale()
public void setDefaultLocale(Locale defaultLocale)
defaultLocale
- the defaultLocale to setpublic ResourceBundle getBundle(String baseName)
baseName
- : base name of the class to be loaded.
public ResourceBundle getBundle(String baseName, Locale locale, ClassLoader classLoader)
baseName
- locale
- classLoader
-
public String getExtensionPointID()
public void setExtensionPointID(String extensionPointID)
extensionPointID
- the extensionPointID to setpublic UnBBayesPluginContextHolder getUnBBayesPluginContextHolder()
public void setUnBBayesPluginContextHolder(UnBBayesPluginContextHolder unbbayesPluginContextHolder)
unbbayesPluginContextHolder
- the unbbayesPluginContextHolder to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |