Package org.openremote.container.web
Class WebService
java.lang.Object
org.openremote.container.web.WebService
- All Implemented Interfaces:
org.openremote.model.ContainerService
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected URIprotected static AtomicReference<CORSFilter>protected booleanprotected Stringprotected List<WebService.RequestHandler>static final Stringstatic final Stringstatic final booleanstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final Stringprotected intprotected io.undertow.Undertowstatic final intFields inherited from interface org.openremote.model.ContainerService
DEFAULT_PRIORITY, HIGH_PRIORITY, LOW_PRIORITY, MED_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic io.undertow.server.HttpHandleraddServletDeployment(org.openremote.model.Container container, io.undertow.servlet.api.DeploymentInfo deploymentInfo, boolean secure) Adds a deployment to the default servlet container and returns the started handler.protected io.undertow.Undertow.Builderbuild(org.openremote.model.Container container, io.undertow.Undertow.Builder builder) protected org.jboss.resteasy.spi.ResteasyDeploymentcreateResteasyDeployment(org.openremote.model.Container container, Collection<Class<?>> apiClasses, Collection<Object> apiSingletons, boolean secure) getAllowedOrigins(org.openremote.model.Container container) static io.undertow.servlet.api.FilterInfogetCorsFilterInfo(org.openremote.model.Container container) getExternalHostnames(org.openremote.model.Container container) Provides the LAN IPv4 address the container is bound to so it can be used in the context provider callbacks; if CB is on the other side of some sort of NAT then this won't work also assumes HTTPprotected static StringWhen a request comes in the handlers are called in order until a handler returns a non null value; when this happens the returnedWebService.RequestHandleris invoked.voidinit(org.openremote.model.Container container) All services are initialized in the order they have been added to the container (if container started with explicit list of services) otherwise they are initialized in order ofContainerService.getPriority().static WebService.RequestHandlerpathStartsWithHandler(String name, String path, io.undertow.server.HttpHandler handler) voidremoveServletDeployment(io.undertow.servlet.api.DeploymentInfo deploymentInfo) voidstart(org.openremote.model.Container container) After initialization, services are started in the order they have been added to the container (if container started with explicit list of services) otherwise they are started in order ofContainerService.getPriority().voidstop(org.openremote.model.Container container) When the container is shutting down, it stops all services in the reverse order they were started.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openremote.model.ContainerService
getPriority
-
Field Details
-
OR_WEBSERVER_LISTEN_HOST
- See Also:
-
OR_WEBSERVER_LISTEN_HOST_DEFAULT
- See Also:
-
OR_WEBSERVER_LISTEN_PORT
- See Also:
-
OR_WEBSERVER_LISTEN_PORT_DEFAULT
public static final int OR_WEBSERVER_LISTEN_PORT_DEFAULT- See Also:
-
OR_WEBSERVER_DUMP_REQUESTS
- See Also:
-
OR_WEBSERVER_DUMP_REQUESTS_DEFAULT
public static final boolean OR_WEBSERVER_DUMP_REQUESTS_DEFAULT- See Also:
-
OR_WEBSERVER_ALLOWED_ORIGINS
- See Also:
-
OR_WEBSERVER_IO_THREADS_MAX
- See Also:
-
OR_WEBSERVER_IO_THREADS_MAX_DEFAULT
public static final int OR_WEBSERVER_IO_THREADS_MAX_DEFAULT -
OR_WEBSERVER_WORKER_THREADS_MAX
- See Also:
-
WEBSERVER_WORKER_THREADS_MAX_DEFAULT
public static final int WEBSERVER_WORKER_THREADS_MAX_DEFAULT -
corsFilterRef
-
devMode
protected boolean devMode -
host
-
port
protected int port -
undertow
protected io.undertow.Undertow undertow -
httpHandlers
-
containerHostUri
-
-
Constructor Details
-
WebService
public WebService()
-
-
Method Details
-
getLocalIpAddress
- Throws:
Exception
-
pathStartsWithHandler
public static WebService.RequestHandler pathStartsWithHandler(String name, String path, io.undertow.server.HttpHandler handler) -
init
Description copied from interface:org.openremote.model.ContainerServiceAll services are initialized in the order they have been added to the container (if container started with explicit list of services) otherwise they are initialized in order ofContainerService.getPriority().- Specified by:
initin interfaceorg.openremote.model.ContainerService- Throws:
Exception
-
start
Description copied from interface:org.openremote.model.ContainerServiceAfter initialization, services are started in the order they have been added to the container (if container started with explicit list of services) otherwise they are started in order ofContainerService.getPriority().- Specified by:
startin interfaceorg.openremote.model.ContainerService- Throws:
Exception
-
stop
Description copied from interface:org.openremote.model.ContainerServiceWhen the container is shutting down, it stops all services in the reverse order they were started.- Specified by:
stopin interfaceorg.openremote.model.ContainerService- Throws:
Exception
-
addServletDeployment
public static io.undertow.server.HttpHandler addServletDeployment(org.openremote.model.Container container, io.undertow.servlet.api.DeploymentInfo deploymentInfo, boolean secure) Adds a deployment to the default servlet container and returns the started handler. -
removeServletDeployment
public void removeServletDeployment(io.undertow.servlet.api.DeploymentInfo deploymentInfo) -
getRequestHandlers
When a request comes in the handlers are called in order until a handler returns a non null value; when this happens the returnedWebService.RequestHandleris invoked. -
getHostUri
Provides the LAN IPv4 address the container is bound to so it can be used in the context provider callbacks; if CB is on the other side of some sort of NAT then this won't work also assumes HTTP -
build
protected io.undertow.Undertow.Builder build(org.openremote.model.Container container, io.undertow.Undertow.Builder builder) -
createResteasyDeployment
protected org.jboss.resteasy.spi.ResteasyDeployment createResteasyDeployment(org.openremote.model.Container container, Collection<Class<?>> apiClasses, Collection<Object> apiSingletons, boolean secure) -
getCorsFilterInfo
public static io.undertow.servlet.api.FilterInfo getCorsFilterInfo(org.openremote.model.Container container) -
getExternalHostnames
-
getAllowedOrigins
-