@Trait @CompileStatic trait ServerInteraction extends java.lang.Object
Methods to aid interacting with the server from the CLI
| Type Params | Return Type | Name and description |
|---|---|---|
|
boolean |
isServerAvailable(java.lang.String host, int port)Returns true if the server is available, which is once the application's web server answers on the port. |
|
void |
waitForStartup(java.lang.String host, int port)Waits for the server to startup |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Returns true if the server is available, which is once the application's web server answers on the port.
An application that uses the grails-startup-progress module answers on the port before its web
server starts, marking each response with the Grails-Startup-Phase header, so a response that
carries it means the application is still starting. Once the web server has the port, it answers this
request itself, even while BootStrap runs, as it does for an application without that module.
A port that accepts the connection but does not answer plain HTTP, as one with SSL does, counts as
available, since that it accepts connections is all there is to go on.
The request is made over the socket that connects, so a port that stops accepting connections between two connects, as it does when it changes hands from the progress page to the web server, cannot be taken for one that does not answer plain HTTP, and no proxy set for the JVM can answer for the port.
host - The hostport - The portWaits for the server to startup
host - The hostport - The port