- java.lang.Object
-
- net.morimekta.tiny.server.TinyApplicationContext
-
public final class TinyApplicationContext extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTinyApplicationContext.Builder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TinyApplicationContextaddHealthCheck(String name, TinyHealth.HealthCheck healthCheck)Add health check to active checks.TinyApplicationContextaddReadyCheck(String name, TinyHealth.ReadyCheck readyCheck)Add ready check to active checks.intgetAdminPort()Get the port the Admin HTTP server is listening to.TinyApplicationContextremoveHealthCheck(String name)Remove health check with given name.TinyApplicationContextremoveReadyCheck(String name)Remove ready check with given name.
-
-
-
Method Detail
-
getAdminPort
public int getAdminPort()
Get the port the Admin HTTP server is listening to.- Returns:
- The listening Admin port.
-
addReadyCheck
public TinyApplicationContext addReadyCheck(String name, TinyHealth.ReadyCheck readyCheck)
Add ready check to active checks.- Parameters:
name- Ready check name. The name must be unique.readyCheck- The ready check to be done.- Returns:
- The context.
-
removeReadyCheck
public TinyApplicationContext removeReadyCheck(String name)
Remove ready check with given name.- Parameters:
name- The ready check name.- Returns:
- The context.
-
addHealthCheck
public TinyApplicationContext addHealthCheck(String name, TinyHealth.HealthCheck healthCheck)
Add health check to active checks.- Parameters:
name- Ready check name.healthCheck- The health check to be done.- Returns:
- The context.
-
removeHealthCheck
public TinyApplicationContext removeHealthCheck(String name)
Remove health check with given name.- Parameters:
name- The health check name.- Returns:
- The context.
-
-