Author: rich
Date: Fri Apr 29 14:38:59 2005
New Revision: 165345

URL: http://svn.apache.org/viewcvs?rev=165345&view=rev
Log:
Fix for http://issues.apache.org/jira/browse/BEEHIVE-585 : perf: 
BackingClassMethodBinding needs to cache methods and fields

Also:

    - Went through all the TODOs in the pageflow module, and marked v1-related 
issues as "TODO v1".  These are mostly places where javadoc is needed.

    - Got rid of the unused <legacy-tag-support> in beehive-netui-config.xml

tests: bvt in netui (WinXP)
BB: self (linux)


Added:
    
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/cache/FieldCache.java
   (with props)
Modified:
    
incubator/beehive/trunk/netui/src/compiler-core/schema/processed-annotations/processed-annotations.xsd
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ExpressionMessage.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ServletContainerAdapter.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SessionExpiredException.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SharedFlowController.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/PageFlowApplicationFactory.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/BackingClassMethodBinding.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/PageFlowApplication.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/PageFlowNavigationHandler.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/JavaControlUtils.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/PageFlowServiceProvider.java
    
incubator/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Section.java
    
incubator/beehive/trunk/netui/src/tomcat-server/5x/org/apache/beehive/netui/tomcat/PageflowValve.java
    incubator/beehive/trunk/netui/src/util/beehive-netui-config-default.xml
    incubator/beehive/trunk/netui/src/util/schema/netui-config/netui-config.xsd
    
incubator/beehive/trunk/netui/src/webapp-template/default/WEB-INF/beehive-netui-config.xml
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/beehive-netui-config.xml

Modified: 
incubator/beehive/trunk/netui/src/compiler-core/schema/processed-annotations/processed-annotations.xsd
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/schema/processed-annotations/processed-annotations.xsd?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler-core/schema/processed-annotations/processed-annotations.xsd
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler-core/schema/processed-annotations/processed-annotations.xsd
 Fri Apr 29 14:38:59 2005
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!-- @todo: need to remove the legacy-tag-support from this -->
 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
elementFormDefault="qualified">
 
     <xsd:element name="processed-annotations">

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java
 Fri Apr 29 14:38:59 2005
@@ -93,11 +93,13 @@
 
     public int getListenPort( HttpServletRequest request )
     {
+        // TODO: have a configuration in netui-config.xml to specify this; an 
alternative to having to have an adapter.
         return -1;
     }
 
     public int getSecureListenPort( HttpServletRequest request )
     {
+        // TODO: have a configuration in netui-config.xml to specify this; an 
alternative to having to have an adapter.
         return -1;
     }
 

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ExpressionMessage.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ExpressionMessage.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ExpressionMessage.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ExpressionMessage.java
 Fri Apr 29 14:38:59 2005
@@ -26,7 +26,7 @@
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 
-// TODO comment this class
+// TODO v1 comment this class
 public class ExpressionMessage
         extends ActionMessage
 {

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java
 Fri Apr 29 14:38:59 2005
@@ -83,7 +83,7 @@
         //
         Field pageFlowMemberField = getCachedInfo().getPageFlowMemberField();
         
-        // TODO: should we add a compiler warning if this field isn't 
transient?  All this reinitialization logic is
+        // TODO v1: should we add a compiler warning if this field isn't 
transient?  All this reinitialization logic is
         // for the transient case.
         if ( fieldIsUninitialized( pageFlowMemberField ) )
         {

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
 Fri Apr 29 14:38:59 2005
@@ -1482,11 +1482,13 @@
                         return new Forward( forwardName );
                     }
                 }
-                catch(ELException e)
+                catch( Exception e )  // ELException
                 {
-                    // todo: finish this error handling implementation
                     if( _log.isErrorEnabled() )
-                        _log.error( "Exception occurred evaluating navigation 
expression '" + expression + "'.  Cause: " + e.getCause(), e);
+                    {
+                        _log.error( "Exception occurred evaluating navigation 
expression '" + expression
+                                    + "'.  Cause: " + e.getCause(), e);
+                    }
                 }
             }
         }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
 Fri Apr 29 14:38:59 2005
