ResourceManager
is used to manage the UIMACPP resources.
The class ResourceManager
is a singleton. For example, there can only be one instance of the class per process. The first argument cpszInstance
defines the instance name of this instance.
The second argument cpszProductPrefix
is optional and defines the product prefix. Both arguments are no longer used.
foo(const TCHAR * cpszInstance) { // first create an instance of the UIMACPP resource manager ResourceManager & rclUimaResourceMgr = ResourceManager::createInstance(cpszInstance); if(rclUimaResourceMgr.getLastErrorId() != UIMA_ERR_NONE) { ErrorMessage clMessage( rclUimaResourceMgr.getLastErrorId() ); cout << clMessage << endl; } }
ResourceManager
is deleted automatically.
Static Functions | |
util::Filename const * | getStreamHandlerForURIScheme (std::string uriScheme) |
Look up the streamhandler dll that supports the URI scheme. | |
void | registerLogger (Logger *) |
Register Logger. | |
void | unregisterLogger (Logger *) |
unregister this logger. | |
std::vector< Logger * > & | getLoggers () |
ResourceManager & | createInstance (const TCHAR *cpszInstance, const TCHAR *cpszProductPrefix=0) |
Returns a pointer to the singleton instance of ResourceManager for this process and passes the instance key to it. | |
ResourceManager & | getInstance (void) |
Returns a pointer to the singleton instance of ResourceManager for this process. | |
bool | hasInstance (void) |
Return TRUE, if the resource manager has been initialized. | |
void | deleteInstance (void) |
Deletes the resource manager instance. | |
icu::UnicodeString | resolveFilename (icu::UnicodeString const &filename, icu::UnicodeString const &lastFilename) |
Public Member Functions | |
Properties | |
TyErrorId | getLastErrorId (void) const |
Returns the last error that occurred. | |
const util::Location & | getLocationWork (void) const |
Returns the location used for storing temporary work files. | |
const util::Location & | getLocationData (void) const |
Returns the location used for storing data files. | |
bool | isSchemaAvailable (void) |
Returns the location used to find the schema definition file used for schema validation when parsing descriptors. | |
TCHAR const * | getSchemaInfo (void) |
void | enableSchemaValidation (bool aEnable) |
bool | doSchemaValidation (void) |
LogStream::EnEntryType | getLoggingLevel () |
get the current logging level | |
void | setLoggingLevel (LogStream::EnEntryType level) |
set the current minimum logging level | |
void | setupJavaLogging (void *jniEnv) |
store handle to java env and handle to java log method | |
bool | isJavaLoggingEnabled () |
true is java logging is setup | |
uima::LogFacility & | getLogger () |
returns handle to the framework logger | |
util::DllProcLoaderFile * | requestAnnotatorFile (const util::Filename &crclFilename) |
Returns an AnnotatorFile from the pool of AnnotatorFiles with the specified filename. | |
ResourceABase const * | getResource (uima::Language const &crLang, ResourceFactoryABase const &crFactory, ErrorInfo &) |
Convenience function. | |
ResourceABase const * | getResource (icu::UnicodeString const &crKey, ResourceFactoryABase const &crFactory, ErrorInfo &) |
Main method to create/access resources. | |
void | registerFactory (icu::UnicodeString const &crKind, ResourceFactoryABase &crFactory) |
Register a factory for a given kind of ressource. | |
void | deRegisterFactory (icu::UnicodeString const &crKind, ResourceFactoryABase &crFactory) |
Deregister a factory for a given kind of ressource. | |
ResourceABase const * | getResource (icu::UnicodeString const &crKey, icu::UnicodeString const &crKind, ErrorInfo &) |
get or create a ressource of a given kind and key using a factory registered earlier using registerFactory | |
Miscellaneous | |
void | setNewLocationWork (const util::Location &crclLocation) |
Sets a new location to store temporary work files. | |
void | setNewLocationData (const util::Location &crclLocation) |
Sets a new location to store data files. | |
Static Public Member Functions | |
bool | createFilenameForLanguage (Language &rclLanguage, const TCHAR *cpszExtension, bool bUseAlternateTerritories, const util::Location &crclDirToUse, util::Filename &rclFilename) |
Creates a filename for a resource file based on the specified language and the specified filename extension. |
|
Creates a filename for a resource file based on the specified language and the specified filename extension. Returns TRUE, if a file with this filename exists. Example: language is "en-us" and extension is ".tsw" filename will be en-us.tsw
If Example: language is "en" and the extension is ".tsw". The filename could also be en-uk.tsw |
|
Returns the last error that occurred.
|
|
Returns the location used for storing temporary work files.
|
|
Returns the location used for storing data files.
|
|
Returns the location used to find the schema definition file used for schema validation when parsing descriptors.
|
|
|
|
|
|
|
|
get the current logging level
|
|
set the current minimum logging level
|
|
store handle to java env and handle to java log method
|
|
true is java logging is setup
|
|
returns handle to the framework logger
|
|
Returns an AnnotatorFile from the pool of AnnotatorFiles with the specified filename.
|
|
Convenience function. Extracts the string from crLang and calls getResource(). |
|
Main method to create/access resources. If a resource with the same key and kind as the factory already exists, it is returned, otherwise a new one is created. |
|
Register a factory for a given kind of ressource. Only after registering a factory for a kind a resource can be acquired using the getResource() overload below |
|
Deregister a factory for a given kind of ressource.
|
|
get or create a ressource of a given kind and key using a factory registered earlier using registerFactory
|
|
Sets a new location to store temporary work files.
|
|
Sets a new location to store data files.
|
|
Returns a pointer to the singleton instance of ResourceManager for this process and passes the instance key to it. Note: This function must be called before any calls to static method ResourceManager::getInstance()/0. |
|
Returns a pointer to the singleton instance of ResourceManager for this process.
|
|
Return TRUE, if the resource manager has been initialized.
|
|
Deletes the resource manager instance.
|
|
Look up the streamhandler dll that supports the URI scheme.
|
|
|
|
Register Logger. Caller owns the logger instance. |
|
unregister this logger. Caller owns logger instance. |
|
|