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.
Systeminstances provide access to their environment as well as totheir properties.In an arbitrary collection of
Systeminstances, zero or one of them may be marked as being authoritative. An authoritativeSystemholds 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 booleanequals(Object other)Deprecated.Map<String,String>getenv()Deprecated.StringgetName()Deprecated.Returns the name of thisSystem.PropertiesgetProperties()Deprecated.Returns the properties of thisSystemas a non-null, unchanging and unmodifiablePropertiesobject.static Set<System>getSystems()Deprecated.Returns a non-null, unchanging and unmodifiableSetofSysteminstances as found by the Java service provider mechanism.inthashCode()Deprecated.booleanisAuthoritative()Deprecated.Returnstrueif thisSystemis authoritative.abstract booleanisEnabled()Deprecated.Returnstrueif thisSystemis enabled.
-
-
-
Constructor Detail
-
System
protected System(String name, boolean authoritative)
Deprecated.Creates a newSystem.- Parameters:
name- the name of theSystem; must not benullauthoritative- whether theSystemwill be authoritative- Throws:
NullPointerException- ifnameisnull- 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
Stringinstances.- Returns:
- the name of this
System; nevernull - See Also:
System(String, boolean)
-
isEnabled
public abstract boolean isEnabled()
Deprecated.Returnstrueif thisSystemis enabled.If a
Systemis enabled, then its environment values and properties may be used. If aSystemis not enabled, then usage of its environment values and properties may result in undefined behavior.- Returns:
trueif thisSystemis enabled;falseotherwise- See Also:
System(String, boolean)
-
isAuthoritative
public boolean isAuthoritative()
Deprecated.Returnstrueif thisSystemis authoritative.If a
Systemis 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-authoritativeSystemmay lead to undefined behavior.- Returns:
trueif thisSystemis authoritative;falseotherwise- See Also:
System(String, boolean)
-
getenv
public Map<String,String> getenv()
Deprecated.Returns the environment of thisSystemas 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
Mapreturned 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
Mapinstances.The default implementation of this method returns the result of invoking
System.getenv().- Returns:
- the environment of this
Systemas a non-null, unchanging and unmodifiableMap; nevernull - See Also:
getProperties(),System.getenv()
-
getProperties
public Properties getProperties()
Deprecated.Returns the properties of thisSystemas a non-null, unchanging and unmodifiablePropertiesobject.This method never returns
null.Overrides of this method must not return
null.Callers must not mutate the
Propertiesobject 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
Propertiesinstances.The default implementation of this method returns the result of invoking
System.getProperties().- Returns:
- the properties of this
Systemas a non-null, unchanging and unmodifiablePropertiesobject; nevernull - See Also:
getenv(),System.getProperties()
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCodein classObject- Returns:
- a hashcode for this
System - See Also:
equals(Object)
-
equals
public boolean equals(Object other)
Deprecated.Returnstrueif thisSystemis equal to the suppliedObject.This
Systemis deemed to be equal to anObjectpassed to this method if the suppliedObjectis an instance ofSystemand has a name equal to the name of thisSystemand has an enabled status equal to that of thisSystemand has an authoritative status equal to that of thisSystem.
-
getSystems
public static final Set<System> getSystems()
Deprecated.Returns a non-null, unchanging and unmodifiableSetofSysteminstances as found by the Java service provider mechanism.This method never returns
nullbut may return an emptySet.If one of the
Systeminstances 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
Setinstances.- Returns:
- a non-
nullunmodifiableSetofSysteminstances as found by the Java service provider mechanism; nevernull - See Also:
isAuthoritative(),ServiceLoader.load(Class)
-
-