@@ -142,6 +142,6 @@
      */ 
     public static final String JPF_MODULE_CONFIG_GEN_DIR = 
PAGEFLOW_MODULE_CONFIG_GEN_DIR;
     
-    // TODO: comment this
+    // TODO v1: comment this
     public static final String AUTO_VIEW_RENDER_FORWARD_NAME = "_auto";
 }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
 Fri Apr 29 14:38:59 2005
@@ -468,9 +468,7 @@
                     _log.debug( "checkSecurity() caused a redirect.  Ending 
processing for this request "
                                + '(' + uri + ')' );
                 }
-
-                // @TODO when in portal, we'll need to set some sort of flag 
to notify that the request
-                //       was redirected and that there should be no rendering 
done.
+                
                 return;
             }
         }
@@ -764,7 +762,7 @@
     }
     
     /**
-     * TODO: comment
+     * TODO v1: comment
      */ 
     private static class RehydratedMultipartRequestWrapper extends 
MultipartRequestWrapper
     {

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ServletContainerAdapter.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ServletContainerAdapter.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ServletContainerAdapter.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ServletContainerAdapter.java
 Fri Apr 29 14:38:59 2005
@@ -27,7 +27,7 @@
 /**
  * @exclude
  */ 
-// TODO: comment this and make it public
+// TODO v1: comment this and make it public
 public interface ServletContainerAdapter
         extends Adapter
 {

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SessionExpiredException.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SessionExpiredException.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SessionExpiredException.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SessionExpiredException.java
 Fri Apr 29 14:38:59 2005
@@ -18,7 +18,7 @@
 package org.apache.beehive.netui.pageflow;
 
 
-// TODO: comment
+// TODO v1: comment
 /**
  * Exception thrown when:
  *     <ul>

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SharedFlowController.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SharedFlowController.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SharedFlowController.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SharedFlowController.java
 Fri Apr 29 14:38:59 2005
@@ -30,7 +30,7 @@
 import org.apache.beehive.netui.pageflow.internal.InternalConstants;
 
 
-// TODO: javadoc
+// TODO v1: comment
 public abstract class SharedFlowController
         extends FlowController
         implements PageFlowConstants

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/PageFlowApplicationFactory.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/PageFlowApplicationFactory.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/PageFlowApplicationFactory.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/PageFlowApplicationFactory.java
 Fri Apr 29 14:38:59 2005
@@ -23,7 +23,7 @@
 import javax.faces.application.ApplicationFactory;
 import javax.faces.application.Application;
 
-// TODO: rich needs to doc this when he gets all 10 of his fingers back
+// TODO v1: rich needs to doc this when he gets all 10 of his fingers back
 public class PageFlowApplicationFactory
         extends ApplicationFactory
 {

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/BackingClassMethodBinding.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/BackingClassMethodBinding.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/BackingClassMethodBinding.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/BackingClassMethodBinding.java
 Fri Apr 29 14:38:59 2005
@@ -21,6 +21,8 @@
 import org.apache.beehive.netui.pageflow.internal.AnnotationReader;
 import 
org.apache.beehive.netui.compiler.schema.annotations.ProcessedAnnotation;
 import org.apache.beehive.netui.util.logging.Logger;
+import org.apache.beehive.netui.util.internal.cache.FieldCache;
+import org.apache.beehive.netui.util.internal.cache.MethodCache;
 
 import javax.faces.el.MethodBinding;
 import javax.faces.el.MethodNotFoundException;
@@ -33,8 +35,7 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Field;
 
-// TODO: rich needs to doc this when he gets all 10 of his fingers back
-// TODO: move to internal
+// TODO v1: rich needs to doc this when he gets all 10 of his fingers back
 /**
  * 
  */ 
@@ -43,6 +44,8 @@
         implements StateHolder
 {
     private static final Logger _log = Logger.getInstance( 
BackingClassMethodBinding.class );
+    private static final FieldCache _fieldCache = new FieldCache();
+    private static final MethodCache _methodCache = new MethodCache();
     
     private String _methodName;
     private Class[] _params;
@@ -89,71 +92,73 @@
             {
                 Class backingClass = backingBean.getClass();
                 
-                try
+                Object servletContextObject = 
context.getExternalContext().getContext();
+                assert servletContextObject instanceof ServletContext : 
servletContextObject.getClass().getName();
+                ServletContext servletContext = ( ServletContext ) 
servletContextObject;
+                Method method = _methodCache.getMethod( backingClass, 
_methodName, _params );
+                
+                if ( method == null ) throw new MethodNotFoundException( 
_methodName );
+                AnnotationReader annReader = 
AnnotationReader.getAnnotationReader( backingClass, servletContext );
+                ProcessedAnnotation ann = annReader.getJpfAnnotation( method, 
"CommandHandler" );
+                
+                if ( ann != null )
                 {
-                    Object servletContextObject = 
context.getExternalContext().getContext();
-                    assert servletContextObject instanceof ServletContext : 
servletContextObject.getClass().getName();
-                    ServletContext servletContext = ( ServletContext ) 
servletContextObject;
-                    Method method = backingClass.getMethod( _methodName, 
_params );
-                    AnnotationReader annReader = 
AnnotationReader.getAnnotationReader( backingClass, servletContext );
-                    ProcessedAnnotation ann = annReader.getJpfAnnotation( 
method, "CommandHandler" );
+                    ProcessedAnnotation[] raiseActions =
+                            AnnotationReader.getAnnotationArrayAttribute( ann, 
"raiseActions" );
                     
-                    if ( ann != null )
+                    if ( raiseActions != null )
                     {
-                        ProcessedAnnotation[] raiseActions =
-                                AnnotationReader.getAnnotationArrayAttribute( 
ann, "raiseActions" );
-                        
-                        if ( raiseActions != null )
-                        {
-                            for ( int i = 0; i < raiseActions.length; i++ )
-                            {
-                                ProcessedAnnotation raiseAction = 
raiseActions[i];
-                                String actionAttr = 
AnnotationReader.getStringAttribute( raiseAction, "action" );
+                        setOutputFormBeans( raiseActions, backingClass, 
backingBean, action, httpRequest );
+                    }
+                }
+            }
+        }
+    
+        return result;
+    }
+    
+    private static void setOutputFormBeans( ProcessedAnnotation[] 
raiseActions, Class backingClass, Object backingBean,
+                                            String action, HttpServletRequest 
httpRequest )
+    {
+        for ( int i = 0; i < raiseActions.length; i++ )
+        {
+            ProcessedAnnotation raiseAction = raiseActions[i];
+            String actionAttr = AnnotationReader.getStringAttribute( 
raiseAction, "action" );
                                 
-                                if ( actionAttr.equals( action ) )
-                                {
-                                    String formBeanMember =
-                                            
AnnotationReader.getStringAttribute( raiseAction, "outputFormBean" );
+            if ( actionAttr.equals( action ) )
+            {
+                String formBeanMember =
+                        AnnotationReader.getStringAttribute( raiseAction, 
"outputFormBean" );
                                     
-                                    if ( formBeanMember != null && 
formBeanMember.length() > 0 )
-                                    {
-                                        try
-                                        {
-                                            // TODO: must cache fields and 
annotations
-                                            Field field = 
backingClass.getDeclaredField( formBeanMember );
-                                            field.setAccessible( true );
-                                            Object value = field.get( 
backingBean );
-                                            
InternalUtils.setForwardedFormBean( httpRequest, InternalUtils.wrapFormBean( 
value ) );
-                                        }
-                                        catch ( NoSuchFieldException e )
-                                        {
-                                            e.printStackTrace( );    // TODO: 
log
-                                        }
-                                        catch ( IllegalAccessException e )
-                                        {
-                                            e.printStackTrace( );    // TODO: 
log
-                                        }
-                                    }
-                                }
-                            }
+                if ( formBeanMember != null && formBeanMember.length() > 0 )
+                {
+                    try
+                    {
+                        Field field = _fieldCache.getDeclaredField( 
backingClass, formBeanMember );
+                        if ( field == null )
+                        {
+                            _log.error( "Could not find field " + 
formBeanMember + " specified as the outputFormBean "
+                                        + "for action " + action + " raised by 
" + backingClass.getName() );
+                            return;
                         }
+                        Object value = field.get( backingBean );
+                        InternalUtils.setForwardedFormBean( httpRequest, 
InternalUtils.wrapFormBean( value ) );
+                    }
+                    catch ( IllegalAccessException e )
+                    {
+                        _log.error( "Could not access field " + formBeanMember 
+ " specified as the outputFormBean "
+                                    + "for action " + action + " raised by " + 
backingClass.getName(), e );
                     }
-                }
-                catch ( NoSuchMethodException e )
-                {
-                    e.printStackTrace( );    // TODO: log
                 }
             }
         }
-        
-        return result;
     }
-
+    
     public Object saveState( FacesContext context )
     {
         return new Object[]{ _methodName, _params, 
UIComponentBase.saveAttachedState( context, _delegate ) };
     }
-
+    
     public void restoreState( FacesContext context, Object state )
     {
         Object[] values = ( Object[] ) state;
@@ -161,15 +166,14 @@
         _params = ( Class[] ) values[1];
         _delegate = ( MethodBinding ) UIComponentBase.restoreAttachedState( 
context, values[2] );
     }
-
+    
     public boolean isTransient()
     {
         return _transient;
     }
-
+    
     public void setTransient( boolean newTransientValue )
     {
         _transient = newTransientValue;
     }
 }
-

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/PageFlowApplication.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/PageFlowApplication.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/PageFlowApplication.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/PageFlowApplication.java
 Fri Apr 29 14:38:59 2005
@@ -39,7 +39,7 @@
 import java.util.Iterator;
 import java.util.Locale;
 
-// TODO: rich needs to doc this when he gets all 10 of his fingers back
+// TODO v1: rich needs to doc this when he gets all 10 of his fingers back
 public class PageFlowApplication
         extends Application
 {

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/PageFlowNavigationHandler.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/PageFlowNavigationHandler.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/PageFlowNavigationHandler.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/PageFlowNavigationHandler.java
 Fri Apr 29 14:38:59 2005
@@ -35,7 +35,7 @@
 import org.apache.beehive.netui.util.logging.Logger;
 
 
-// TODO: rich needs to doc this when he gets all 10 of his fingers back
+// TODO v1: rich needs to doc this when he gets all 10 of his fingers back
 public class PageFlowNavigationHandler
     extends NavigationHandler
 {

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/JavaControlUtils.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/JavaControlUtils.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/JavaControlUtils.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/JavaControlUtils.java
 Fri Apr 29 14:38:59 2005
@@ -109,7 +109,7 @@
         // Retrieve the control bean context from the request, and if it's not 
there, from the session.
         // Using the request first ensures that we don't get confused by 
session invalidation.
         //
-        // TODO: create our own context, with current-pageflow info.
+        // TODO v1: create our own context, with current-pageflow info.
         ControlBeanContext beanContext = ( ControlBeanContext ) 
request.getAttribute( CONTROL_CONTEXT_CLASSNAME );
         if ( beanContext != null ) return beanContext;
         
@@ -167,7 +167,8 @@
         if ( beanContext != null ) beanContext.remove( controlInstance ); 
     }
     
-       
+
+    
     /**
      * @return a map of Field (accessible) -> AnnotationMap
      */ 
@@ -220,7 +221,22 @@
         
         return ret;
     } 
-    
+    /*
+        public static void initJavaControls_ttt( HttpServletRequest request, 
HttpServletResponse response,
+                                              ServletContext servletContext, 
PageFlowManagedObject controlClient ) throws ControlFieldInitializationException
+     {
+         Class controlClientClass = controlClient.getClass();
+         Map controlFields = getAccessibleControlFieldAnnotations( 
controlClientClass, servletContext );
+         if ( controlFields.isEmpty() )
+         {
+             return;
+         }
+         request = PageFlowUtils.unwrapMultipart( request );
+         ControlBeanContext beanContext = getControlBeanContext( request, 
response, servletContext, false );
+         assert beanContext != null : "ControlBeanContext was not initialized 
by PageFlowRequestProcessor";   
+            Controls.initializeClient(null, controlClient, beanContext);   
+     }   
+    */ 
     /**
      * Initialize all null member variables that are Java Controls.
      * 

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/PageFlowServiceProvider.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/PageFlowServiceProvider.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/PageFlowServiceProvider.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/PageFlowServiceProvider.java
 Fri Apr 29 14:38:59 2005
@@ -59,7 +59,7 @@
             if ( ! ( request instanceof HttpServletRequest ) ) return null;
             return PageFlowUtils.getCurrentPageFlow( ( HttpServletRequest ) 
request );
         }
-        // TODO: add Shared Flow initialization
+        // TODO v1: add Shared Flow initialization
 
         return null;
     }

Modified: 
incubator/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Section.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Section.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Section.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Section.java
 Fri Apr 29 14:38:59 2005
@@ -334,7 +334,7 @@
         throws JspException {
         assert(_name != null);
 
-        // @todo: this is busted.  It should be writting out inline.
+        // @todo: this is busted.  It should be writing out inline.
         String realName = rewriteName(_name);
         String idScript = mapLegacyTagId(_name, realName);
 

Modified: 
incubator/beehive/trunk/netui/src/tomcat-server/5x/org/apache/beehive/netui/tomcat/PageflowValve.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tomcat-server/5x/org/apache/beehive/netui/tomcat/PageflowValve.java?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tomcat-server/5x/org/apache/beehive/netui/tomcat/PageflowValve.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tomcat-server/5x/org/apache/beehive/netui/tomcat/PageflowValve.java
 Fri Apr 29 14:38:59 2005
@@ -126,8 +126,7 @@
     public boolean checkSecurity( HttpRequest request, HttpResponse response, 
SecurityConstraint constraint )
         throws IOException
     {
-        // TODO: need a LoginConfig for the last argument?
-        // the tomcat version of this returns false if the user was 
redirected, so we want the opposite of that
+        // The tomcat version of this returns false if the user was 
redirected, so we want the opposite of that.
         return ! authenticate( request, response, null );
     }
 

Modified: 
incubator/beehive/trunk/netui/src/util/beehive-netui-config-default.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/beehive-netui-config-default.xml?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/util/beehive-netui-config-default.xml 
(original)
+++ incubator/beehive/trunk/netui/src/util/beehive-netui-config-default.xml Fri 
Apr 29 14:38:59 2005
@@ -2,8 +2,6 @@
 
 <netui-config xmlns="http://beehive.apache.org/netui/2004/server/config";>
 
-    <legacy-tag-support>false</legacy-tag-support>
-
     <expression-languages>
         <default-language>netuiel</default-language>
         <expression-language>

Added: 
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/cache/FieldCache.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/cache/FieldCache.java?rev=165345&view=auto
==============================================================================
--- 
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/cache/FieldCache.java
 (added)
+++ 
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/cache/FieldCache.java
 Fri Apr 29 14:38:59 2005
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.util.internal.cache;
+
+import java.lang.reflect.Field;
+import java.util.HashMap;
+
+import 
org.apache.beehive.netui.util.internal.concurrent.InternalConcurrentHashMap;
+
+import org.apache.beehive.netui.util.logging.Logger;
+
+/**
+ * @exclude
+ */
+public class FieldCache
+{
+    private static final Logger _log = Logger.getInstance( FieldCache.class );
+
+    private final InternalConcurrentHashMap _fieldCache;
+    private final InternalConcurrentHashMap _declaredFieldCache;
+
+    public FieldCache()
+    {
+        _fieldCache = new InternalConcurrentHashMap();
+        _declaredFieldCache = new InternalConcurrentHashMap();
+    }
+
+    public final Field getField( Class type, String fieldName )
+    {
+        if ( _log.isDebugEnabled() ) _log.debug( "getFields for: " + type );
+        
+        HashMap fields = ( HashMap ) _fieldCache.get( type );
+        
+        if ( fields == null )
+        {
+            Field[] fieldArray = type.getFields();
+            fields = new HashMap();
+            
+            for ( int i = 0; i < fieldArray.length; i++ )
+            {
+                Field field = fieldArray[i];
+                fields.put( field.getName(), field );
+            }
+            
+            _fieldCache.put( type, fields );
+        }
+        
+        return ( Field ) fields.get( fieldName );
+    }
+    
+    public final Field getDeclaredField( Class type, String fieldName )
+    {
+        if ( _log.isDebugEnabled() ) _log.debug( "getDeclaredFields for: " + 
type );
+
+        HashMap fields = ( HashMap ) _declaredFieldCache.get( type );
+
+        if ( fields == null )
+        {
+            Field[] fieldArray = type.getDeclaredFields();
+            fields = new HashMap();
+            
+            for ( int i = 0; i < fieldArray.length; i++ )
+            {
+                Field field = fieldArray[i];
+                field.setAccessible( true );
+                fields.put( field.getName(), field );
+            }
+            
+            _declaredFieldCache.put( type, fields );
+        }
+
+        return ( Field ) fields.get( fieldName );
+    }
+}

Propchange: 
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/cache/FieldCache.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
incubator/beehive/trunk/netui/src/util/schema/netui-config/netui-config.xsd
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/schema/netui-config/netui-config.xsd?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/util/schema/netui-config/netui-config.xsd 
(original)
+++ incubator/beehive/trunk/netui/src/util/schema/netui-config/netui-config.xsd 
Fri Apr 29 14:38:59 2005
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!-- @todo: need to remove the legacy-tag-support from this -->
 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
             
targetNamespace="http://beehive.apache.org/netui/2004/server/config";
             xmlns:netui="http://beehive.apache.org/netui/2004/server/config";
@@ -9,7 +8,6 @@
     <xsd:element name="netui-config">
         <xsd:complexType>
             <xsd:sequence>
-                <xsd:element name="legacy-tag-support" type="xsd:boolean" 
minOccurs="0" maxOccurs="1" default="false"/>
                 <xsd:element name="expression-languages" 
type="netui:expression-languages" minOccurs="1" maxOccurs="1"/>
                 <xsd:element name="pageflow-action-interceptors" 
type="netui:pageflow-action-interceptors" minOccurs="0" maxOccurs="1"/>
                 <xsd:element name="pageflow-handlers" 
type="netui:pageflow-handlers" minOccurs="0" maxOccurs="1"/>

Modified: 
incubator/beehive/trunk/netui/src/webapp-template/default/WEB-INF/beehive-netui-config.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/webapp-template/default/WEB-INF/beehive-netui-config.xml?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/webapp-template/default/WEB-INF/beehive-netui-config.xml
 (original)
+++ 
incubator/beehive/trunk/netui/src/webapp-template/default/WEB-INF/beehive-netui-config.xml
 Fri Apr 29 14:38:59 2005
@@ -2,8 +2,6 @@
 
 <netui-config xmlns="http://beehive.apache.org/netui/2004/server/config";>
 
-    <legacy-tag-support>false</legacy-tag-support>
-
     <expression-languages>
         <default-language>netuiel</default-language>
         <expression-language>

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/beehive-netui-config.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/beehive-netui-config.xml?rev=165345&r1=165344&r2=165345&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/beehive-netui-config.xml
 (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/beehive-netui-config.xml
 Fri Apr 29 14:38:59 2005
@@ -2,8 +2,6 @@
 
 <netui-config xmlns="http://beehive.apache.org/netui/2004/server/config";>
 
-    <legacy-tag-support>false</legacy-tag-support>
-
     <expression-languages>
         <default-language>netuiel</default-language>
         <expression-language>


Reply via email to