Expresso 5-6

com.jcorporate.expresso.core.controller
Interface ControllerFactory

All Known Implementing Classes:
DefaultControllerFactory, ExpressoActionServlet

public interface ControllerFactory

Abstract interface for creating a controller. Some situations need to cache the resulting controller. Some situations just need to create it and run. Some need to merge with Struts. This is the interface that ties it all in.


Method Summary
 Controller getController(ControllerRequest request)
          This method is similar to getController(className) except that it may try to route the construction call to the appropriate servlet constructor IF the request is a HttpServletControllerRequest AND the implementation chooses to accept this mission.
 Controller getController(String className)
          Dumb construction method.... just tries to create the controller.
 Controller getController(String module, String className)
          Dumb construction method.... just tries to create the controller.
 

Method Detail

getController

public Controller getController(String className)
                         throws ControllerException
Dumb construction method.... just tries to create the controller. This may have the limitation if there's more that one ActionServlet running around that the object cache gets sent to the wrong ActionServlet resulting in extra object contructions.

Additional notes by Peter Pilgrim Sun Feb 16 13:53:07 GMT 2003

Struts 1.1 introduces the concept of Modules to further complicate the idea of instantiating an action controller. It is assume that this method retrieve a controller from the default root module.

Parameters:
className - The className to instantiate
Returns:
a constructed controller
Throws:
ControllerException - if there's an error instantiating the controller

getController

public Controller getController(String module,
                                String className)
                         throws ControllerException
Dumb construction method.... just tries to create the controller. This may have the limitation if there's more that one ActionServlet running around that the object cache gets sent to the wrong ActionServlet resulting in extra object contructions.

Additional notes by Peter Pilgrim Sun Feb 16 13:53:07 GMT 2003

Struts 1.1 introduces the concept of Modules to further complicate the idea of instantiating an action controller. It is assume that this method retrieve a controller specifically from the named module. If such an implementation aims to support modules. If not it can legally ignore the module parameter

Parameters:
className - The className to instantiate
module - The module to instantiate
Returns:
a constructed controller
Throws:
ControllerException - if there's an error instantiating the controller

getController

public Controller getController(ControllerRequest request)
                         throws ControllerException
This method is similar to getController(className) except that it may try to route the construction call to the appropriate servlet constructor IF the request is a HttpServletControllerRequest AND the implementation chooses to accept this mission.

Parameters:
request - The ControllerRequest that has all the parameters we need to construct the appropriate controller.

Additional notes by Peter Pilgrim Sun Feb 16 13:53:07 GMT 2003

Struts 1.1 introduces the concept of Modules to further complicate the idea of instantiating an action controller. It is assume that this method retrieve a controller specifically from the named module. If such an implementation aims to support modules. Since the controller factory could retrieve an HttpServletRequest from the ControllerRequest and then find the appropriate module name, therefore no extra parameter was required for this method.

Returns:
instantiated controller
Throws:
ControllerException - if there's an error instantiating the controller

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.