|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.api.config.domain.key.ApplicationIdLoader
@ThreadSafe public final class ApplicationIdLoader
Loads the application identifier from the Manifest file.
Constructor Summary | |
---|---|
ApplicationIdLoader() Convenience constructor preferring manifest information from EARs and no caching. |
|
ApplicationIdLoader(boolean preferEarManifest) Convenience constructor preferring no caching. |
|
ApplicationIdLoader(boolean preferEarManifest, boolean useCache) Default constructor. |
Method Summary | |
---|---|
static ApplicationIdLoader |
createCachedJarLoader() Returns a caching loader that reads the Manifest file from the JAR that actually contains the resource. |
ApplicationId |
load() Loads the application identifier from the manifest file pointed at by the context class loader . |
ApplicationId |
load(Class<?> locator) Loads the application identifier from the manifest file pointed at from the given class. |
ApplicationId |
load(ClassLoader classLoader) Loads the application identifier from the manifest file pointed at from the given class loader. |
ApplicationId |
load(URL rootUrl) Loads the manifest information as application ID from the given root URL. |
String |
toString() Returns the string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ApplicationIdLoader()
public ApplicationIdLoader(boolean preferEarManifest)
preferEarManifest
- the flag to signal that the manifest of a EAR file (with the extension (with the extension
ear
) is preferred if present.
public ApplicationIdLoader(boolean preferEarManifest, boolean useCache)
preferEarManifest
- the flag to signal that the manifest of a EAR file (with the extension (with the extension
ear
) is preferred if present.
useCache
- set to
true
if all loaded application IDs should be cached,
false
otherwise.
Method Detail |
---|
public static ApplicationIdLoader createCachedJarLoader()
ApplicationIdLoader(boolean, boolean)
public ApplicationId load() throws IllegalStateException
context class loader
.
IllegalStateException
- if the application identifier cannot be read from the manifest.
public ApplicationId load(Class<?> locator) throws IllegalStateException
locator
- the class to locate the manifest file to load. It is the manifest file of the archive this class is part of.
IllegalStateException
- if the application identifier cannot be read from the manifest.
public ApplicationId load(URL rootUrl)
rootUrl
- the URL to a class path root. The
JarFile.MANIFEST_NAME
will be appended to locate the manifest file.
rootUrl
.
public ApplicationId load(ClassLoader classLoader) throws IllegalStateException
classLoader
- the class loader to load the manifest file.
IllegalStateException
- if the application identifier cannot be read from the manifest.
public String toString()
toString
in class
Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |