Class WebAppController

java.lang.Object
org.exoplatform.web.WebAppController
All Implemented Interfaces:
org.picocontainer.Startable

public class WebAppController extends Object implements org.picocontainer.Startable
The WebAppController is the entry point of the GateIn service.
  • Field Details

    • HANDLER_PARAM

      public static final QualifiedName HANDLER_PARAM
      .
    • log

      protected static org.exoplatform.services.log.Log log
      .
  • Constructor Details

    • WebAppController

      public WebAppController(org.exoplatform.container.xml.InitParams params) throws Exception
      Must have 'controller.config' as init parameter configuration (in xml) that point to the controller.xml used to initialize navigation controller This service component is a container for applications: PortalApplication, PortletApplication.... It use the navigation controller to route the request to corresponding handlers (config as service plugin)
      Parameters:
      params - the init params
      Throws:
      Exception - any exception
  • Method Details

    • getAttribute

      public Object getAttribute(String name, Object value)
    • getApplication

      public <T extends Application> T getApplication(String appId)
    • getApplicationByType

      public List<Application> getApplicationByType(String type)
    • removeApplication

      public void removeApplication(String appId)
    • getConfigurationPath

      public String getConfigurationPath()
    • loadConfiguration

      public void loadConfiguration(String path) throws IOException, RouterConfigException
      Throws:
      IOException
      RouterConfigException
    • loadConfiguration

      protected void loadConfiguration(URL url) throws RouterConfigException, IOException
      Throws:
      RouterConfigException
      IOException
    • reloadConfiguration

      public void reloadConfiguration() throws RouterConfigException, IOException
      Throws:
      RouterConfigException
      IOException
    • findRoutes

      public String findRoutes(String uri)
    • getHandler

      public WebRequestHandler getHandler(String handlerName)
    • addApplication

      public <T extends Application> T addApplication(T app)
      Add application (portlet, gadget) to the global application map if and only if it has not been registered yet.
      Type Parameters:
      T -
      Parameters:
      app -
      Returns:
    • register

      public void register(WebRequestHandler handler)
      Register an handler as a component plugin, this method is invoked by the kernel with reflection.
      Parameters:
      handler - the handler
    • unregister

      public void unregister(String[] paths)
    • onHandlersInit

      public void onHandlersInit(jakarta.servlet.ServletConfig config) throws Exception
      Delegate init action to handler, for example: PortalRequestHandler have a change to create and register PortalApplication with WebAppController
      Parameters:
      config -
      Throws:
      Exception
    • getRouter

      public Router getRouter()
    • service

      public void service(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) throws Exception

      This is the first method - in the GateIn portal - reached by incoming HTTP request, it acts like a servlet service() method. According to the servlet path used the correct handler is selected and then executed.

      During a request the request life cycle is demarcated by calls to RequestLifeCycle.begin(ExoContainer) and RequestLifeCycle.end().

      Parameters:
      req - the http request
      res - the http response
      Throws:
      Exception - any exception
    • start

      public void start()
      Specified by:
      start in interface org.picocontainer.Startable
    • stop

      public void stop()
      Specified by:
      stop in interface org.picocontainer.Startable