| java.lang.Object org.apache.beehive.netui.pageflow.PageFlowManagedObject org.apache.beehive.netui.pageflow.FlowController org.apache.beehive.netui.pageflow.SharedFlowController
All known Subclasses: org.apache.beehive.netui.pageflow.GlobalApp,
SharedFlowController | abstract public class SharedFlowController extends FlowController implements PageFlowConstants(Code) | |
Base "shared flow" class for controller logic, exception handlers, and state that can be shared by any number of page
flows. A shared flow is not a page flow; it is used by page flows, but never becomes the "current page flow"
(see
PageFlowController for information on page flows and the "current page flow").
The class is configured through the
org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller annotation.
A shared flow comes into existance in one of two ways:
-
A page flow is hit, and the page flow refers to the shared flow in its
org.apache.beehive.netui.pageflow.annotations.Jpf.Controller.sharedFlowRefs sharedFlowRefs annotation attribute, or
-
Any page flow is hit, and the
<default-shared-flow-refs> element in
/WEB-INF/beehive-netui-config.xml declares that this shared flow will be used by all page flows in the web
application.
When a shared flow is created, it is stored in the user session. It is only removed through a call to
SharedFlowController.remove or through a call to
PageFlowUtils.removeSharedFlow .
Shared flow actions are defined with action methods or action annotations that determine the next URI
to be displayed, after optionally performing arbitrary logic. A page or page flow can raise a shared flow action
using the pattern " shared-flow-name. action-name" . The shared
flow name is the one chosen by the page flow
in
org.apache.beehive.netui.pageflow.annotations.Jpf.SharedFlowRef.name name on
org.apache.beehive.netui.pageflow.annotations.Jpf.SharedFlowRef @Jpf.SharedFlowRef .
A referenced shared flow gets the chance to handle any uncaught page flow exception. It declares its exception
handling through
org.apache.beehive.netui.pageflow.annotations.Jpf.Controller.catches catches on
org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller .
Properties in the current shared flow instance can be accessed from JSP 2.0-style expressions like this one:
${sharedFlow. sharedFlowName.someProperty} .
There may only be one shared flow in any package.
See Also: PageFlowController |
Method Summary | |
public void | ensureFailover(HttpServletRequest request) Ensures that any changes to this object will be replicated in a cluster (for failover),
even if the replication scheme uses a change-detection algorithm that relies on
HttpSession.setAttribute to be aware of changes. | public String | getDisplayName() Get the display name. | public String | getModulePath() Get the Struts module path for actions in this shared flow. | public PreviousPageInfo | getPreviousPageInfoLegacy(PageFlowController curJpf, HttpServletRequest request) Get a legacy PreviousPageInfo. | public String | getURI() Get the URI. | public void | persistInSession(HttpServletRequest request, HttpServletResponse response) Store this object in the user session, in the appropriate place. | public synchronized void | removeFromSession(HttpServletRequest request) Remove this instance from the session. | void | savePreviousActionInfo(ActionForm form, HttpServletRequest request, ActionMapping mapping, ServletContext servletContext) Store information about the most recent action invocation. | public void | savePreviousPageInfo(ActionForward forward, ActionForm form, ActionMapping mapping, HttpServletRequest request, ServletContext servletContext, boolean isSpecialForward) Store information about recent pages displayed. |
ensureFailover | public void ensureFailover(HttpServletRequest request)(Code) | | Ensures that any changes to this object will be replicated in a cluster (for failover),
even if the replication scheme uses a change-detection algorithm that relies on
HttpSession.setAttribute to be aware of changes. Note that this method is used by the framework
and does not need to be called explicitly in most cases.
Parameters: request - the current HttpServletRequest |
getDisplayName | public String getDisplayName()(Code) | | Get the display name. The display name for a shared flow is simply the class name.
the name of the shared flow class. |
getModulePath | public String getModulePath()(Code) | | Get the Struts module path for actions in this shared flow.
the Struts module path for actions in this shared flow. |
getURI | public String getURI()(Code) | | Get the URI.
null , as this object is not URL-addressible. |
persistInSession | public void persistInSession(HttpServletRequest request, HttpServletResponse response)(Code) | | Store this object in the user session, in the appropriate place. Used by the framework; normally should not be
called directly.
|
savePreviousActionInfo | void savePreviousActionInfo(ActionForm form, HttpServletRequest request, ActionMapping mapping, ServletContext servletContext)(Code) | | Store information about the most recent action invocation. This is a framework-invoked method that should not
normally be called directly
|
savePreviousPageInfo | public void savePreviousPageInfo(ActionForward forward, ActionForm form, ActionMapping mapping, HttpServletRequest request, ServletContext servletContext, boolean isSpecialForward)(Code) | | Store information about recent pages displayed. This is a framework-invoked method that should not normally be
called directly.
|
Fields inherited from org.apache.beehive.netui.pageflow.FlowController | protected static Locale defaultLocale(Code)(Java Doc)
|
Methods inherited from org.apache.beehive.netui.pageflow.FlowController | protected void addActionError(String propertyName, String messageKey, Object[] messageArgs)(Code)(Java Doc) protected void addActionErrorExpression(String propertyName, String expression, Object[] messageArgs)(Code)(Java Doc) protected void addValidationError(String propertyName, String messageKey, Object[] messageArgs)(Code)(Java Doc) protected void addValidationError(String propertyName, String messageKey)(Code)(Java Doc) protected synchronized void afterAction() throws Exception(Code)(Java Doc) protected boolean alwaysTrackPreviousAction()(Code)(Java Doc) protected boolean alwaysTrackPreviousPage()(Code)(Java Doc) protected synchronized void beforeAction() throws Exception(Code)(Java Doc) public synchronized void create(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)(Code)(Java Doc) NotLoggedInException createNotLoggedInException(String actionName, HttpServletRequest request)(Code)(Java Doc) void decrementRequestCount(HttpServletRequest request)(Code)(Java Doc) void destroy(HttpSession session)(Code)(Java Doc) public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception(Code)(Java Doc) ActionForward forwardTo(ActionForward fwd, ActionMapping mapping, PageFlowExceptionConfig exceptionConfig, String actionName, ModuleConfig altModuleConfig, ActionForm form, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)(Code)(Java Doc) protected String generateToken(HttpServletRequest request)(Code)(Java Doc) protected String generateToken()(Code)(Java Doc) final protected ActionMapping getActionMapping()(Code)(Java Doc) protected Method getActionMethod(String methodName, Class argType)(Code)(Java Doc) ActionForward getActionMethodForward(String actionName, Object inputForm, HttpServletRequest request, HttpServletResponse response, ActionMapping mapping) throws Exception(Code)(Java Doc) public MutableURI getActionURI(String actionName) throws URISyntaxException(Code)(Java Doc) protected String[] getActions()(Code)(Java Doc) protected String getCurrentActionName()(Code)(Java Doc) protected DataSource getDataSource(HttpServletRequest request)(Code)(Java Doc) protected DataSource getDataSource(HttpServletRequest request, String key)(Code)(Java Doc) protected static Locale getDefaultLocale()(Code)(Java Doc) public ActionForm getFormBean(ActionMapping mapping)(Code)(Java Doc) FlowControllerHandlerContext getHandlerContext()(Code)(Java Doc) protected Locale getLocale(HttpServletRequest request)(Code)(Java Doc) protected Locale getLocale()(Code)(Java Doc) final protected ActionMapping getMapping()(Code)(Java Doc) protected MessageResources getMessageResources()(Code)(Java Doc) protected MessageResources getMessageResources(String key)(Code)(Java Doc) final protected ModuleConfig getModuleConfig()(Code)(Java Doc) public ModuleConfig getModuleConfig(ServletContext servletContext, HttpServletRequest request)(Code)(Java Doc) abstract public String getModulePath()(Code)(Java Doc) abstract public PreviousPageInfo getPreviousPageInfoLegacy(PageFlowController curJpf, HttpServletRequest request)(Code)(Java Doc) final protected HttpServletRequest getRequest()(Code)(Java Doc) PageFlowRequestProcessor getRequestProcessor()(Code)(Java Doc) protected MessageResources getResources()(Code)(Java Doc) protected MessageResources getResources(HttpServletRequest request)(Code)(Java Doc) protected MessageResources getResources(HttpServletRequest request, String key)(Code)(Java Doc) final protected HttpServletResponse getResponse()(Code)(Java Doc) public String getRewrittenActionURI(String actionName, Map parameters, boolean asValidXml) throws URISyntaxException(Code)(Java Doc) protected ActionServlet getServlet()(Code)(Java Doc) final protected HttpSession getSession()(Code)(Java Doc) public Principal getUserPrincipal()(Code)(Java Doc) public synchronized ActionForward handleException(Throwable ex, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException(Code)(Java Doc) boolean incrementRequestCount(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) throws IOException(Code)(Java Doc) protected ActionForward internalExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception(Code)(Java Doc) protected ActionForward invokeActionMethod(Method method, Object arg) throws Exception(Code)(Java Doc) ActionForward invokeActionMethod(Method method, Object arg, HttpServletRequest request, ActionMapping mapping) throws Exception(Code)(Java Doc) public synchronized ActionForward invokeExceptionHandler(Method method, Throwable ex, String message, ActionForm wrappedFormBean, PageFlowExceptionConfig exceptionConfig, ActionMapping actionMapping, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException(Code)(Java Doc) public boolean isAction(String name)(Code)(Java Doc) protected boolean isCancelled(HttpServletRequest request)(Code)(Java Doc) public boolean isPageFlow()(Code)(Java Doc) protected boolean isTokenValid(HttpServletRequest request)(Code)(Java Doc) protected boolean isTokenValid()(Code)(Java Doc) protected boolean isTokenValid(HttpServletRequest request, boolean reset)(Code)(Java Doc) protected boolean isTokenValid(boolean reset)(Code)(Java Doc) public boolean isUserInRole(String roleName)(Code)(Java Doc) public void login(String username, String password) throws LoginException(Code)(Java Doc) public void logout(boolean invalidateSessions)(Code)(Java Doc) public static ActionResult lookup(String actionName, ServletContext context, HttpServletRequest request, HttpServletResponse response) throws Exception(Code)(Java Doc) public static ActionResult lookup(String actionName, ServletContext context, HttpServletRequest request, HttpServletResponse response, String actionServletClassName) throws Exception(Code)(Java Doc) protected void onCreate() throws Exception(Code)(Java Doc) protected void onDestroy()(Code)(Java Doc) protected void onDestroy(HttpSession session)(Code)(Java Doc) protected void onRefresh()(Code)(Java Doc) final public synchronized void refresh(HttpServletRequest request, HttpServletResponse response)(Code)(Java Doc) public void reinitialize(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)(Code)(Java Doc) protected void remove()(Code)(Java Doc) protected void resetToken(HttpServletRequest request)(Code)(Java Doc) protected void resetToken()(Code)(Java Doc) public String resolveAction(String actionName, Object form, HttpServletRequest request, HttpServletResponse response) throws Exception(Code)(Java Doc) public String resolveAction(String actionName, Object form) throws Exception(Code)(Java Doc) public static Locale retrieveUserLocale(HttpServletRequest request, String locale)(Code)(Java Doc) protected void saveActionErrors(ActionMessages errors)(Code)(Java Doc) protected void saveErrors(HttpServletRequest request, ActionMessages errors)(Code)(Java Doc) protected void saveMessages(HttpServletRequest request, ActionMessages messages)(Code)(Java Doc) void savePreviousActionInfo(ActionForm form, HttpServletRequest request, ActionMapping mapping, ServletContext servletContext)(Code)(Java Doc) public void savePreviousPageInfo(ActionForward forward, ActionForm form, ActionMapping mapping, HttpServletRequest request, ServletContext servletContext, boolean isSpecialForward)(Code)(Java Doc) protected void saveToken(HttpServletRequest request)(Code)(Java Doc) protected void sendError(String errText, HttpServletResponse response) throws IOException(Code)(Java Doc) protected void sendError(String errText, HttpServletRequest request, HttpServletResponse response) throws IOException(Code)(Java Doc) protected void setLocale(HttpServletRequest request, Locale locale)(Code)(Java Doc) protected void setLocale(Locale locale)(Code)(Java Doc) PerRequestState setPerRequestState(PerRequestState state)(Code)(Java Doc) final public ModuleConfig theModuleConfig()(Code)(Java Doc)
|
|
|