org.gcube.smartgears.extensions
Class HttpController
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.gcube.smartgears.extensions.HttpExtension
org.gcube.smartgears.extensions.HttpController
- All Implemented Interfaces:
- Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, ApplicationExtension
- Direct Known Subclasses:
- RemoteResource
public class HttpController
- extends HttpExtension
An HttpExtension that dispatches to one or more ApiResources, handling the generic, HTTP-aspects
aspects of their client interactions
- Author:
- Fabio Simeoni
- See Also:
- Serialized Form
| Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service |
| Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.Servlet |
destroy, getServletConfig, getServletInfo, init |
HttpController
public HttpController(String name,
String mapping)
- Creates an instance with a given name and a given mapping.
- Parameters:
name - the namemapping - the mapping
addResources
public void addResources(ApiResource... resources)
- Adds one ore more
ApiResources to this controller.
- Parameters:
resources - the resources
init
public void init(ApplicationContext context)
throws Exception
- Description copied from interface:
ApplicationExtension
- Initialises the extensions with the context of the application.
- Specified by:
init in interface ApplicationExtension- Overrides:
init in class HttpExtension
- Parameters:
context - the application context
- Throws:
Exception - if the extension cannot be initialised
excludes
public Set<String> excludes()
- Description copied from interface:
ApplicationExtension
- Returns the set of request paths that should be excluded from request management.
- Specified by:
excludes in interface ApplicationExtension- Overrides:
excludes in class HttpExtension
- Returns:
- the set of request paths that should be excluded from request management
service
public final void service(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse resp)
throws javax.servlet.ServletException,
IOException
- Specified by:
service in interface javax.servlet.Servlet- Overrides:
service in class javax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
Copyright © 2013. All Rights Reserved.