Top Description Fields Constructors Methods
org.glassfish.grizzly.http.server

public Class ServerConfiguration

extends ServerFilterConfiguration
Class Inheritance
Imports
java.util.Collections, .HashMap, .Iterator, .LinkedList, .List, .Map, .Set, java.util.concurrent.ConcurrentHashMap, .CopyOnWriteArraySet, java.util.concurrent.atomic.AtomicInteger, org.glassfish.grizzly.http.server.jmxbase.JmxEventListener

Configuration options for a particular HttpServer instance.

Field Summary

Modifier and TypeField and Description
private boolean
pack-priv final Map<HttpHandler, HttpHandlerRegistration[]>
pack-priv final Object
pack-priv final HttpServer
private static final AtomicInteger
private boolean
private final Set<JmxEventListener>
private long
maxPayloadRemainderToSkip

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.

private final HttpServerMonitoringConfig
private String
pack-priv final List<HttpHandler>
private static final HttpHandlerRegistration[]
private final Map<HttpHandler, HttpHandlerRegistration[]>
Inherited from org.glassfish.grizzly.http.server.ServerFilterConfiguration:
MAX_REQUEST_PARAMETERSUSE_SEND_FILE

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
addHttpHandler(final HttpHandler httpHandler)

Adds the specified HttpHandler as a root handler.

public void
addHttpHandler(final HttpHandler httpHandler, final String...
context path mapping information.
mappings
)

Adds the specified HttpHandler with its associated mapping(s).

public void
addHttpHandler(final HttpHandler httpHandler, HttpHandlerRegistration...
context path mapping information.
mapping
)

Adds the specified HttpHandler with its associated mapping(s).

public void
addJmxEventListener(final JmxEventListener
the JmxEventListener to add.
listener
)

Add a JmxEventListener which will be notified when the HttpServer is started and JMX was enabled prior to starting or if the HttpServer was started with JMX disabled, but JMX was enabled at a later point in time.

public Map<HttpHandler, String[]>

Returns:

the HttpHandler map.
getHttpHandlers
()
Deprecated please use getHttpHandlersWithMapping()

Returns the HttpHandler map.

public Map<HttpHandler, HttpHandlerRegistration[]>

Returns:

the HttpHandler map.
getHttpHandlersWithMapping
()

Returns the HttpHandler map.

public Set<JmxEventListener>
getJmxEventListeners()

Returns: an Iterator of all registered JmxEventListeners.

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.

public HttpServerMonitoringConfig

Returns:

the web server monitoring config.
getMonitoringConfig
()

Get the web server monitoring config.

public String
getName()

Returns: the logical name of this HttpServer instance.

public boolean

Returns:

true if "undefined" methods support payload, or false otherwise
isAllowPayloadForUndefinedHttpMethods
()

The flag, which enables/disables payload support for HTTP methods, for which HTTP spec doesn't clearly state whether they support payload.

public boolean
isJmxEnabled()

Returns: true if JMX has been enabled for this HttpServer.

public synchronized boolean

Returns:

true, if the operation was successful, otherwise false
removeHttpHandler
(final HttpHandler httpHandler)

Removes the specified HttpHandler.

public void
removeJmxEventListener(final JmxEventListener
the JmxEventListener to remove.
listener
)

Removes the specified JmxEventListener.

public void
setAllowPayloadForUndefinedHttpMethods(boolean
true if "undefined" methods support payload, or false otherwise
allowPayloadForUndefinedHttpMethods
)

The flag, which enables/disables payload support for HTTP methods, for which HTTP spec doesn't clearly state whether they support payload.

public void
setJmxEnabled(boolean
true to enable JMX otherwise false
jmxEnabled
)

Enables JMX for this HttpServer.

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.

public void
setName(String
server name
name
)

Sets the logical name of this HttpServer instance.

Inherited from org.glassfish.grizzly.http.server.ServerFilterConfiguration:
getBackendConfigurationgetDefaultErrorPageGeneratorgetDefaultQueryEncodinggetHttpServerNamegetHttpServerVersiongetMaxBufferedPostSizegetMaxFormPostSizegetMaxPostSizegetMaxRequestParametersgetSchemegetSessionManagergetSessionTimeoutSecondsisGracefulShutdownSupportedisPassTraceRequestisReuseSessionIDisSendFileEnabledisTraceEnabledsetBackendConfigurationsetDefaultErrorPageGeneratorsetDefaultQueryEncodingsetGracefulShutdownSupportedsetHttpServerNamesetHttpServerVersionsetMaxBufferedPostSizesetMaxFormPostSizesetMaxPostSizesetMaxRequestParameterssetPassTraceRequestsetReuseSessionIDsetSchemesetSendFileEnabledsetSessionManagersetSessionTimeoutSecondssetTraceEnabled

Field Detail

