|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grizzly.tcp.StaticResourcesAdapter
public class StaticResourcesAdapter
Simple HTTP based Web Server. Part of this class is from Tomcat sandbox code from Costin Manolache.
Field Summary | |
---|---|
protected boolean |
commitErrorResponse
Commit the 404 response automatically. |
protected Logger |
logger
|
Fields inherited from interface com.sun.grizzly.tcp.Adapter |
---|
CONNECTION_PROCESSING_COMPLETED, CONNECTION_PROCESSING_STARTED, REQUEST_PROCESSING_COMPLETED, REQUEST_PROCESSING_STARTED |
Constructor Summary | |
---|---|
StaticResourcesAdapter()
|
|
StaticResourcesAdapter(String rootFolder)
|
Method Summary | |
---|---|
void |
afterService(Request req,
Response res)
Finish the response and recycle the request/response tokens. |
protected void |
customizedErrorPage(Request req,
Response res)
Customize the error pahe |
void |
fireAdapterEvent(String string,
Object object)
Not Used. |
Logger |
getLogger()
|
String |
getRootFolder()
|
void |
service(Request req,
Response res)
Call the service method, and notify all listeners |
protected void |
service(String uri,
Request req,
Response res)
Lookup a resource based on the request URI. |
void |
setLogger(Logger logger)
|
void |
setRootFolder(String newRoot)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Logger logger
protected boolean commitErrorResponse
Constructor Detail |
---|
public StaticResourcesAdapter()
public StaticResourcesAdapter(String rootFolder)
Method Detail |
---|
public void service(Request req, Response res) throws Exception
Adapter
service
in interface Adapter
Exception
- if an error happens during handling of
the request. Common errors are:
protected void service(String uri, Request req, Response res) throws Exception
uri
- The request URIreq
- The request objectsres
- The response object
Exception
protected void customizedErrorPage(Request req, Response res) throws Exception
req
- res
-
Exception
public void afterService(Request req, Response res) throws Exception
Adapter
afterService
in interface Adapter
Exception
public void fireAdapterEvent(String string, Object object)
fireAdapterEvent
in interface Adapter
string
- object
- public String getRootFolder()
public void setRootFolder(String newRoot)
public Logger getLogger()
public void setLogger(Logger logger)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |