|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.http.server.HttpServer
public class HttpServer
| Field Summary | |
|---|---|
protected GrizzlyJmxManager |
jmxManager
|
protected JmxObject |
managementObject
|
| Constructor Summary | |
|---|---|
HttpServer()
|
|
| Method Summary | |
|---|---|
void |
addListener(NetworkListener listener)
Adds the specified listener to the server instance. |
static HttpServer |
createSimpleServer()
|
static HttpServer |
createSimpleServer(java.lang.String path)
|
static HttpServer |
createSimpleServer(java.lang.String path,
int port)
|
static HttpServer |
createSimpleServer(java.lang.String path,
PortRange range)
|
protected void |
disableJMX()
|
protected void |
enableJMX()
|
HttpHandler |
getHttpHandler()
|
NetworkListener |
getListener(java.lang.String name)
|
java.util.Collection<NetworkListener> |
getListeners()
|
JmxObject |
getManagementObject(boolean clear)
|
ServerConfiguration |
getServerConfiguration()
|
boolean |
isStarted()
|
NetworkListener |
removeListener(java.lang.String name)
Removes the NetworkListener associated with the specified
name. |
void |
start()
Starts the HttpServer. |
void |
stop()
Stops the HttpServer instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected volatile GrizzlyJmxManager jmxManager
protected volatile JmxObject managementObject
| Constructor Detail |
|---|
public HttpServer()
| Method Detail |
|---|
public final ServerConfiguration getServerConfiguration()
ServerConfiguration used to configure this
HttpServer instancepublic void addListener(NetworkListener listener)
Adds the specified listener to the server instance.
If the server is already running when this method is called, the listener will be started.
listener - the NetworkListener to associate with this
server instance.public NetworkListener getListener(java.lang.String name)
name - the NetworkListener name.
NetworkListener, if any, associated with the
specified name.public java.util.Collection<NetworkListener> getListeners()
read only Collection over the listeners
associated with this HttpServer instance.public NetworkListener removeListener(java.lang.String name)
Removes the NetworkListener associated with the specified
name.
If the server is running when this method is invoked, the listener will be stopped before being returned.
name - the name of the NetworkListener to remove.
public void start()
throws java.io.IOException
Starts the HttpServer.
java.io.IOException - if an error occurs while attempting to start the
server.public HttpHandler getHttpHandler()
HttpHandler used by this HttpServer
instance.public boolean isStarted()
true if this HttpServer has
been started.public JmxObject getManagementObject(boolean clear)
public void stop()
Stops the HttpServer instance.
public static HttpServer createSimpleServer()
HttpServer configured to listen to requests
on NetworkListener.DEFAULT_NETWORK_HOST:NetworkListener.DEFAULT_NETWORK_PORT,
using the directory in which the server was launched the server's document root.public static HttpServer createSimpleServer(java.lang.String path)
path - the document root.
HttpServer configured to listen to requests
on NetworkListener.DEFAULT_NETWORK_HOST:NetworkListener.DEFAULT_NETWORK_PORT,
using the specified path as the server's document root.
public static HttpServer createSimpleServer(java.lang.String path,
int port)
path - the document root.port - the network port to which this listener will bind.
HttpServer configured to listen to requests
on NetworkListener.DEFAULT_NETWORK_HOST:port,
using the specified path as the server's document root.
public static HttpServer createSimpleServer(java.lang.String path,
PortRange range)
path - the document root.range - port range to attempt to bind to.
HttpServer configured to listen to requests
on NetworkListener.DEFAULT_NETWORK_HOST:[port-range],
using the specified path as the server's document root.protected void enableJMX()
protected void disableJMX()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||