java.lang.Object | ||
↳ | java.util.Observable | |
↳ | com.microstrategy.utils.Customizations |
This class is responsible for searching Customizations in MicroStrategy Web. This
class is a singleton. Therefore, all classes in the application use the same instance.
This class searches for customizations in the application's root folder, based on two parameters:
Comparator
used to sort the customization folders. This comparator
can indicate the exact order in which the customizations should be applied to avoid
conflicts among them. If no Comparator
is specified, customizations will be
applied in alphabetical order.Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | CUSTOMIZATION_PROPERTIES_FILE | Represents the name of the properties file used to configure this class. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String |
getBaseFolder()
Represents the base folder (relative to the application's root folder)
this class searches for customization folders.
| ||||||||||
ClassLoader |
getClassLoader()
Returns a
ClassLoader capable of loading classes/resources from
all customization folders. | ||||||||||
Comparator |
getComparator()
Represents the Java class used to compare the current
CustomizationInfo instances
to sort them. | ||||||||||
Logger |
getConflictsLogger()
Returns the Logger instance used to log conflicts.
| ||||||||||
CustomizationInfo |
getCustomization(String name)
Returns the CustomizationInfo with the given name;
| ||||||||||
CustomizationInfo[] |
getCustomizations()
Returns a list of
CustomizationInfo classes. | ||||||||||
String |
getFolderPrefix()
Represents the prefix that identifies a folder as a customization folder.
| ||||||||||
static Customizations |
getInstance()
The method to return the singleton instance of this class.
| ||||||||||
String |
getRealPath(String relativePath)
Returns the full absolute path within the file sytem for a given relative path.
| ||||||||||
boolean |
hasCustomization(String name)
Returns the CustomizationInfo with the given name;
| ||||||||||
static void |
logConflict(Level level, String className, String methodName, String message, CustomizationInfo c1, CustomizationInfo c2)
Logs a conflict message into the log using the conflicts logger.
| ||||||||||
CustomizationInfo |
newCustomization(String name)
Returns a list of
CustomizationInfo classes. | ||||||||||
synchronized void |
reload()
This method triggers the class to check for changes in the base folder for new customizations.
| ||||||||||
void |
setBaseFolder(String value)
Represents the base folder (relative to the application's root folder)
this class searches for customization folders.
| ||||||||||
void |
setComparator(Comparator comparator)
Sets the
Comparator used to compare two CustomizationInfo instances to sort them. | ||||||||||
void |
setFolderPrefix(String value)
Represents the prefix that identifies a folder as a customization folder.
| ||||||||||
void |
update(Observable o, Object arg)
This class observes the FileLoader, whenever the FileLoader instances changes this
class wants to be notified so it can remove its internal caches.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String[] |
getCustomFolders()
Returns a list of customization folders based on the base folder and the folder prefix.
| ||||||||||
static void |
loadProperties(String propertiesFile)
Loads and initializes this class based on the Properties file (if found).
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Represents the name of the properties file used to configure this class.
Represents the base folder (relative to the application's root folder) this class searches for customization folders.
Returns a ClassLoader
capable of loading classes/resources from
all customization folders.
Represents the Java class used to compare the current CustomizationInfo
instances
to sort them. If no Comparator
has been explicitly set, or the properties file didn't include a Comparator
name
this method returns a string comparator (in which case, customizations are applied in alphabetical order).
The Comparator
will be asked to compare two CustomizationInfo
instances
to determine the order in which they should be applied. It must return -1 if the first
CustomizationInfo
is to be applied before the second, and 1 if the second
CustomizationInfo
is to be applied before the first.
Returns the CustomizationInfo with the given name;
Returns a list of CustomizationInfo
classes. Each CustomizationInfo
represents a single customization folder, which can be used to query whether there is a
customization for a given file in the folder, or to retrieve a ClassLoader that searches for classes/resources
only in that customization folder.
Represents the prefix that identifies a folder as a customization folder. A folder is identified as a customization folder when its name within the base folder starts with this prefix.
The method to return the singleton instance of this class.
Returns the full absolute path within the file sytem for a given relative path.
Returns the CustomizationInfo with the given name;
Logs a conflict message into the log using the conflicts logger. To log a conflict, please specify
the level of conflict, the class and method where the conflict was detected, a detailed message
explaining what the conflict is and the action taken, and the pair of customizations among
which the conflict was detected.
For the conflict level, use the following convention:
Level.SEVERE
: When two customizations modify the same parameter with different values.
Level.WARNING
: When two customizations modify the same parameter, but use the same value.
Returns a list of CustomizationInfo
classes. Each CustomizationInfo
represents a single customization folder, which can be used to query whether there is a
customization for a given file in the folder, or to retrieve a ClassLoader that searches for classes/resources
only in that customization folder.
This method triggers the class to check for changes in the base folder for new customizations.
Represents the base folder (relative to the application's root folder) this class searches for customization folders.
Sets the Comparator
used to compare two CustomizationInfo instances to sort them.
Represents the prefix that identifies a folder as a customization folder. A folder is identified as a customization folder when its name within the base folder starts with this prefix.
This class observes the FileLoader, whenever the FileLoader instances changes this class wants to be notified so it can remove its internal caches.
Returns a list of customization folders based on the base folder and the folder prefix.
Loads and initializes this class based on the Properties file (if found). If the file is not found, the current values are used.
FileNotFoundException |
---|