public abstract class AbstractRuntimeService extends Object implements RuntimeService
 Implementors are encouraged to extend this class instead of directly implementing the RuntimeService
 interface.
| Modifier and Type | Class and Description | 
|---|---|
protected class  | 
AbstractRuntimeService.LogConfig
Configure the logging system (log4j) at runtime startup and do any cleanup is needed when the runtime is stopped 
 | 
| Modifier and Type | Field and Description | 
|---|---|
protected RuntimeContext | 
context  | 
protected boolean | 
isShuttingDown  | 
protected boolean | 
isStarted  | 
protected AbstractRuntimeService.LogConfig | 
logConfig  | 
protected ComponentManager | 
manager  | 
protected RuntimeMessageHandlerImpl | 
messageHandler
Message handler for runtime. 
 | 
protected CryptoProperties | 
properties  | 
static String | 
REDIRECT_JUL
Property that controls whether or not to redirect JUL to JCL. 
 | 
static String | 
REDIRECT_JUL_THRESHOLD  | 
protected File | 
workingDir  | 
| Modifier | Constructor and Description | 
|---|---|
protected  | 
AbstractRuntimeService(DefaultRuntimeContext context)  | 
protected  | 
AbstractRuntimeService(DefaultRuntimeContext context,
                      Map<String,String> properties)  | 
| Modifier and Type | Method and Description | 
|---|---|
protected ComponentManager | 
createComponentManager()  | 
protected void | 
doStart()  | 
protected void | 
doStop()  | 
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. | 
protected static URL | 
getBuiltinFeatureURL()  | 
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. 
 | 
ComponentInstance | 
getComponentInstance(ComponentName name)
Gets a component implementation instance given its name. 
 | 
ComponentManager | 
getComponentManager()
Gets the component manager. 
 | 
RuntimeContext | 
getContext()
Gets the context of the runtime bundle. 
 | 
String | 
getDescription()
Gets the description of this runtime service. 
 | 
static Thread | 
getErrorLoggerThread(String message)
Error logger which does its logging from a separate thread, for thread isolation. 
 | 
File | 
getHome()
Gets the home directory of the runtime. 
 | 
RuntimeMessageHandler | 
getMessageHandler()
Gets the runtime message handler. 
 | 
CryptoProperties | 
getProperties()
Gets runtime service properties. 
 | 
String | 
getProperty(String name)
Gets a runtime service property given its name. 
 | 
String | 
getProperty(String name,
           String defValue)
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. 
 | 
boolean | 
getStatusMessage(StringBuilder msg)
Computes the runtime status, adds it to the given string builder, and return true if some problems have been
 detected. 
 | 
boolean | 
isShuttingDown()
Returns true if the runtime is shutting down. 
 | 
boolean | 
isStarted()
Returns true if the runtime is started. 
 | 
protected void | 
loadConfig()  | 
void | 
setHome(File home)  | 
void | 
setProperty(String name,
           Object value)  | 
void | 
start()
Starts the runtime. 
 | 
void | 
stop()
Stops the runtime. 
 | 
String | 
toString()  | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponent, getComponentInstance, getName, getVersion, reloadPropertiespublic static final String REDIRECT_JUL
public static final String REDIRECT_JUL_THRESHOLD
protected boolean isStarted
protected boolean isShuttingDown
protected File workingDir
protected CryptoProperties properties
protected ComponentManager manager
protected final RuntimeContext context
protected AbstractRuntimeService.LogConfig logConfig
protected final RuntimeMessageHandlerImpl messageHandler
protected AbstractRuntimeService(DefaultRuntimeContext context)
protected AbstractRuntimeService(DefaultRuntimeContext context, Map<String,String> properties)
public RuntimeMessageHandler getMessageHandler()
RuntimeServicegetMessageHandler in interface RuntimeServiceprotected ComponentManager createComponentManager()
protected static URL getBuiltinFeatureURL()
public void start()
RuntimeServicestart in interface RuntimeServicepublic void stop()
RuntimeServicestop in interface RuntimeServicepublic boolean isStarted()
RuntimeServiceisStarted in interface RuntimeServicepublic boolean isShuttingDown()
RuntimeServiceisShuttingDown in interface RuntimeServiceprotected void loadConfig() throws IOException
IOExceptionprotected void doStart()
protected void doStop()
public File getHome()
RuntimeServicegetHome in interface RuntimeServicepublic String getDescription()
RuntimeServicegetDescription in interface RuntimeServicepublic CryptoProperties getProperties()
RuntimeServicegetProperties in interface RuntimeServicepublic String getProperty(String name)
RuntimeServicegetProperty in interface RuntimeServicename - the property namepublic String getProperty(String name, String defValue)
RuntimeServicegetProperty in interface RuntimeServicename - the property namedefValue - the default value to use when the property doesn't existspublic void setProperty(String name, Object value)
setProperty in interface RuntimeServicepublic Object getComponent(ComponentName name)
RuntimeServicegetComponent in interface RuntimeServicename - the component namepublic ComponentInstance getComponentInstance(ComponentName name)
RuntimeServicegetComponentInstance in interface RuntimeServicename - the component namepublic ComponentManager getComponentManager()
RuntimeServicegetComponentManager in interface RuntimeServicepublic RuntimeContext getContext()
RuntimeServicegetContext in interface RuntimeServicepublic <T> T getService(Class<T> serviceClass)
RuntimeServiceIf the component is not yet activated, it will be prior to return the service.
getService in interface RuntimeServiceT - the service typeserviceClass - the service classpublic String expandVars(String expression)
RuntimeService${property.name} with the corresponding runtime property value if
 any, otherwise leaves the substring unchanged.expandVars in interface RuntimeServiceexpression - the expression to processpublic File getBundleFile(org.osgi.framework.Bundle bundle)
RuntimeServiceBundle.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.
getBundleFile in interface RuntimeServicepublic org.osgi.framework.Bundle getBundle(String symbolicName)
RuntimeServicegetBundle in interface RuntimeServicepublic boolean getStatusMessage(StringBuilder msg)
RuntimeServicegetStatusMessage in interface RuntimeServicemsg - summary message about all components loading statuspublic static Thread getErrorLoggerThread(String message)
message - the message to logCopyright © 2019 Nuxeo. All rights reserved.