Package com.germinus.easyconf
Class EasyConf
java.lang.Object
com.germinus.easyconf.EasyConf
Main class to obtain the configuration of a software component.
The main method is
getConfiguration
which must be
given the name of a component.- Author:
- jferrer@germinus.com
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentConfiguration
getConfiguration
(String componentName) Get the full configuration of the given component.static ComponentConfiguration
getConfiguration
(String companyId, String componentName) Get the full configuration of the given component, for the given company.static void
Refresh the configuration of all components KNOWN BUG: this method does not refresh the properties configuration because the underlying library Jakarta Commons Configuration also contains a cache which is not refreshable.static void
refreshComponent
(String componentName) Refresh the configuration of the given component KNOWN BUG: this method does not refresh the properties configuration because the underlying library Jakarta Commons Configuration also contains a cache which is not refreshable.
-
Field Details
-
log
private static final Log log -
cache
-
-
Constructor Details
-
EasyConf
private EasyConf()
-
-
Method Details
-
getConfiguration
Get the full configuration of the given component. The configuration will be cached so that next calls will not need to reload the properties or XML files again.- Parameters:
componentName
- any String which can be used to identified a configuration component.- Returns:
- a
ComponentConf
instance
-
getConfiguration
Get the full configuration of the given component, for the given company. This method should be used when the application is to be deployed in an ASP model where several companies want different configurations for the same running applications The configuration will be cached so that next calls will not need to reload the properties or XML files again.- Parameters:
companyId
- the identifier of the company whose specific configuration should be readcomponentName
- any String which can be used to identified a configuration component.- Returns:
- a
ComponentConf
instance
-
refreshComponent
Refresh the configuration of the given component KNOWN BUG: this method does not refresh the properties configuration because the underlying library Jakarta Commons Configuration also contains a cache which is not refreshable. This issue is scheduled to be solved after version 1.0 of such library. -
refreshAll
public static void refreshAll()Refresh the configuration of all components KNOWN BUG: this method does not refresh the properties configuration because the underlying library Jakarta Commons Configuration also contains a cache which is not refreshable. This issue is scheduled to be solved after version 1.0 of such library.
-