Class System
- java.lang.Object
-
- io.helidon.service.configuration.api.System
-
- Direct Known Subclasses:
ACCSSystem
,KubernetesSystem
,LocalhostSystem
@Deprecated public abstract class System extends Object
Deprecated.This class is slated for removal.A service provider that represents some kind of system in which the current program is running.The meaning of system is deliberately loose. A system might be a laptop, a platform-as-a-service such as the Oracle Application Container Cloud Service or Heroku, a generic Linux-like ecosystem running as part of a Kubernetes cluster, and so on.
System
instances provide access to their environment as well as totheir properties
.In an arbitrary collection of
System
instances, zero or one of them may be marked as being authoritative. An authoritativeSystem
holds sway, and its properties and environment values are to be preferred over all others.- See Also:
getSystems()
,getenv()
,getProperties()
,isAuthoritative()
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object other)
Deprecated.Map<String,String>
getenv()
Deprecated.String
getName()
Deprecated.Returns the name of thisSystem
.Properties
getProperties()
Deprecated.Returns the properties of thisSystem
as a non-null
, unchanging and unmodifiableProperties
object.static Set<System>
getSystems()
Deprecated.Returns a non-null
, unchanging and unmodifiableSet
ofSystem
instances as found by the Java service provider mechanism.int
hashCode()
Deprecated.boolean
isAuthoritative()
Deprecated.Returnstrue
if thisSystem
is authoritative.abstract boolean
isEnabled()
Deprecated.Returnstrue
if thisSystem
is enabled.
-
-
-
Constructor Detail
-
System
protected System(String name, boolean authoritative)
Deprecated.Creates a newSystem
.- Parameters:
name
- the name of theSystem
; must not benull
authoritative
- whether theSystem
will be authoritative- Throws:
NullPointerException
- ifname
isnull
- See Also:
getName()
,isAuthoritative()
-
-
Method Detail
-
getName
public final String getName()
Deprecated.Returns the name of thisSystem
.This method never returns
null
.Multiple invocations of this method will return identical
String
instances.- Returns:
- the name of this
System
; nevernull
- See Also:
System(String, boolean)
-
isEnabled
public abstract boolean isEnabled()
Deprecated.Returnstrue
if thisSystem
is enabled.If a
System
is enabled, then its environment values and properties may be used. If aSystem
is not enabled, then usage of its environment values and properties may result in undefined behavior.- Returns:
true
if thisSystem
is enabled;false
otherwise- See Also:
System(String, boolean)
-
isAuthoritative
public boolean isAuthoritative()
Deprecated.Returnstrue
if thisSystem
is authoritative.If a
System
is authoritative, then its environment values and properties are to be preferred over any others that might be present.In the presence of an authoritative
System
, usage of a non-authoritativeSystem
may lead to undefined behavior.- Returns:
true
if thisSystem
is authoritative;false
otherwise- See Also:
System(String, boolean)
-
getenv
public Map<String,String> getenv()
Deprecated.Returns the environment of thisSystem
as a non-null
, unchanging and unmodifiableMap
.This method never returns
null
.Overrides of this method must not return
null
.Overrides of this method must ensure that the
Map
returned may be used without requiring the user to perform synchronization.Multiple invocations of this method or any overridden variants of it are not guaranteed to return equal or identical
Map
instances.The default implementation of this method returns the result of invoking
System.getenv()
.- Returns:
- the environment of this
System
as a non-null
, unchanging and unmodifiableMap
; nevernull
- See Also:
getProperties()
,System.getenv()
-
getProperties
public Properties getProperties()
Deprecated.Returns the properties of thisSystem
as a non-null
, unchanging and unmodifiableProperties
object.This method never returns
null
.Overrides of this method must not return
null
.Callers must not mutate the
Properties
object that is returned. Attempts to do so may result in anUnsupportedOperationException
.Multiple invocations of this method or any overridden variants of it are not guaranteed to return equal or identical
Properties
instances.The default implementation of this method returns the result of invoking
System.getProperties()
.- Returns:
- the properties of this
System
as a non-null
, unchanging and unmodifiableProperties
object; nevernull
- See Also:
getenv()
,System.getProperties()
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCode
in classObject
- Returns:
- a hashcode for this
System
- See Also:
equals(Object)
-
equals
public boolean equals(Object other)
Deprecated.Returnstrue
if thisSystem
is equal to the suppliedObject
.This
System
is deemed to be equal to anObject
passed to this method if the suppliedObject
is an instance ofSystem
and has a name equal to the name of thisSystem
and has an enabled status equal to that of thisSystem
and has an authoritative status equal to that of thisSystem
.
-
getSystems
public static final Set<System> getSystems()
Deprecated.Returns a non-null
, unchanging and unmodifiableSet
ofSystem
instances as found by the Java service provider mechanism.This method never returns
null
but may return an emptySet
.If one of the
System
instances so discovered is authoritative, then it will be the only member of the returnedSet
.Multiple invocations of this method are not guaranteed to return equal or identical
Set
instances.- Returns:
- a non-
null
unmodifiableSet
ofSystem
instances as found by the Java service provider mechanism; nevernull
- See Also:
isAuthoritative()
,ServiceLoader.load(Class)
-
-