All Downloads are FREE. Search and download functionalities are using the official Maven repository.

public.javadoc.org.spincast.core.controllers.SpincastFrontController.html Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version






SpincastFrontController (org.spincast:spincast-framework 1.0.0 API)












org.spincast.core.controllers

Class SpincastFrontController<R extends RequestContext<R>,W extends WebsocketContext<?>>

    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
    • Method Detail

      • getRouter

        protected Router<R,W> getRouter()
      • getDictionary

        protected Dictionary getDictionary()
      • getServer

        protected Server getServer()
      • getRequestContextType

        protected Type getRequestContextType()
      • getJsonManager

        protected JsonManager getJsonManager()
      • getXmlManager

        protected XmlManager getXmlManager()
      • handle

        public void handle(Object exchange)
        Front controller's handle() method, called by the HTTP server.
        Specified by:
        handle in interface FrontController
        Parameters:
        exchange - an object representing the current request, provided by the HTTP server
      • prepareNotFoundRouting

        protected RoutingResult<R> prepareNotFoundRouting(Object exchange,
                                                          R requestContext)
        Prepares a direct Not Found routing.
      • prepareNotFoundRouting

        protected RoutingResult<R> prepareNotFoundRouting(Object exchange,
                                                          R requestContext,
                                                          boolean alreadyTried)
        Prepares a direct Not Found routing.
      • addDefaultNotFoundRoute

        protected void addDefaultNotFoundRoute()
        Add the default Not Found route.
      • getDefaultNotFoundHandler

        protected Handler<R> getDefaultNotFoundHandler()
        Create the default Not Found handler
      • getNotFoundHtmlContent

        protected String getNotFoundHtmlContent(String message)
      • getNotFoundJsonContent

        protected String getNotFoundJsonContent(String message)
      • getNotFoundXmlContent

        protected String getNotFoundXmlContent(String message)
      • getNotFoundPlainTextContent

        protected String getNotFoundPlainTextContent(String message)
      • getDefaultNotFoundHandlerNotFoundMessage

        protected String getDefaultNotFoundHandlerNotFoundMessage()
        The message to send for the default Not Found handler.
      • resetResponse

        protected void resetResponse(R requestContext)
      • addDependenciesInCustomRequestScope

        protected void addDependenciesInCustomRequestScope(R requestContext)
        Add dependencies to the custom request scope
      • addRequestContextInCustomRequestScope

        protected void addRequestContextInCustomRequestScope(R requestContext)
        Add the request context objects in the cutom request scope
      • callRouteHandlers

        protected void callRouteHandlers(R requestContext,
                                         RoutingResult<R> routingResult)
                                  throws Exception
        Call the handlers, in order they are specified.
        Throws:
        Exception
      • manageRedirectException

        protected void manageRedirectException(RedirectException ex,
                                               R context,
                                               RoutingResult<R> routingResult)
        Manage a RedirectException exception.
      • createForwardedRequestContext

        protected R createForwardedRequestContext(R context,
                                                  String fullUrlOrRelativePathAndQueryString)
      • validateExchange

        protected Object validateExchange(Object exchange)
        Validate/modify the exchange before the handling.
      • findRouteMatch

        protected RoutingResult<R> findRouteMatch(R requestContext)
        Find the route handlers to call.
      • defaultPublicExceptionHandling

        protected void defaultPublicExceptionHandling(Object exchange,
                                                      PublicException publicException)
                                               throws Throwable
        Default exception handling for exceptions with public information.
        Throws:
        Throwable
      • defaultPrivateExceptionHandling

        protected void defaultPrivateExceptionHandling(Object exchange,
                                                       Throwable exception)
                                                throws Throwable
        Default exception handling for private exceptions
        Throws:
        Throwable
      • sendErrorUsingBestMatchContentType

        protected void sendErrorUsingBestMatchContentType(Object exchange,
                                                          String errorMessage,
                                                          Integer statusCode)
                                                   throws Throwable
        Send an error to the client.
        Throws:
        Throwable
      • getDefaultExceptionHandlingCharset

        protected String getDefaultExceptionHandlingCharset()
        Charset used by the default exception handling.
      • getInternalErrorJsonContent

        protected String getInternalErrorJsonContent(String errorMessage)
      • getInternalErrorXmlContent

        protected String getInternalErrorXmlContent(String errorMessage)
      • getInternalErrorHtmlContent

        protected String getInternalErrorHtmlContent(String errorMessage)
      • getInternalErrorTextContent

        protected String getInternalErrorTextContent(String errorMessage)
      • lastResortExceptionHandling

        protected void lastResortExceptionHandling(Throwable originalException,
                                                   Throwable defaultHandlingException)
        Called when the default exception handler itself throws an exception... Last resort!

Copyright © 2019. All rights reserved.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy