You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2006/04/08 02:54:53 UTC
svn commit: r392468 -
/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/
Author: ekoneil
Date: Fri Apr 7 17:54:50 2006
New Revision: 392468
URL: http://svn.apache.org/viewcvs?rev=392468&view=rev
Log:
Bunch of Javadoc cleanup and a fix for the PageFlowControlContainer attribute name.
BB: self
Test: NetUI pass
Modified:
beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java
beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java
beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowControlContainerFactory.java
beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java
beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java?rev=392468&r1=392467&r2=392468&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java Fri Apr 7 17:54:50 2006
@@ -108,7 +108,7 @@
*/
public int getListenPort( HttpServletRequest request )
{
- // TODO: have a configuration in netui-config.xml to specify this; an alternative to having to have an adapter.
+ // TODO: have a configuration in beehive-netui-config.xml to specify this; an alternative to having to have an adapter.
return -1;
}
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java?rev=392468&r1=392467&r2=392468&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java Fri Apr 7 17:54:50 2006
@@ -216,9 +216,11 @@
* Callback that is invoked when this backing bean is restored as the page itself is restored through a
* {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward} or
* {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction} with
- * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward#navigateTo() navigateTo}={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#currentPage Jpf.NavigateTo.currentPage}
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward#navigateTo() navigateTo}=
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#currentPage Jpf.NavigateTo.currentPage}
* or
- * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward#navigateTo() navigateTo}={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#currentPage Jpf.NavigateTo.previousPage}.
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward#navigateTo() navigateTo}=
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#currentPage Jpf.NavigateTo.previousPage}.
*/
protected void onRestore()
{
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java?rev=392468&r1=392467&r2=392468&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java Fri Apr 7 17:54:50 2006
@@ -355,9 +355,13 @@
}
/**
- * An internal method for executing an action; should not be invoked directly.
+ * Internal method used to execute an action on a FlowController. This is where the magic generally happens as
+ * the {@link #beforeAction()}, login, action execution (simple and normal), and {@link #afterAction()} are
+ * all executed by this method. This method is considered <i>internal</i> and should not be invoked direclty.
*/
- protected ActionForward internalExecute( ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ protected ActionForward internalExecute( ActionMapping mapping,
+ ActionForm form,
+ HttpServletRequest request,
HttpServletResponse response )
throws Exception
{
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowControlContainerFactory.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowControlContainerFactory.java?rev=392468&r1=392467&r2=392468&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowControlContainerFactory.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowControlContainerFactory.java Fri Apr 7 17:54:50 2006
@@ -20,13 +20,14 @@
import org.apache.beehive.netui.pageflow.handler.StorageHandler;
import org.apache.beehive.netui.pageflow.handler.Handlers;
import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils;
+import org.apache.beehive.netui.pageflow.internal.InternalConstants;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.ServletContext;
public class PageFlowControlContainerFactory
{
- private static String PAGEFLOW_CONTROL_CONTAINER = "netui.PageFlolwControlContainerInstance";
+ private static String PAGEFLOW_CONTROL_CONTAINER = InternalConstants.ATTR_PREFIX + "PageFlowControlContainerInstance";
/**
* This method will return the <code>PageFlowControlContainer</code> that is acting as the
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java?rev=392468&r1=392467&r2=392468&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java Fri Apr 7 17:54:50 2006
@@ -78,7 +78,7 @@
* {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward @Jpf.ConditionalForward} annotations
* that have <code>returnAction</code> attributes).
* </p>
- *
+ *
* <p>
* The page flow class also handles exceptions thrown by actions or during page execution
* (see {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#catches catches} on
@@ -185,6 +185,8 @@
/**
* Remove this instance from the session. When inside a page flow action, {@link #remove} may be called instead.
+ * This method is synchronized in order to maintain single threaded semantics for the Page Flow's
+ * {@link #onDestroy(javax.servlet.http.HttpSession)} lifecycle method.
*/
public synchronized void removeFromSession( HttpServletRequest request )
{
@@ -248,7 +250,7 @@
* used by the framework and should not be called directly in most cases.
* </p>
* <p>
- * Note, this method ultimately causes the Page Flow to be persisted in the {@link javax.servlet.http.HttpSession}.
+ * Note, this method ultimately causes the Page Flow to be persisted in the {@link StorageHandler} for this web application.
* </p>
*
* @param request the current {@link HttpServletRequest}
@@ -939,7 +941,7 @@
/**
* Callback when this object is removed from the user session. Causes {@link #onDestroy} to be called. This is a
- * framework-invoked method that should not normally be called directly.
+ * framework-invoked method that should not be called directly.
*/
public void valueUnbound( HttpSessionBindingEvent event )
{
@@ -1105,7 +1107,7 @@
}
/**
- * Callback that is invoked when this controller instance is exiting nesting (through a return action).
+ * Callback that is invoked when this controller instance is exiting nesting through a return action.
* {@link FlowController#getRequest}, {@link FlowController#getResponse}, {@link FlowController#getSession}
* may all be used during this method.
*/
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java?rev=392468&r1=392467&r2=392468&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java Fri Apr 7 17:54:50 2006
@@ -47,7 +47,18 @@
* Creation time. This is non-transient, so it gets replicated in a cluster.
*/
private long _createTime;
-
+
+ /**
+ * Flag used to detect multiple {@link #valueUnbound(javax.servlet.http.HttpSessionBindingEvent)} events.
+ * Depending on the {@link org.apache.beehive.netui.pageflow.handler.StorageHandler} implementation used,
+ * it is possible for the framework and the Servlet container to dispatch multiple unbinding events signaling
+ * either the real or virtual removal of this object from the session. If the removal was virtual with a
+ * real removal to follow later, two (or more) {@link #valueUnbound(javax.servlet.http.HttpSessionBindingEvent)}
+ * events could be received by this object. This flag prevents this with the assumption that once detached
+ * from the {@link HttpSession}, it is never reattached.
+ */
+ private boolean _valueUnbound = false;
+
protected PageFlowManagedObject()
{
_createTime = System.currentTimeMillis();
@@ -116,6 +127,7 @@
*/
public void valueBound( HttpSessionBindingEvent event )
{
+ _valueUnbound = false;
}
/**
@@ -135,7 +147,9 @@
{
servletContext = session.getServletContext();
}
-
+
+ _valueUnbound = true;
+
if ( servletContext != null )
{
if ( Handlers.get( servletContext ).getStorageHandler().allowBindingEvent( event ) )
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java?rev=392468&r1=392467&r2=392468&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java Fri Apr 7 17:54:50 2006
@@ -388,6 +388,14 @@
return false;
}
+ /**
+ * Internal method used to process an action.
+ *
+ * @param request the current request
+ * @param response the current response
+ * @throws IOException
+ * @throws ServletException
+ */
private void processInternal( HttpServletRequest request, HttpServletResponse response )
throws IOException, ServletException
{
@@ -785,6 +793,9 @@
RequestInterceptorContext context = new RequestInterceptorContext( request, response, getServletContext() );
List/*< Interceptor >*/ interceptors = context.getRequestInterceptors();
+ //
+ // Execute pre-request interceptors
+ //
try
{
Interceptors.doPreIntercept( context, interceptors );
@@ -862,7 +873,7 @@
}
//
- // Go through the chain of pre-request interceptors.
+ // Execute post-request interceptors
//
try
{
@@ -2058,7 +2069,7 @@
try
{
//
- // Run any before-action interceptors.
+ // Run any pre-action interceptors.
//
if ( interceptors != null && ! PageFlowRequestWrapper.get( request ).isReturningFromActionIntercept() )
{
@@ -2101,7 +2112,7 @@
ActionForward ret = ActionInterceptors.wrapAction( context, interceptors, actionExecutor );
//
- // Run any after-action interceptors.
+ // Run any post-action interceptors.
//
if ( interceptors != null )
{
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java?rev=392468&r1=392467&r2=392468&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java Fri Apr 7 17:54:50 2006
@@ -245,7 +245,7 @@
}
/**
- * Get the current PageFlowController.
+ * Get the current {@link PageFlowController}.
*
* @param request the current HttpServletRequest.
* @param servletContext the current ServletContext.
@@ -312,7 +312,6 @@
String currentLongLivedAttrName =
ScopedServletUtils.getScopedSessionAttrName( CURRENT_LONGLIVED_ATTR, unwrappedRequest );
String currentLongLivedModulePath = ( String ) sh.getAttribute( rc, currentLongLivedAttrName );
- ActionResolver retVal;
if ( currentLongLivedModulePath != null )
{