public class ServiceConfigurationConfigSource extends Object implements ConfigSource
ConfigSource implementation that wraps the ServiceConfiguration in effect.getValue(String),
getProperties()CONFIG_ORDINAL| Modifier | Constructor and Description |
|---|---|
protected |
ServiceConfigurationConfigSource()
Creates a new
ServiceConfigurationConfigSource. |
protected |
ServiceConfigurationConfigSource(ServiceConfiguration serviceConfiguration)
Creates a new
ServiceConfigurationConfigSource. |
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Returns the name of this
ServiceConfigurationConfigSource. |
Map<String,String> |
getProperties()
Returns a
Map representing all properties known to this
ServiceConfigurationConfigSource. |
Set<String> |
getPropertyNames()
Returns all property names known to this
ServiceConfigurationConfigSource by returning the result of
invoking the ServiceConfiguration.getPropertyNames()
method on the underlying ServiceConfiguration. |
String |
getValue(String name)
Returns the value of the property identified by the supplied
name, or null if there is no such property or a
value could not be found for some reason. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetOrdinalprotected ServiceConfigurationConfigSource()
ServiceConfigurationConfigSource.
The name of this ServiceConfigurationConfigSource will
be equal to the value of the system property named by
concatenating this ServiceConfigurationConfigSource's
simple class name converted to
lowercase with .serviceIdentifier, or, if that is null, the simple class name converted to lowercase itself.
protected ServiceConfigurationConfigSource(ServiceConfiguration serviceConfiguration)
ServiceConfigurationConfigSource.serviceConfiguration - the ServiceConfiguration this
ServiceConfigurationConfigSource will wrap. If this
parameter is null, then the service identifier for which
to find a
ServiceConfiguration will be determined by first trying
to use the value of the system property named by
concatenating this ServiceConfigurationConfigSource's
simple class name converted to
lowercase with .serviceIdentifier, and then, if that is null (as it
commonly may be) by simply using this ServiceConfigurationConfigSource's simple class name converted to lowercase. The result of invoking ServiceConfiguration.getInstance(String) on this value will then
be used as if it had been passed directly.ServiceConfiguration.getInstance(String),
ServiceConfiguration.getServiceIdentifier()public final String getName()
ServiceConfigurationConfigSource.
This method never returns null.
getName in interface ConfigSourceServiceConfigurationConfigSource; never nullpublic final Set<String> getPropertyNames()
ServiceConfigurationConfigSource by returning the result of
invoking the ServiceConfiguration.getPropertyNames()
method on the underlying ServiceConfiguration.
This method never returns null.
getPropertyNames in interface ConfigSourceServiceConfigurationConfigSource; never nullServiceConfiguration.getPropertyNames()public final Map<String,String> getProperties()
Map representing all properties known to this
ServiceConfigurationConfigSource.
This method never returns null.
The Map that is returned is assembled using
invocations of the ServiceConfiguration.getPropertyNames() and ServiceConfiguration.getProperty(String) methods.
The Map that is returned is immutable and
thread-safe.
getProperties in interface ConfigSourceMap representing all properties known to this
ServiceConfigurationConfigSource; never nullServiceConfiguration.getPropertyNames(),
ServiceConfiguration.getProperty(String)public final String getValue(String name)
name, or null if there is no such property or a
value could not be found for some reason.
This method may return null.
This method returns the result of invoking the ServiceConfiguration.getProperty(String) method with the
supplied name.
getValue in interface ConfigSourcename - the name of the property; may be null in
which case null will be returnednullCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.