Package org.kiwiproject.registry.server
Class NoopRegistryService
java.lang.Object
org.kiwiproject.registry.server.NoopRegistryService
- All Implemented Interfaces:
RegistryService
A No-op implementation of the
RegistryService. This is useful if you want to run a service that needs to register
with a registry but don't have a registry service to connect to.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCandidateFrom(ServiceInfo serviceInfo) Creates a newServiceInstanceinstance from aServiceInfothat can be registered with the registry server.register(ServiceInstance serviceToRegister) Registers aServiceInstancewith the registry server and returns a new instance containing information about the registered instance.voidUnregisters any registrations that were previously registered.updateStatus(ServiceInstance.Status newStatus) Sends an update to the registry server to inform of a service status change
-
Constructor Details
-
NoopRegistryService
public NoopRegistryService()
-
-
Method Details
-
createCandidateFrom
Description copied from interface:RegistryServiceCreates a newServiceInstanceinstance from aServiceInfothat can be registered with the registry server.- Specified by:
createCandidateFromin interfaceRegistryService- Parameters:
serviceInfo- Service information that will be used to set up a new instance to be registered.- Returns:
- The
ServiceInstanceobject that was created
-
register
Description copied from interface:RegistryServiceRegisters aServiceInstancewith the registry server and returns a new instance containing information about the registered instance.- Specified by:
registerin interfaceRegistryService- Parameters:
serviceToRegister- The service information to register- Returns:
- The service instance that was registered
-
updateStatus
Description copied from interface:RegistryServiceSends an update to the registry server to inform of a service status change- Specified by:
updateStatusin interfaceRegistryService- Parameters:
newStatus- The new status that will be sent- Returns:
- a copy of the original
ServiceInstancewith the new status set
-
unregister
public void unregister()Description copied from interface:RegistryServiceUnregisters any registrations that were previously registered. This should be a NO-OP if nothing has ever been registered.- Specified by:
unregisterin interfaceRegistryService
-