| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRuntime(PropertiesProvider propertiesProvider) |
| Modifier and Type | Method and Description |
|---|---|
<A> A |
adapt(Class<A> type) |
protected void |
assertNoShutdown() |
boolean |
awaitShutdown(long timeout,
TimeUnit unit)
Await shutdown complete
|
protected abstract AbstractModule |
createModule(ClassLoader classLoader,
org.jboss.gravia.resource.Resource resource,
Dictionary<String,String> headers,
org.jboss.gravia.resource.Attachable context) |
protected void |
doShutdown() |
protected abstract ModuleEntriesProvider |
getDefaultEntriesProvider(Module module,
org.jboss.gravia.resource.Attachable context) |
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 propName)
Returns the value of the specified property.
|
protected org.jboss.gravia.resource.ResourceIdentity |
getSystemIdentity() |
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
|
protected void |
uninstallModule(Module module) |
protected AbstractRuntime(PropertiesProvider propertiesProvider)
protected abstract AbstractModule createModule(ClassLoader classLoader, org.jboss.gravia.resource.Resource resource, Dictionary<String,String> headers, org.jboss.gravia.resource.Attachable context)
protected abstract ModuleEntriesProvider getDefaultEntriesProvider(Module module, org.jboss.gravia.resource.Attachable context)
public final Object getProperty(String key)
Runtimenull if the property is not found.getProperty in interface Runtimekey - The name of the requested property.null if the
property is undefined.public Object getRequiredProperty(String propName)
RuntimeIllegalStateException if the property is not found.getRequiredProperty in interface RuntimepropName - The name of the requested property.public final Object getProperty(String key, Object defaultValue)
RuntimegetProperty in interface Runtimekey - The name of the requested property.public <A> A adapt(Class<A> type)
protected final org.jboss.gravia.resource.ResourceIdentity getSystemIdentity()
public ModuleContext getModuleContext()
RuntimegetModuleContext in interface Runtimepublic final Module getModule(long id)
Runtimepublic final Module getModule(org.jboss.gravia.resource.ResourceIdentity identity)
Runtimepublic final Module getModule(ClassLoader classLoader)
RuntimeIf 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)
public final Set<Module> getModules()
RuntimeThis 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.
getModules in interface RuntimeModules.public final Set<Module> getModules(ClassLoader classLoader)
RuntimegetModules in interface RuntimeModules.public Set<Module> getModules(String symbolicName, org.jboss.gravia.resource.VersionRange range)
RuntimeBoth parameters are optional. If a parameter is null it matches all.
getModules in interface RuntimeModules that match.public final Module installModule(ClassLoader classLoader, Dictionary<String,String> headers) throws ModuleException
Runtime
The module's ResourceIdentity and possible other
capabilities/requirements are generated from the headers.
installModule in interface RuntimeModuleExceptionRuntime.installModule(ClassLoader, Resource, Dictionary)public final Module installModule(ClassLoader classLoader, org.jboss.gravia.resource.Resource resource, Dictionary<String,String> headers) throws ModuleException
RuntimeinstallModule in interface RuntimeModuleExceptionRuntime.installModule(ClassLoader, Resource, Dictionary, Attachable)public final Module installModule(ClassLoader classLoader, org.jboss.gravia.resource.Resource resource, Dictionary<String,String> headers, org.jboss.gravia.resource.Attachable context) throws ModuleException
Runtime
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.
installModule in interface RuntimeModuleExceptionprotected void uninstallModule(Module module)
public Runtime shutdown()
Runtimepublic boolean shutdownInProgress()
RuntimeshutdownInProgress in interface Runtimepublic boolean awaitShutdown(long timeout,
TimeUnit unit)
throws InterruptedException
RuntimeawaitShutdown in interface RuntimeInterruptedExceptionpublic boolean shutdownComplete()
RuntimeshutdownComplete in interface Runtimeprotected void assertNoShutdown()
protected void doShutdown()
Copyright © 2015 JBoss by Red Hat. All rights reserved.