org.glassfish.grizzly.http.server
Class ServerConfiguration

java.lang.Object
  extended by org.glassfish.grizzly.http.server.ServerFilterConfiguration
      extended by org.glassfish.grizzly.http.server.ServerConfiguration

public class ServerConfiguration
extends ServerFilterConfiguration

Configuration options for a particular HttpServer instance.


Method Summary
 void addHttpService(HttpRequestProcessor httpService, String... mapping)
          Adds the specified HttpRequestProcessor with its associated mapping(s).
 void addJmxEventListener(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.
 Map<HttpRequestProcessor,String[]> getHttpServices()
          Returns the HttpRequestProcessor map.
 Set<JmxEventListener> getJmxEventListeners()
           
 HttpServerMonitoringConfig getMonitoringConfig()
          Get the web server monitoring config.
 String getName()
           
 boolean isJmxEnabled()
           
 boolean removeHttpService(HttpRequestProcessor httpService)
          Removes the specified HttpRequestProcessor.
 void removeJmxEventListener(JmxEventListener listener)
          Removes the specified JmxEventListener.
 void setJmxEnabled(boolean jmxEnabled)
          Enables JMX for this HttpServer.
 void setName(String name)
          Sets the logical name of this HttpServer instance.
 
Methods inherited from class org.glassfish.grizzly.http.server.ServerFilterConfiguration
getHttpServerName, getHttpServerVersion, setHttpServerName, setHttpServerVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addHttpService

public void addHttpService(HttpRequestProcessor httpService,
                           String... mapping)
Adds the specified HttpRequestProcessor with its associated mapping(s). Requests will be dispatched to a HttpRequestProcessor based on these mapping values.

Parameters:
httpService - a HttpRequestProcessor
mapping - context path mapping information.

removeHttpService

public boolean removeHttpService(HttpRequestProcessor httpService)
Removes the specified HttpRequestProcessor.

Returns:
true, if the operation was successful, otherwise false

getHttpServices

public Map<HttpRequestProcessor,String[]> getHttpServices()
Returns the HttpRequestProcessor map. Please note, the returned map is read-only.

Returns:
the HttpRequestProcessor map.

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 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)].

setName

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 - server name

isJmxEnabled

public boolean isJmxEnabled()
Returns:
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().

setJmxEnabled

public void setJmxEnabled(boolean jmxEnabled)
Enables JMX for this HttpServer. This value can be changed at runtime.

Parameters:
jmxEnabled - true to enable JMX otherwise false

addJmxEventListener

public void addJmxEventListener(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 - the JmxEventListener to add.

removeJmxEventListener

public void removeJmxEventListener(JmxEventListener listener)
Removes the specified JmxEventListener.

Parameters:
listener - the JmxEventListener to remove.

getJmxEventListeners

public Set<JmxEventListener> getJmxEventListeners()
Returns:
an Iterator of all registered JmxEventListeners.


Copyright © 2010 Oracle Corpration. All Rights Reserved.