Class ServiceConfiguration
- java.lang.Object
-
- io.helidon.service.configuration.api.ServiceConfiguration
-
- Direct Known Subclasses:
HikariCPServiceConfiguration
,UCPServiceConfiguration
@Deprecated public abstract class ServiceConfiguration extends Object
Deprecated.This class is slated for removal.An abstract encapsulation of an automatically discovered configuration for a given service.For the purposes of configuration, a service is normally represented as a client library that connects to a remote provider of business value. Typically the client library needs to be configured in some way in order to function at all. Instances of this class aim to provide such configuration in as automated a manner as possible.
ServiceConfiguration
instances are typically produced byServiceConfigurationProvider
instances. Obtaining aServiceConfiguration
by any other means may result in undefined behavior.- See Also:
getInstance(String)
,ServiceConfigurationProvider
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ServiceConfiguration(String serviceIdentifier)
Deprecated.Creates a newServiceConfiguration
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ServiceConfiguration
getInstance(String serviceIdentifier)
Deprecated.Returns the soleServiceConfiguration
implementation in effect for the currentSystem
s and identified by the suppliedserviceIdentifier
, if there is one, ornull
if there is no suchServiceConfiguration
.static ServiceConfiguration
getInstance(String serviceIdentifier, Properties coordinates)
Deprecated.Returns the soleServiceConfiguration
implementation in effect for the currentSystem
s and identified by the suppliedserviceIdentifier
and suitable for the suppliedcoordinates
, if there is one, ornull
if there is no suchServiceConfiguration
.String
getProperty(String propertyName)
Deprecated.Returns a value for the property described by the suppliedpropertyName
, ornull
if no such property value exists.abstract String
getProperty(String propertyName, String defaultValue)
Deprecated.Returns a value for the property described by the suppliedpropertyName
, or the value of the supplieddefaultValue
parameter if no such property value exists.abstract Set<String>
getPropertyNames()
Deprecated.Returns an unmodifiable and unchangingSet
ofString
s representing the names of properties whose values may be retrieved with thegetProperty(String)
method.String
getServiceIdentifier()
Deprecated.Returns the identifier of the service thisServiceConfiguration
implementation provides configuration for.
-
-
-
Constructor Detail
-
ServiceConfiguration
protected ServiceConfiguration(String serviceIdentifier)
Deprecated.Creates a newServiceConfiguration
.- Parameters:
serviceIdentifier
- the identifier of the service thisServiceConfiguration
implementation will provide configuration for; must not benull
- Throws:
NullPointerException
- ifserviceIdentifier
isnull
- See Also:
getServiceIdentifier()
-
-
Method Detail
-
getServiceIdentifier
public final String getServiceIdentifier()
Deprecated.Returns the identifier of the service thisServiceConfiguration
implementation provides configuration for.This method never returns
null
.- Returns:
- the identifier of the service this
ServiceConfiguration
implementation provides configuration for; nevernull
- See Also:
ServiceConfiguration(String)
-
getPropertyNames
public abstract Set<String> getPropertyNames()
Deprecated.Returns an unmodifiable and unchangingSet
ofString
s representing the names of properties whose values may be retrieved with thegetProperty(String)
method.Implementations of this method must not return
null
.Implementations of this method must ensure that the
Set
returned may be used without the end user having to peform explicit synchronization.Implementations of this method may return the same
Set
instance with each invocation, or differentSet
instances with different contents.- Returns:
- an unmodifiable and unchanging
Set
ofString
s representing the names of properties whose values may be retrieved with thegetProperty(String)
method
-
getProperty
public final String getProperty(String propertyName)
Deprecated.Returns a value for the property described by the suppliedpropertyName
, ornull
if no such property value exists.This method may return
null
.- Parameters:
propertyName
- the name of the property whose value should be returned; must not benull
- Returns:
- a value for the property described by the supplied
propertyName
, ornull
- See Also:
getProperty(String, String)
-
getProperty
public abstract String getProperty(String propertyName, String defaultValue)
Deprecated.Returns a value for the property described by the suppliedpropertyName
, or the value of the supplieddefaultValue
parameter if no such property value exists.Implementations of this method may return
null
ifdefaultValue
isnull
.Implementations of this method may return the same or different values for each invocation with the same parameters.
- Parameters:
propertyName
- the name of the property whose value should be returned; may benull
in which case the value of the supplieddefaultValue
parameter will be returned insteaddefaultValue
- the value to return if a value for the named property could not be found; may benull
- Returns:
- a value for the property described by the supplied
propertyName
, or the value of the supplieddefaultValue
parameter
-
getInstance
public static final ServiceConfiguration getInstance(String serviceIdentifier)
Deprecated.Returns the soleServiceConfiguration
implementation in effect for the currentSystem
s and identified by the suppliedserviceIdentifier
, if there is one, ornull
if there is no suchServiceConfiguration
.- Parameters:
serviceIdentifier
- the service identifier for which aServiceConfiguration
should be sought; must not benull
- Returns:
- the sole
ServiceConfiguration
implementation in effect for the currentSystem
s and identified by the suppliedserviceIdentifier
, if there is one, ornull
- Throws:
NullPointerException
- ifserviceIdentifier
isnull
ServiceConfigurationError
- if there was a problem loading Java services- See Also:
getInstance(String, Properties)
-
getInstance
public static final ServiceConfiguration getInstance(String serviceIdentifier, Properties coordinates)
Deprecated.Returns the soleServiceConfiguration
implementation in effect for the currentSystem
s and identified by the suppliedserviceIdentifier
and suitable for the suppliedcoordinates
, if there is one, ornull
if there is no suchServiceConfiguration
.This method may—and often does—return
null
.While the current implementation of this method performs no caching other than that performed as a side effect by
ServiceLoader
method invocations, caching is deliberately not a component of the specification of this method's behavior.- Parameters:
serviceIdentifier
- the service identifier for which aServiceConfiguration
should be sought; must not benull
coordinates
- aProperties
object containing coordinates that might assist aServiceConfiguration
implementation in implementing itsgetPropertyNames()
andgetProperty(String)
methods; may benull
- Returns:
- the sole
ServiceConfiguration
implementation in effect for the currentSystem
s and identified by the suppliedserviceIdentifier
, if there is one, ornull
- Throws:
NullPointerException
- ifserviceIdentifier
isnull
ServiceConfigurationError
- if there was a problem loading Java services
-
-