com.sun.grizzly.http.servlet.deployer
Class WebAppAdapter

java.lang.Object
  extended by com.sun.grizzly.tcp.StaticResourcesAdapter
      extended by com.sun.grizzly.tcp.http11.GrizzlyAdapter
          extended by com.sun.grizzly.http.servlet.ServletAdapter
              extended by com.sun.grizzly.http.servlet.deployer.WebAppAdapter
All Implemented Interfaces:
Adapter

public class WebAppAdapter
extends ServletAdapter

WebApp Adapter.

Since:
Aug 25, 2009
Author:
Sebastien Dionne, Hubert Iwaniuk

Field Summary
 
Fields inherited from class com.sun.grizzly.http.servlet.ServletAdapter
classLoader, INCREMENT, initialize, LOAD_ON_STARTUP, properties, REQUEST_RESPONSE_NOTES, SERVLETCONFIG_NOTES, servletInstance
 
Fields inherited from class com.sun.grizzly.tcp.http11.GrizzlyAdapter
ADAPTER_NOTES, ALLOW_BACKSLASH, chunkingDisabled
 
Fields inherited from class com.sun.grizzly.tcp.StaticResourcesAdapter
cache, commitErrorResponse, fileFolders, resourcesContextPath
 
Constructor Summary
WebAppAdapter()
          Blank constructor
WebAppAdapter(String root, String context, WebApp webApp, ClassLoader webAppCL, WebApp webdefault)
          Default constructor, takes care of setting up adapter.
 
Method Summary
protected  ServletAdapter createServletAdapter(String context, String servletUrlPattern)
           
static String[] getAlias(ServletAdapter sa, Collection<String> aliases)
           
 Map<ServletAdapter,List<String>> getServletAdaptersToAlises(WebApp webApp, String context)
           
static String getServletPath(String path)
           
 Map<GrizzlyAdapter,Set<String>> getToRegister()
           
 void service(GrizzlyRequest request, GrizzlyResponse response)
          This method should contains the logic for any http extension to the Grizzly HTTP Webserver.
protected static void setContextParams(WebApp webApp, ServletAdapter sa)
           
protected static void setFilters(WebApp webApp, ServletAdapter sa)
           
protected static void setListeners(WebApp webApp, ServletAdapter sa)
           
protected static void setServlet(WebApp webApp, ServletAdapter sa, ServletMapping servletMapping)
           
 
Methods inherited from class com.sun.grizzly.http.servlet.ServletAdapter
addContextParameter, addFilter, addFilter, addInitParameter, addServletListener, afterService, configureClassLoader, configureServletEnv, containsInitParameter, customizeErrorPage, destroy, doService, getClassLoader, getContextParameters, getContextPath, getInitParameter, getListeners, getName, getProperty, getServletCtx, getServletInstance, getServletPath, isLoadOnStartup, loadServlet, newServletAdapter, removeInitParameter, removeProperty, removeServletListener, setClassLoader, setContextPath, setDispatcherHelper, setProperty, setServletInstance, setServletPath, start
 
Methods inherited from class com.sun.grizzly.tcp.http11.GrizzlyAdapter
afterService, isAllowEncodedSlash, isDecodeURL, isHandleStaticResources, service, setAllowEncodedSlash, setDecodeUrl, setHandleStaticResources
 
Methods inherited from class com.sun.grizzly.tcp.StaticResourcesAdapter
addRootFolder, customizedErrorPage, getDefaultContentType, getResourcesContextPath, getRootFolder, getRootFolders, initWebDir, isUseSendFile, service, setDefaultContentType, setLogger, setResourcesContextPath, setRootFolder, setUseSendFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebAppAdapter

public WebAppAdapter()
Blank constructor


WebAppAdapter

public WebAppAdapter(String root,
                     String context,
                     WebApp webApp,
                     ClassLoader webAppCL,
                     WebApp webdefault)
Default constructor, takes care of setting up adapter.

Parameters:
root - Root folder, for serving static resources
context - Context to be deployed to.
webApp - Web application to be run by this adapter.
webAppCL - Web application class loader.
webdefault - Default web application.
Method Detail

service

public void service(GrizzlyRequest request,
                    GrizzlyResponse response)
Description copied from class: ServletAdapter
This method should contains the logic for any http extension to the Grizzly HTTP Webserver.

Overrides:
service in class ServletAdapter
Parameters:
request - The GrizzlyRequest
response - The GrizzlyResponse

getServletAdaptersToAlises

public Map<ServletAdapter,List<String>> getServletAdaptersToAlises(WebApp webApp,
                                                                   String context)
Parameters:
webApp - Contains the info about the web.xml
context - context of the application
Returns:
a list of ServletAdapter with the UrlPattern for each Servlet.

setServlet

protected static void setServlet(WebApp webApp,
                                 ServletAdapter sa,
                                 ServletMapping servletMapping)

getServletPath

public static String getServletPath(String path)
Parameters:
path - Path to convert.
Returns:
Converted path.

createServletAdapter

protected ServletAdapter createServletAdapter(String context,
                                              String servletUrlPattern)

setFilters

protected static void setFilters(WebApp webApp,
                                 ServletAdapter sa)

setListeners

protected static void setListeners(WebApp webApp,
                                   ServletAdapter sa)

setContextParams

protected static void setContextParams(WebApp webApp,
                                       ServletAdapter sa)

getAlias

public static String[] getAlias(ServletAdapter sa,
                                Collection<String> aliases)
Parameters:
sa - ServletAdapter
aliases - contains the list of UrlPattern for this ServletAdapter
Returns:
the alias list for this ServletAdapter

getToRegister

public Map<GrizzlyAdapter,Set<String>> getToRegister()


Copyright © 2013 Oracle Corporation. All Rights Reserved.