public interface RuntimeService
This service is usually implemented for each target platform where Nuxeo Runtime should run.
It is recommended to extend the AbstractRuntimeService
class instead
of directly implementing this interface.
After the runtime service was initialized, it may be accessed through the
facade class Framework
.
See: Framework
Modifier and Type | Method and Description |
---|---|
String |
expandVars(String expression)
Replaces any substring in the form
${property.name} with
the corresponding runtime property value if any, otherwise leaves the
substring unchanged. |
org.osgi.framework.Bundle |
getBundle(String symbolicName)
Get an installed bundle given its symbolic name.
|
File |
getBundleFile(org.osgi.framework.Bundle bundle)
OSGi frameworks are using a string
Bundle.getLocation() to
identify bundle locations. |
Object |
getComponent(ComponentName name)
Gets a component given its name.
|
Object |
getComponent(String name)
Gets a component given its name as a string.
|
ComponentInstance |
getComponentInstance(ComponentName name)
Gets a component implementation instance given its name.
|
ComponentInstance |
getComponentInstance(String name)
Gets a component implementation instance given its name as a string.
|
ComponentManager |
getComponentManager()
Gets the component manager.
|
RuntimeContext |
getContext()
Gets the context of the runtime bundle.
|
String |
getDescription()
Gets the description of this runtime service.
|
File |
getHome()
Gets the home directory of the runtime.
|
String |
getName()
Gets the name of this runtime service.
|
Properties |
getProperties()
Gets runtime service properties.
|
String |
getProperty(String name)
Gets a runtime service property given its name.
|
String |
getProperty(String name,
String defaultValue)
Gets a property value using a default value if the property was not set.
|
<T> T |
getService(Class<T> serviceClass)
Gets the service of type serviceClass if such a service was declared by
a resolved runtime component.
|
Version |
getVersion()
Gets the version of this runtime service.
|
List<String> |
getWarnings()
Gets a list of startup warnings.
|
boolean |
isShuttingDown()
Returns true if the runtime is shutting down.
|
boolean |
isStarted()
Returns true if the runtime is started.
|
void |
reloadProperties()
Reread all property files loaded at startup.
|
void |
start()
Starts the runtime.
|
void |
stop()
Stops the runtime.
|
void start() throws Exception
Exception
- if any exception occurred during startupvoid stop() throws Exception
Exception
- if any exception occurred during shutdownboolean isStarted()
boolean isShuttingDown()
File getHome()
String getName()
String getDescription()
Version getVersion()
Properties getProperties()
void reloadProperties() throws Exception
Exception
String getProperty(String name)
name
- the property nameString getProperty(String name, String defaultValue)
name
- the property namedefaultValue
- the default value to use when the property doesn't
existsString expandVars(String expression)
${property.name}
with
the corresponding runtime property value if any, otherwise leaves the
substring unchanged.expression
- the expression to processComponentManager getComponentManager()
Object getComponent(String name)
name
- the component name as a stringObject getComponent(ComponentName name)
name
- the component nameComponentInstance getComponentInstance(String name)
name
- the component name as a stringComponentInstance getComponentInstance(ComponentName name)
name
- the component nameRuntimeContext getContext()
<T> T getService(Class<T> serviceClass)
If the component is not yet activated, it will be prior to return the service.
T
- the service typeserviceClass
- the service classList<String> getWarnings()
File getBundleFile(org.osgi.framework.Bundle bundle)
Bundle.getLocation()
to
identify bundle locations.
This method try to convert the bundle location to real file if possible. If this bundle location cannot be converted to a file (e.g. it may be a remote URL), null is returned.
This method works only for bundles that are installed as files on the host file system.
org.osgi.framework.Bundle getBundle(String symbolicName)
symbolicName
- Copyright © 2011 Nuxeo SA. All Rights Reserved.