Package io.smallrye.stork
Class Stork
- java.lang.Object
-
- io.smallrye.stork.Stork
-
- All Implemented Interfaces:
StorkServiceRegistry
public final class Stork extends Object implements StorkServiceRegistry
The entrypoint for SmallRye Stork.Use `Stork.getInstance()` to get a hold of a configured instance, and retrieve `ServiceDiscovery` and/or `LoadBalancer` from it.
-
-
Field Summary
Fields Modifier and Type Field Description static StringSTORKThe stork name.static StringSTORK_REGISTRARconfiguration prefix for stork service registrars
-
Constructor Summary
Constructors Constructor Description Stork(StorkInfrastructure storkInfrastructure)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StorkdefineIfAbsent(String name, ServiceDefinition definition)static StorkgetInstance()ServicegetService(String serviceName)Optional<Service>getServiceOptional(String serviceName)<MetadataKeyType extends Enum<MetadataKeyType> & MetadataKey>
ServiceRegistrar<MetadataKeyType>getServiceRegistrar(String registrarName)Deprecated.Map<String,Service>getServices()static voidinitialize()Initialize the stork instance using the default infrastructure.static voidinitialize(StorkInfrastructure infrastructure)Initialize the stork instance using the given infrastructure.static voidshutdown()Closes the stork instance.
-
-
-
Field Detail
-
STORK
public static final String STORK
The stork name.- See Also:
- Constant Field Values
-
STORK_REGISTRAR
public static final String STORK_REGISTRAR
configuration prefix for stork service registrars- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Stork
@Deprecated public Stork(StorkInfrastructure storkInfrastructure)
Deprecated.Exposed for tests. Not to be used in production code- Parameters:
storkInfrastructure- the infrastructure, must not benull
-
-
Method Detail
-
getService
public Service getService(String serviceName)
- Specified by:
getServicein interfaceStorkServiceRegistry
-
getServiceOptional
public Optional<Service> getServiceOptional(String serviceName)
- Specified by:
getServiceOptionalin interfaceStorkServiceRegistry
-
getServices
public Map<String,Service> getServices()
- Specified by:
getServicesin interfaceStorkServiceRegistry
-
defineIfAbsent
public Stork defineIfAbsent(String name, ServiceDefinition definition)
- Specified by:
defineIfAbsentin interfaceStorkServiceRegistry
-
getInstance
public static Stork getInstance()
- Returns:
- the stork instance.
-
shutdown
public static void shutdown()
Closes the stork instance.
-
initialize
public static void initialize(StorkInfrastructure infrastructure)
Initialize the stork instance using the given infrastructure.- Parameters:
infrastructure- the infrastructure, must not benull
-
initialize
public static void initialize()
Initialize the stork instance using the default infrastructure.
-
getServiceRegistrar
@Deprecated public <MetadataKeyType extends Enum<MetadataKeyType> & MetadataKey> ServiceRegistrar<MetadataKeyType> getServiceRegistrar(String registrarName)
Deprecated.
-
-