public interface Runtime
It is used to install and maintain the set of installed Modules.
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitShutdown(long timeout,
TimeUnit unit)
Await shutdown complete
|
Module |
getModule(ClassLoader classLoader)
Returns a module that is associated with the specified class loader.
|
Module |
getModule(long id)
Returns the module with the specified identifier.
|
Module |
getModule(org.jboss.gravia.resource.ResourceIdentity identity)
Returns the module with the specified resource identity.
|
ModuleContext |
getModuleContext()
Get the sytem module context.
|
Set<Module> |
getModules()
Returns the set of all installed modules.
|
Set<Module> |
getModules(ClassLoader classLoader)
Returns the set of installed modules associated with the given class loader.
|
Set<Module> |
getModules(String symbolicName,
org.jboss.gravia.resource.VersionRange range)
Returns the set of installed modules with a given symbolic name or version.
|
Object |
getProperty(String key)
Returns the value of the specified property.
|
Object |
getProperty(String key,
Object defaultValue)
Returns the value of the specified property.
|
Object |
getRequiredProperty(String key)
Returns the value of the specified property.
|
void |
init()
Initialize this runtime instance.
|
Module |
installModule(ClassLoader classLoader,
Dictionary<String,String> headers)
Installs a module with the given ClassLoader and headers dictionary.
|
Module |
installModule(ClassLoader classLoader,
org.jboss.gravia.resource.Resource resource,
Dictionary<String,String> headers)
Installs a module with the given ClassLoader.
|
Module |
installModule(ClassLoader classLoader,
org.jboss.gravia.resource.Resource resource,
Dictionary<String,String> headers,
org.jboss.gravia.resource.Attachable context)
Installs a module with the given ClassLoader.
|
Runtime |
shutdown()
Shutdown the runtime.
|
boolean |
shutdownComplete()
True, if runtime shutdown has been completed
|
boolean |
shutdownInProgress()
True, if runtime shutdown has been initiated
|
void init()
Object getProperty(String key)
null if the property is not found.key - The name of the requested property.null if the
property is undefined.Object getRequiredProperty(String key)
IllegalStateException if the property is not found.key - The name of the requested property.IllegalStateException - if the property is undefined.Object getProperty(String key, Object defaultValue)
key - The name of the requested property.ModuleContext getModuleContext()
Module getModule(long id)
id - The identifier of the module to retrieve.Module object or null if the identifier does
not match any installed module.Module getModule(org.jboss.gravia.resource.ResourceIdentity identity)
identity - The identifier of the module to retrieve.Module object or null if the resource identity does
not match any installed module.Module getModule(ClassLoader classLoader)
If multiple modules are associated with the same class loader it returns the first in the natural module order (i.e. the one with the lowest module identifier)
classLoader - The class loader of the module to retrieve.Module object or null if the class loader does
not match any installed module.Set<Module> getModules()
This method returns a list of all modules installed in the Runtime at the time of the call to this method. However, since the Runtime is a very dynamic environment, modules can be installed or uninstalled at anytime.
Modules.Set<Module> getModules(ClassLoader classLoader)
Modules.Set<Module> getModules(String symbolicName, org.jboss.gravia.resource.VersionRange range)
Both parameters are optional. If a parameter is null it matches all.
Modules that match.Module installModule(ClassLoader classLoader, Dictionary<String,String> headers) throws ModuleException
The module's ResourceIdentity and possible other
capabilities/requirements are generated from the headers.
ModuleExceptioninstallModule(ClassLoader, Resource, Dictionary)Module installModule(ClassLoader classLoader, org.jboss.gravia.resource.Resource resource, Dictionary<String,String> headers) throws ModuleException
Module installModule(ClassLoader classLoader, org.jboss.gravia.resource.Resource resource, Dictionary<String,String> headers, org.jboss.gravia.resource.Attachable context) throws ModuleException
An explicit Resource parameter takes priority.
An optional application context can be given
The following steps are required to install a module:
INSTALLED.
ModuleEvent.INSTALLED is fired.
RESOLVED.
ModuleEvent#RESOLVED is fired.
Module object for the newly or previously installed module is returned.
ModuleExceptionRuntime shutdown()
boolean shutdownInProgress()
boolean shutdownComplete()
boolean awaitShutdown(long timeout,
TimeUnit unit)
throws InterruptedException
InterruptedExceptionCopyright © 2015 JBoss by Red Hat. All rights reserved.