IP Intelligence services for 51Degrees Pipeline

fiftyone.ipintelligence.examples.web.EmbedJetty Class Reference

Static Public Member Functions

static void runWebApp (String resourceBase, int port) throws Exception
static Server startWebApp (String resourceBase, int port) throws Exception
static int boundPort (Server server)
 Returns the local TCP port the server's first connector is actually listening on.
static void stopAndJoin (Server server) throws Exception
 Stops the server and blocks until it has fully terminated, ensuring the listening socket is released before the method returns.
static void runServlet (String contextPath, int port, Class<? extends Servlet > servlet, Map< String, String > initParams) throws Exception
static Server startServlet (String contextPath, int port, Class<? extends Servlet > servlet, Map< String, String > initParams) throws Exception

Member Function Documentation

◆ boundPort()

int fiftyone.ipintelligence.examples.web.EmbedJetty.boundPort ( Server server)
static

Returns the local TCP port the server's first connector is actually listening on.

When the server is started with port 0 the OS assigns a free ephemeral port; tests should read it back via this method rather than assuming a fixed port.

Parameters
servera started Jetty server
Returns
the bound local port

◆ stopAndJoin()

void fiftyone.ipintelligence.examples.web.EmbedJetty.stopAndJoin ( Server server) throws Exception
static

Stops the server and blocks until it has fully terminated, ensuring the listening socket is released before the method returns.

Parameters
serverthe server to stop (ignored if null)