Package io.smallrye.stork
Class Stork
java.lang.Object
io.smallrye.stork.Stork
- All Implemented Interfaces:
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondefineIfAbsent(String name, ServiceDefinition definition) static StorkgetService(String serviceName) getServiceOptional(String serviceName) <MetadataKeyType extends Enum<MetadataKeyType> & MetadataKey>
ServiceRegistrar<MetadataKeyType>getServiceRegistrar(String registrarName) Deprecated.static voidInitialize 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 Details
-
STORK
The stork name.- See Also:
-
STORK_REGISTRAR
configuration prefix for stork service registrars- See Also:
-
-
Constructor Details
-
Stork
Deprecated.Exposed for tests. Not to be used in production code- Parameters:
storkInfrastructure- the infrastructure, must not benull
-
-
Method Details
-
getService
- Specified by:
getServicein interfaceStorkServiceRegistry
-
getServiceOptional
- Specified by:
getServiceOptionalin interfaceStorkServiceRegistry
-
getServices
- Specified by:
getServicesin interfaceStorkServiceRegistry
-
defineIfAbsent
- Specified by:
defineIfAbsentin interfaceStorkServiceRegistry
-
getInstance
- Returns:
- the stork instance.
-
shutdown
public static void shutdown()Closes the stork instance. -
initialize
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.
-