public interface RuntimeServices
Services, providers and applications can optionally store
preferences (configuration information) using a java.util.pref.Preferences
instance registered as a service. Any provider may optionally register
a root Preferences
node. Once a provider registers
a Preferences
node, preferences will
be saved across reboots of the provider and/or JVM if the underlying
Preferences
implementation supports it.
Services and application code can store keys
in the root Preferences
node or create child nodes
as required.
Preferences prefs = rs.getService(Preferences.class);
if (prefs != null) {
prefs.put("threshold", 3);
}
Modifier and Type | Method and Description |
---|---|
<T> T |
getService(java.lang.Class<T> serviceClass)
Get a service for this invocation.
|
<T> T getService(java.lang.Class<T> serviceClass)
These services must be provided by all implementations:
java.util.concurrent.ThreadFactory
- Thread factory, runtime code should
create new threads using this factory.
java.util.concurrent.ScheduledExecutorService
- Scheduler, runtime code should
execute asynchronous and repeating tasks using this scheduler.
T
- service class typeserviceClass
- Type of the service required.serviceClass
if the
container this invocation runs in supports that service,
otherwise null
.Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641