Class ServerConfiguration
- java.lang.Object
-
- org.glassfish.grizzly.http.server.ServerFilterConfiguration
-
- org.glassfish.grizzly.http.server.ServerConfiguration
-
public class ServerConfiguration extends ServerFilterConfiguration
Configuration options for a particularHttpServerinstance.
-
-
Field Summary
-
Fields inherited from class org.glassfish.grizzly.http.server.ServerFilterConfiguration
MAX_REQUEST_PARAMETERS, USE_SEND_FILE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddHttpHandler(HttpHandler httpHandler)Adds the specifiedHttpHandleras a root handler.voidaddHttpHandler(HttpHandler httpHandler, String... mappings)Adds the specifiedHttpHandlerwith its associated mapping(s).voidaddHttpHandler(HttpHandler httpHandler, HttpHandlerRegistration... mapping)Adds the specifiedHttpHandlerwith its associated mapping(s).voidaddJmxEventListener(JmxEventListener listener)Add aJmxEventListenerwhich will be notified when theHttpServeris started and JMX was enabled prior to starting or if theHttpServerwas started with JMX disabled, but JMX was enabled at a later point in time.Map<HttpHandler,String[]>getHttpHandlers()Deprecated.please usegetHttpHandlersWithMapping()Map<HttpHandler,HttpHandlerRegistration[]>getHttpHandlersWithMapping()Returns theHttpHandlermap.Set<JmxEventListener>getJmxEventListeners()longgetMaxPayloadRemainderToSkip()HttpServerMonitoringConfiggetMonitoringConfig()Get the web server monitoring config.StringgetName()booleanisAllowPayloadForUndefinedHttpMethods()The flag, which enables/disables payload support for HTTP methods, for which HTTP spec doesn't clearly state whether they support payload.booleanisJmxEnabled()booleanremoveHttpHandler(HttpHandler httpHandler)Removes the specifiedHttpHandler.voidremoveJmxEventListener(JmxEventListener listener)Removes the specifiedJmxEventListener.voidsetAllowPayloadForUndefinedHttpMethods(boolean allowPayloadForUndefinedHttpMethods)The flag, which enables/disables payload support for HTTP methods, for which HTTP spec doesn't clearly state whether they support payload.voidsetJmxEnabled(boolean jmxEnabled)EnablesJMXfor thisHttpServer.voidsetMaxPayloadRemainderToSkip(long maxPayloadRemainderToSkip)Set the maximum request payload remainder (in bytes) HttpServerFilter will try to swallow after HTTP request processing is over in order to keep the connection alive.voidsetName(String name)Sets the logical name of thisHttpServerinstance.-
Methods inherited from class org.glassfish.grizzly.http.server.ServerFilterConfiguration
getBackendConfiguration, getDefaultErrorPageGenerator, getDefaultQueryEncoding, getHttpServerName, getHttpServerVersion, getMaxBufferedPostSize, getMaxFormPostSize, getMaxPostSize, getMaxRequestParameters, getScheme, getSessionManager, getSessionTimeoutSeconds, isGracefulShutdownSupported, isPassTraceRequest, isReuseSessionID, isSendFileEnabled, isTraceEnabled, setBackendConfiguration, setDefaultErrorPageGenerator, setDefaultQueryEncoding, setGracefulShutdownSupported, setHttpServerName, setHttpServerVersion, setMaxBufferedPostSize, setMaxFormPostSize, setMaxPostSize, setMaxRequestParameters, setPassTraceRequest, setReuseSessionID, setScheme, setSendFileEnabled, setSessionManager, setSessionTimeoutSeconds, setTraceEnabled
-
-
-
-
Method Detail
-
addHttpHandler
public void addHttpHandler(HttpHandler httpHandler)
Adds the specifiedHttpHandleras a root handler.- Parameters:
httpHandler- aHttpHandler
-
addHttpHandler
public void addHttpHandler(HttpHandler httpHandler, String... mappings)
Adds the specifiedHttpHandlerwith its associated mapping(s). Requests will be dispatched to aHttpHandlerbased on these mapping values.- Parameters:
httpHandler- aHttpHandlermappings- context path mapping information.
-
addHttpHandler
public void addHttpHandler(HttpHandler httpHandler, HttpHandlerRegistration... mapping)
Adds the specifiedHttpHandlerwith its associated mapping(s). Requests will be dispatched to aHttpHandlerbased on these mapping values.- Parameters:
httpHandler- aHttpHandlermapping- context path mapping information.
-
removeHttpHandler
public boolean removeHttpHandler(HttpHandler httpHandler)
Removes the specifiedHttpHandler.- Returns:
- true, if the operation was successful, otherwise false
-
getHttpHandlers
@Deprecated public Map<HttpHandler,String[]> getHttpHandlers()
Deprecated.please usegetHttpHandlersWithMapping()Returns theHttpHandlermap. Please note, the returned map is read-only.- Returns:
- the
HttpHandlermap.
-
getHttpHandlersWithMapping
public Map<HttpHandler,HttpHandlerRegistration[]> getHttpHandlersWithMapping()
Returns theHttpHandlermap. Please note, the returned map is read-only.- Returns:
- the
HttpHandlermap.
-
getMonitoringConfig
public HttpServerMonitoringConfig getMonitoringConfig()
Get the web server monitoring config.- Returns:
- the web server monitoring config.
-
getName
public String getName()
- Returns:
- the logical name of this
HttpServerinstance. If no name is explicitly specified, the default value will beHttpServer. If there is more than onceHttpServerper virtual machine, the server name will beHttpServer-[(instance count - 1)].
-
setName
public void setName(String name)
Sets the logical name of thisHttpServerinstance. The logical name cannot be changed after the server has been started.- Parameters:
name- server name
-
isJmxEnabled
public boolean isJmxEnabled()
- Returns:
trueifJMXhas been enabled for thisHttpServer. IftruetheHttpServermanagement object will be registered at the root of the JMX tree with the name of[instance-name]where instance name is the value returned bygetName().
-
setJmxEnabled
public void setJmxEnabled(boolean jmxEnabled)
EnablesJMXfor thisHttpServer. This value can be changed at runtime.- Parameters:
jmxEnabled-trueto enableJMXotherwisefalse
-
addJmxEventListener
public void addJmxEventListener(JmxEventListener listener)
Add aJmxEventListenerwhich will be notified when theHttpServeris started and JMX was enabled prior to starting or if theHttpServerwas started with JMX disabled, but JMX was enabled at a later point in time.- Parameters:
listener- theJmxEventListenerto add.
-
removeJmxEventListener
public void removeJmxEventListener(JmxEventListener listener)
Removes the specifiedJmxEventListener.- Parameters:
listener- theJmxEventListenerto remove.
-
getJmxEventListeners
public Set<JmxEventListener> getJmxEventListeners()
- Returns:
- an
Iteratorof all registeredJmxEventListeners.
-
isAllowPayloadForUndefinedHttpMethods
public boolean isAllowPayloadForUndefinedHttpMethods()
The flag, which enables/disables payload support for HTTP methods, for which HTTP spec doesn't clearly state whether they support payload. Known "undefined" methods are: GET, HEAD, DELETE.- Returns:
- true if "undefined" methods support payload, or false otherwise
- Since:
- 2.3.12
-
setAllowPayloadForUndefinedHttpMethods
public void setAllowPayloadForUndefinedHttpMethods(boolean allowPayloadForUndefinedHttpMethods)
The flag, which enables/disables payload support for HTTP methods, for which HTTP spec doesn't clearly state whether they support payload. Known "undefined" methods are: GET, HEAD, DELETE.- Parameters:
allowPayloadForUndefinedHttpMethods- true if "undefined" methods support payload, or false otherwise- Since:
- 2.3.12
-
getMaxPayloadRemainderToSkip
public long getMaxPayloadRemainderToSkip()
- Returns:
- the maximum request payload remainder (in bytes) HttpServerFilter will try to swallow after HTTP request processing is over in order to keep the connection alive. If the remainder is too large - the connection will be closed. -1 means no limits will be applied.
- Since:
- 2.3.13
-
setMaxPayloadRemainderToSkip
public void setMaxPayloadRemainderToSkip(long maxPayloadRemainderToSkip)
Set the maximum request payload remainder (in bytes) HttpServerFilter will try to swallow after HTTP request processing is over in order to keep the connection alive. If the remainder is too large - the connection will be closed. -1 means no limits will be applied.- Parameters:
maxPayloadRemainderToSkip-- Since:
- 2.3.13
-
-