Class ControllerEntryPoint

java.lang.Object
com.blackrook.small.dispatch.DispatchEntryPoint<ControllerComponent>
com.blackrook.small.dispatch.controller.ControllerEntryPoint
All Implemented Interfaces:
DispatchMVCEntryPoint<SmallResponse>

public class ControllerEntryPoint extends DispatchEntryPoint<ControllerComponent> implements DispatchMVCEntryPoint<SmallResponse>
Method descriptor class, specifically for controllers.
Author:
Matthew Tropiano
  • Constructor Details

    • ControllerEntryPoint

      public ControllerEntryPoint(ControllerComponent controllerProfile, Method method)
      Creates an entry method around a service profile instance.
      Parameters:
      controllerProfile - the service instance.
      method - the method invoked.
  • Method Details

    • getRequestMethods

      public RequestMethod[] getRequestMethods()
      Returns:
      the request methods handled by this entry point.
    • getPath

      public String getPath()
      Returns:
      the full path of the entry method.
    • getMimeType

      public String getMimeType()
      Returns:
      the forced MIME type to use. If null, the dispatcher decides it.
    • getOutputType

      public ControllerComponent.Output getOutputType()
      Returns:
      method's output type, if controller call.
    • isNoCache

      public boolean isNoCache()
      Returns:
      true, if a directive will be sent to the client to not cache the response data, false if not.
    • getFilterChain

      public Class<?>[] getFilterChain()
      Returns:
      this method's full filter chain (package to controller to this method).
    • handleCall

      public SmallResponse handleCall(RequestMethod requestMethod, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Map<String,String> pathVariableMap, Map<String,javax.servlet.http.Cookie> cookieMap, HashDequeMap<String,Part> partMap) throws InvocationTargetException, javax.servlet.ServletException, IOException
      Description copied from interface: DispatchMVCEntryPoint
      Handles an MVC call.
      Specified by:
      handleCall in interface DispatchMVCEntryPoint<SmallResponse>
      Parameters:
      requestMethod - the incoming request method.
      request - the HTTP request.
      response - the HTTP response.
      pathVariableMap - the path variable map.
      cookieMap - the cookie map.
      partMap - the map of name to multipart parts.
      Returns:
      the return value.
      Throws:
      InvocationTargetException - if the underlying call throws an exception.
      NotFoundException - if a file that was going to be sent does not exist.
      UnsupportedMediaTypeException - if an incoming or outgoing type is unsupported.
      NoConverterException - if an object could not be converted to a serializable format for transmission.
      javax.servlet.ServletException - if any other servlet exception happens.
      UnsupportedEncodingException - if an encoding type is not supported by this server.
      IOException - if an IO Error occurs.