| java.lang.Object | ||
| ↳ | java.util.Observable | |
| ↳ | com.microstrategy.utils.config.ConfigFileManager | |
A ConfigFileManager instance provides notifications
about changes that occur in its governing directory,
or a specific file manage(String). If a
FileDispenser is provided, and
if a requested file is not present, the dispenser will attempt
to locate it in the classpath and make a duplicate at the given
file location (if it has a directory context).
Observers need to extend ConfigChangeObserver.
When the application starts up, all files are considered new.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
addObserver(ConfigChangeObserver observer)
Adds a new
ConfigChangeObserver. | ||||||||||
| FileDispenser | getDispenser() | ||||||||||
| File | getFile() | ||||||||||
| synchronized static ConfigFileManager |
manage(String fileOrDirectoryResource)
Returns the
ConfigFileManager singleton identified
by its managed directory or file. | ||||||||||
| void |
reset()
Clears out the differential checking cache.
| ||||||||||
| void |
setDispenser(FileDispenser dispenser)
If a
FileDispenser is specified, the auto-dispensing feature
is enabled: whenever a file is requested, but not in the
specified directory, the dispenser will search for it in the classpath
and make a duplicate in the governed directory if found. | ||||||||||
| void |
update()
Force an update immediately.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.util.Observable
| |||||||||||
From class
java.lang.Object
| |||||||||||
Adds a new ConfigChangeObserver.
| observer | new ConfigChangeObserver
|
|---|
| IOException | |
|---|---|
| SecurityException |
Returns the ConfigFileManager singleton identified
by its managed directory or file.
| fileOrDirectoryResource | directory to be managed (excludes sub-directories if directory) |
|---|
ConfigFileManager| IOException | thrown if the directory isn't found, or has inaccessible permissions |
|---|---|
| IllegalArgumentException | thrown if manager name already exists |
Clears out the differential checking cache. All files in the directory will now appear as if they were new files.
If a FileDispenser is specified, the auto-dispensing feature
is enabled: whenever a file is requested, but not in the
specified directory, the dispenser will search for it in the classpath
and make a duplicate in the governed directory if found. The duplication
will trigger the appropriate updates.
| dispenser | optional file dispenser |
|---|
Force an update immediately. Normally, updates occur automatically as determined by setUpdateInterval(long). If an update occurs while another is currently in progress, it will be ignored.