Package com.bc.ceres.core.runtime
Class RuntimeContext
java.lang.Object
com.bc.ceres.core.runtime.RuntimeContext
The Ceres
Runtime
class provides access to the system module, which
can be used to access the runtime's configuration and all of its
current modules.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RuntimeConfig
Gets the runtime configuration.static ModuleContext
Gets the context of the runtime's one and only system module.static Enumeration
<URL> getResources
(String resourceName) Finds all the resources within all runtime modules with the given name.static boolean
Checks the status of the runtime's one and only system module.
-
Constructor Details
-
RuntimeContext
public RuntimeContext()
-
-
Method Details
-
isAvailable
public static boolean isAvailable()Checks the status of the runtime's one and only system module.- Returns:
true
if the runtime is available.
-
getConfig
Gets the runtime configuration. The method returnsnull
if the runtime is not available.- Returns:
- The runtime configuration, or
null
.
-
getModuleContext
Gets the context of the runtime's one and only system module. The method returnsnull
if the runtime is not available. This is the case if the Ceres runtime is either not used at all or the system module has not yet been started or it has already been stopped.- Returns:
- The runtime's system module context, or
null
.
-
getResources
Finds all the resources within all runtime modules with the given name. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code.The name of a resource is a /-separated path name that identifies the resource.
- Parameters:
resourceName
- The resource name- Returns:
- An enumeration of
URL
objects for the resource. If no resources could be found, the enumeration will be empty. Resources that the module runtime doesn't have access to will not be in the enumeration. - Throws:
IOException
- If I/O errors occur- Since:
- 0.14
- See Also:
-