allowPayloadForUndefinedHttpMethodsback to summary
private boolean allowPayloadForUndefinedHttpMethods
handlersback to summary
pack-priv final Map<HttpHandler, HttpHandlerRegistration[]> handlers
handlersSyncback to summary
pack-priv final Object handlersSync
instanceback to summary
pack-priv final HttpServer instance
INSTANCE_COUNTback to summary
private static final AtomicInteger INSTANCE_COUNT
jmxEnabledback to summary
private boolean jmxEnabled
jmxEventListenersback to summary
private final Set<JmxEventListener> jmxEventListeners
maxPayloadRemainderToSkipback to summary
private long maxPayloadRemainderToSkip

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 - HttpServerFilter will close the connection.

monitoringConfigback to summary
private final HttpServerMonitoringConfig monitoringConfig
nameback to summary
private String name
orderedHandlersback to summary
pack-priv final List<HttpHandler> orderedHandlers
ROOT_MAPPINGback to summary
private static final HttpHandlerRegistration[] ROOT_MAPPING
unmodifiableHandlersback to summary
private final Map<HttpHandler, HttpHandlerRegistration[]> unmodifiableHandlers

Constructor Detail

ServerConfigurationback to summary
pack-priv ServerConfiguration(HttpServer instance)

Method Detail

addHttpHandlerback to summary
public void addHttpHandler(final HttpHandler httpHandler)

Adds the specified HttpHandler as a root handler.

Parameters
httpHandler:HttpHandler

a HttpHandler

addHttpHandlerback to summary
public void addHttpHandler(final HttpHandler httpHandler, final String... mappings)

Adds the specified HttpHandler with its associated mapping(s). Requests will be dispatched to a HttpHandler based on these mapping values.

Parameters
httpHandler:HttpHandler

a HttpHandler

mappings:String[]

context path mapping information.

addHttpHandlerback to summary
public void addHttpHandler(final HttpHandler httpHandler, HttpHandlerRegistration... mapping)

Adds the specified HttpHandler with its associated mapping(s). Requests will be dispatched to a HttpHandler based on these mapping values.

Parameters
httpHandler:HttpHandler

a HttpHandler

mapping:HttpHandlerRegistration[]

context path mapping information.

addJmxEventListenerback to summary
public void addJmxEventListener(final JmxEventListener listener)

Add a JmxEventListener which will be notified when the HttpServer is started and JMX was enabled prior to starting or if the HttpServer was started with JMX disabled, but JMX was enabled at a later point in time.

Parameters
listener:JmxEventListener

the JmxEventListener to add.

getHttpHandlersback to summary
public Map<HttpHandler, String[]> getHttpHandlers()

Deprecated

please use getHttpHandlersWithMapping()

Returns the HttpHandler map. Please note, the returned map is read-only.

Returns:Map<HttpHandler, String[]>

the HttpHandler map.

Annotations
@Deprecated
getHttpHandlersWithMappingback to summary
public Map<HttpHandler, HttpHandlerRegistration[]> getHttpHandlersWithMapping()

Returns the HttpHandler map. Please note, the returned map is read-only.

Returns:Map<HttpHandler, HttpHandlerRegistration[]>

the HttpHandler map.

getJmxEventListenersback to summary
public Set<JmxEventListener> getJmxEventListeners()
Returns:Set<JmxEventListener>

an Iterator of all registered JmxEventListeners.

getMaxPayloadRemainderToSkipback to summary
public long getMaxPayloadRemainderToSkip()
Returns:long

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
getMonitoringConfigback to summary
public HttpServerMonitoringConfig getMonitoringConfig()

Get the web server monitoring config.

Returns:HttpServerMonitoringConfig

the web server monitoring config.

getNameback to summary
public String getName()
Returns:String

the logical name of this HttpServer instance. If no name is explicitly specified, the default value will be HttpServer. If there is more than once HttpServer per virtual machine, the server name will be HttpServer-[(instance count - 1)].

isAllowPayloadForUndefinedHttpMethodsback to summary
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:boolean

true if "undefined" methods support payload, or false otherwise

Since
2.3.12
isJmxEnabledback to summary
public boolean isJmxEnabled()
Returns:boolean

true if JMX has been enabled for this HttpServer. If true the HttpServer management object will be registered at the root of the JMX tree with the name of [instance-name] where instance name is the value returned by getName.

removeHttpHandlerback to summary
public synchronized boolean removeHttpHandler(final HttpHandler httpHandler)

Removes the specified HttpHandler.

Returns:boolean

true, if the operation was successful, otherwise false

removeJmxEventListenerback to summary
public void removeJmxEventListener(final JmxEventListener listener)

Removes the specified JmxEventListener.

Parameters
listener:JmxEventListener

the JmxEventListener to remove.

setAllowPayloadForUndefinedHttpMethodsback to summary
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:boolean

true if "undefined" methods support payload, or false otherwise

Since
2.3.12
setJmxEnabledback to summary
public void setJmxEnabled(boolean jmxEnabled)

Enables JMX for this HttpServer. This value can be changed at runtime.

Parameters
jmxEnabled:boolean

true to enable JMX otherwise false

setMaxPayloadRemainderToSkipback to summary
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.

Since
2.3.13
setNameback to summary
public void setName(String name)

Sets the logical name of this HttpServer instance. The logical name cannot be changed after the server has been started.

Parameters
name:String

server name