Package io.micronaut.discovery
Class DefaultServiceInstanceIdGenerator
java.lang.Object
io.micronaut.discovery.DefaultServiceInstanceIdGenerator
- All Implemented Interfaces:
ServiceInstanceIdGenerator
@Singleton
public class DefaultServiceInstanceIdGenerator
extends Object
implements ServiceInstanceIdGenerator
The default implementation to generate Instance IDs.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongenerateId
(Environment environment, ServiceInstance serviceInstance) Generates a service ID.
-
Constructor Details
-
DefaultServiceInstanceIdGenerator
protected DefaultServiceInstanceIdGenerator()Default constructor.
-
-
Method Details
-
generateId
@NonNull public @NonNull String generateId(Environment environment, ServiceInstance serviceInstance) Description copied from interface:ServiceInstanceIdGenerator
Generates a service ID.- Specified by:
generateId
in interfaceServiceInstanceIdGenerator
- Parameters:
environment
- The environmentserviceInstance
- The service instance- Returns:
- The generated ID. Never null
-