|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deckfour.xes.extension.XExtensionManager
public class XExtensionManager
The extension manager is used to access, store, and manage extensions in a system. Extensions can be loaded from their given URI, which should point to the file defining the extension. Also, extensions can be registered locally, which then override any remotely-loaded extensions (which are more generic placeholders). Extension files downloaded from remote sources (which happens when the extension cannot be resolved locally) are cached on the local system, so that the network source of extension files is not put under extensive stress. The extension manager is a singleton, there is no need to instantiate more than one extension manager, which is necessary to avoid states of inconsistency.
Field Summary | |
---|---|
static long |
MAX_CACHE_MILLIS
Maximal time for caching remotely-defined extensions in milliseconds. |
Method Summary | |
---|---|
protected void |
cacheExtension(URI uri)
Downloads and caches an extension from its remote definition file. |
XExtension |
getByIndex(int index)
Retrieves an extension by ints index. |
XExtension |
getByName(String name)
Retrieves an extension by its name. |
XExtension |
getByPrefix(String prefix)
Retrieves an extension by its prefix. |
XExtension |
getByUri(URI uri)
Retrieves an extension instance by its unique URI. |
int |
getIndex(XExtension extension)
Resolves the index of an extension, given that this extension has been previously registered with this manager instance. |
static XExtensionManager |
instance()
Accesses the singleton instance of the extension manager. |
protected void |
loadExtensionCache()
Loads all extensions stored in the local cache. |
void |
register(XExtension extension)
Explicitly registers an extension instance with the extension manager. |
protected void |
registerStandardExtensions()
Registers all defined standard extensions with the extension manager before caching. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long MAX_CACHE_MILLIS
Method Detail |
---|
public static XExtensionManager instance()
public void register(XExtension extension)
extension
- The extension to be registered.public XExtension getByUri(URI uri)
uri
- The unique URI of the requested extension.
public XExtension getByName(String name)
null
.
name
- The name of the requested extension.
null
,
if it cannot be found).public XExtension getByPrefix(String prefix)
null
.
prefix
- The prefix of the requested extension.
null
,
if it cannot be found).public XExtension getByIndex(int index)
null
.
index
- The index of the requested extension.
null
,
if it cannot be found).public int getIndex(XExtension extension)
-1
.
extension
- The extension to look up the index for.
protected void registerStandardExtensions()
protected void cacheExtension(URI uri)
uri
- Unique URI of the extension which is to
be cached.protected void loadExtensionCache()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |