com.stratelia.silverpeas.peasCore.servlets
Class WebComponentManager

java.lang.Object
  extended by com.stratelia.silverpeas.peasCore.servlets.WebComponentManager

public class WebComponentManager
extends Object

This class handles all the route paths of Web Resources. Fisrt time the manager is called by a resource, an initialization is done. It consits of scanning all the methods of the resource to extract these the can be associated to a route (URI path).

Author:
Yohann Chastagnier

Constructor Summary
WebComponentManager()
           
 
Method Summary
static
<CONTROLLER extends WebComponentController<WEB_COMPONENT_REQUEST_CONTEXT>,WEB_COMPONENT_REQUEST_CONTEXT extends WebComponentRequestContext>
void
manageRequestFor(Class<CONTROLLER> webComponentControllerClass, Class<? extends Annotation> httpMethodClass, HttpRequest request, javax.servlet.http.HttpServletResponse response)
          This method must be called before all treatments in order to initilize the Web Component Context associated to the current request.
static
<CONTROLLER extends WebComponentController<WEB_COMPONENT_REQUEST_CONTEXT>,WEB_COMPONENT_REQUEST_CONTEXT extends WebComponentRequestContext>
Navigation
perform(CONTROLLER webComponentController, String path)
          Performs a request path by executing the right method behind and returning the navigation object instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebComponentManager

public WebComponentManager()
Method Detail

manageRequestFor

public static <CONTROLLER extends WebComponentController<WEB_COMPONENT_REQUEST_CONTEXT>,WEB_COMPONENT_REQUEST_CONTEXT extends WebComponentRequestContext> void manageRequestFor(Class<CONTROLLER> webComponentControllerClass,
                                                                                                                                                                                Class<? extends Annotation> httpMethodClass,
                                                                                                                                                                                HttpRequest request,
                                                                                                                                                                                javax.servlet.http.HttpServletResponse response)
This method must be called before all treatments in order to initilize the Web Component Context associated to the current request.

Type Parameters:
CONTROLLER - the type of the Web Component Controller that provides a lot of stuff around the component, the user, etc.
WEB_COMPONENT_REQUEST_CONTEXT - the type of the web component request context.
Parameters:
webComponentControllerClass - the class resource which exposes the methods that will be invoked.
httpMethodClass - the annotation class associated to the current http method of the request.
request - the request itself.
response - the response itself.

perform

public static <CONTROLLER extends WebComponentController<WEB_COMPONENT_REQUEST_CONTEXT>,WEB_COMPONENT_REQUEST_CONTEXT extends WebComponentRequestContext> Navigation perform(CONTROLLER webComponentController,
                                                                                                                                                                             String path)
                          throws Exception
Performs a request path by executing the right method behind and returning the navigation object instance.

Type Parameters:
CONTROLLER - the type of the resource which hosts the method that must be invoked.
WEB_COMPONENT_REQUEST_CONTEXT - the type of the web component context.
Parameters:
webComponentController - the handled component controller.
path - the path that must be matched in finding of the method to invoke.
Returns:
Throws:
Exception


Copyright © 2016 Silverpeas. All Rights Reserved.