|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectFactory
FlowControllerFactory
public class FlowControllerFactory
Factory for creating FlowControllers - user PageFlowControllers and SharedFlowControllers.
| Constructor Summary | |
|---|---|
protected |
FlowControllerFactory()
|
| Method Summary | |
|---|---|
PageFlowController |
createPageFlow(RequestContext context,
Class pageFlowClass)
Create a PageFlowController of the given type. |
PageFlowController |
createPageFlow(RequestContext context,
String pageFlowClassName)
Create a page flow of the given type. |
SharedFlowController |
createSharedFlow(RequestContext context,
Class sharedFlowClass)
Create a SharedFlowController of the given type. |
SharedFlowController |
createSharedFlow(RequestContext context,
String sharedFlowClassName)
Create a SharedFlowController of the given type. |
static FlowControllerFactory |
get(ServletContext servletContext)
Get a FlowControllerFactory. |
Class |
getFlowControllerClass(String className)
Get a FlowController class. |
FlowController |
getFlowControllerInstance(Class flowControllerClass)
Get a FlowController instance, given a FlowController class. |
static GlobalApp |
getGlobalApp(HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
Deprecated. Global.app is deprecated; use shared flows and getSharedFlowsForRequest(RequestContext). |
static PageFlowController |
getPageFlow(Class pageFlowClass,
HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
Deprecated. Use createPageFlow(RequestContext, Class) instead. |
static PageFlowController |
getPageFlow(String pageFlowClassName,
HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
Deprecated. Use createPageFlow(RequestContext, String) instead. |
PageFlowController |
getPageFlowForPath(RequestContext context,
String path)
Get the page flow instance that should be associated with the given path. |
static PageFlowController |
getPageFlowForRelativeURI(HttpServletRequest request,
HttpServletResponse response,
String path,
ServletContext servletContext)
Deprecated. Use getPageFlowForPath(RequestContext, String) instead. |
static PageFlowController |
getPageFlowForRequest(HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
Deprecated. Use getPageFlowForRequest(RequestContext) instead. |
PageFlowController |
getPageFlowForRequest(RequestContext context)
Get the page flow instance that should be associated with the given request. |
static PageFlowController |
getPageFlowForURI(HttpServletRequest request,
HttpServletResponse response,
String uri,
ServletContext servletContext)
Deprecated. Use getPageFlowForPath(RequestContext, String) instead. The URI must be stripped of the
webapp context path before being passed. |
Map |
getSharedFlowsForPath(RequestContext context,
String path)
Get the map of shared flows for the given path. |
Map |
getSharedFlowsForRequest(RequestContext context)
Get the map of shared flows for the given request. |
protected void |
onCreate()
Called after this factory has been created and initialized. |
protected void |
reinit(ServletContext servletContext)
Called to reinitialize this instance, most importantly after it has been serialized/deserialized. |
| Methods inherited from class Factory |
|---|
getConfig, getServletContext |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected FlowControllerFactory()
| Method Detail |
|---|
protected void onCreate()
Factory
onCreate in class Factoryprotected void reinit(ServletContext servletContext)
reinit in class FactoryservletContext - the current ServletContext.public static FlowControllerFactory get(ServletContext servletContext)
servletContext - the current ServletContext.
public PageFlowController getPageFlowForRequest(RequestContext context)
throws InstantiationException,
IllegalAccessException
context - a RequestContext object which contains the current request and response.
PageFlowController for the request, or null if none was found.
InstantiationException
IllegalAccessException
public PageFlowController getPageFlowForPath(RequestContext context,
String path)
throws InstantiationException,
IllegalAccessException
context - a RequestContext object which contains the current request and response.path - a webapp-relative path. The path should not contain the webapp context path.
PageFlowController for the given path, or null if none was found.
InstantiationException
IllegalAccessException
public PageFlowController createPageFlow(RequestContext context,
String pageFlowClassName)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
context - a RequestContext object which contains the current request and response.pageFlowClassName - the type name of the desired page flow.
PageFlowController, or null if none was found.
ClassNotFoundException
InstantiationException
IllegalAccessException
public PageFlowController createPageFlow(RequestContext context,
Class pageFlowClass)
throws InstantiationException,
IllegalAccessException
PageFlowController of the given type. The PageFlowController stack (for
nesting) will be cleared or pushed, and the new instance will be stored as the current
PageFlowController.
context - a RequestContext object which contains the current request and response.pageFlowClass - the type of the desired PageFlowController.
null if none was found.
InstantiationException
IllegalAccessException
public SharedFlowController createSharedFlow(RequestContext context,
String sharedFlowClassName)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
SharedFlowController of the given type.
context - a RequestContext object which contains the current request and response.sharedFlowClassName - the type name of the desired SharedFlowController.
null if none was found.
ClassNotFoundException
InstantiationException
IllegalAccessException
public SharedFlowController createSharedFlow(RequestContext context,
Class sharedFlowClass)
throws InstantiationException,
IllegalAccessException
SharedFlowController of the given type.
context - a RequestContext object which contains the current request and response.sharedFlowClass - the type of the desired SharedFlowController.
null if none was found.
InstantiationException
IllegalAccessException
public Map getSharedFlowsForRequest(RequestContext context)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
sharedFlowRefs attribute of
@Jpf.Controller) in the page flow for the request.
context - a RequestContext object which contains the current request and response.
SharedFlowController.
ClassNotFoundException - if a declared shared flow class could not be found.
InstantiationException - if a declared shared flow class could not be instantiated.
IllegalAccessException - if a declared shared flow class was not accessible.
public Map getSharedFlowsForPath(RequestContext context,
String path)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
sharedFlowRefs attribute of
@Jpf.Controller) in the page flow for the path.
context - a RequestContext object which contains the current request and response.path - a webapp-relative path. The path should not contain the webapp context path.
SharedFlowController.
ClassNotFoundException - if a declared shared flow class could not be found.
InstantiationException - if a declared shared flow class could not be instantiated.
IllegalAccessException - if a declared shared flow class was not accessible.
public Class getFlowControllerClass(String className)
throws ClassNotFoundException
className - the name of the FlowController class to load.
FlowController class.
ClassNotFoundException - if the requested class could not be found.
public FlowController getFlowControllerInstance(Class flowControllerClass)
throws InstantiationException,
IllegalAccessException
flowControllerClass - the Class, which must be assignable to FlowController.
InstantiationException
IllegalAccessException
public static PageFlowController getPageFlowForRequest(HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
getPageFlowForRequest(RequestContext) instead.
request - the current HttpServletRequest.response - the current HttpServletResponse.servletContext - the current ServletContext.
PageFlowController for the request, or null if none was found.
public static PageFlowController getPageFlowForURI(HttpServletRequest request,
HttpServletResponse response,
String uri,
ServletContext servletContext)
getPageFlowForPath(RequestContext, String) instead. The URI must be stripped of the
webapp context path before being passed.
request - the current HttpServletRequest.response - the current HttpServletResponse.uri - a server-relative URI. The URI should contain the webapp context path.servletContext - the current ServletContext.
PageFlowController for the given URI, or null if none was found.
public static PageFlowController getPageFlowForRelativeURI(HttpServletRequest request,
HttpServletResponse response,
String path,
ServletContext servletContext)
getPageFlowForPath(RequestContext, String) instead.
request - the current HttpServletRequest.response - the current HttpServletResponse.path - a webapp-relative path. The path should not contain the webapp context path.servletContext - the current ServletContext.
PageFlowController for the given path, or null if none was found.
public static PageFlowController getPageFlow(String pageFlowClassName,
HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
createPageFlow(RequestContext, String) instead.
request - the current HttpServletRequest.response - the current HttpServletResponse.pageFlowClassName - the type name of the desired page flow.servletContext - the current ServletContext.
PageFlowController, or null if none was found.
public static GlobalApp getGlobalApp(HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
getSharedFlowsForRequest(RequestContext).
request - the current HttpServletRequest.response - the current HttpServletResponse.
GlobalApp instance, or a new one (based on Global.app) if none is found.
If Global.app does not exist in the current webapp, null is returned.
public static PageFlowController getPageFlow(Class pageFlowClass,
HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
createPageFlow(RequestContext, Class) instead.
request - the current HttpServletRequest.response - the current HttpServletResponse.pageFlowClass - the type of the desired page flow.servletContext - the current ServletContext.
PageFlowController, or null if none was found.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||