Author: rich
Date: Wed Nov 17 15:19:47 2004
New Revision: 76187

Modified:
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/CompilerUtils.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/JpfLanguageConstants.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/diagnostics.properties
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/WebappPathType.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/StrutsApp.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/FlowControllerFactory.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ServerAdapter.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowControllerConfig.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultReloadableClassHandler.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultServerAdapter.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalConstants.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
   incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/index/Controller.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/pfSingleton/nav/NavController.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/pfSingleton/singleton/SingletonController.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest10/jpf1/Jpf1.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest6/jpf1/Jpf1.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest8/jpf1/Jpf1.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest9/jpf2/Jpf2.jpf
Log:
- Changed the attribute/term/API "singleton" to "long-lived".  A *long-lived* 
page flow does not die when you navigate away from it.
- Removed getReloadableClassDir() from the ServerAdapter interface -- it 
belongs in netui-config.xml, not in a per-server adapter.

DRT: netui (WinXP)
BB: self (linux)



Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/CompilerUtils.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/CompilerUtils.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/CompilerUtils.java
     Wed Nov 17 15:19:47 2004
@@ -832,7 +832,7 @@
         if ( a2 == null ) return false;
         
         //
-        // TODO: This entire method is a workaround for a bug in APT where an 
annotation does not equal itelf.
+        // TODO: This entire method is a workaround for a bug in APT where an 
annotation may not equal itelf.
         // If this behavior changes, we want to rely on equals(), not this 
deep comparison, which is more expensive
         // and wrong if the two annotations 'look' exactly the same.
         //

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/JpfLanguageConstants.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/JpfLanguageConstants.java
      (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/JpfLanguageConstants.java
      Wed Nov 17 15:19:47 2004
@@ -95,7 +95,7 @@
     public static final String DEFAULT_SIMPLE_ACTION_FORWARD_NAME = 
"_defaultForward";
 
     public static final String NESTED_ATTR = "nested";
-    public static final String SINGLETON_ATTR = "singleton";
+    public static final String LONGLIVED_ATTR = "longLived";
     public static final String STRUTSMERGE_ATTR = "strutsMerge";
     public static final String VALIDATOR_MERGE_ATTR = "validatorMerge";
     public static final String LOGIN_REQUIRED_ATTR = "loginRequired";

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
   Wed Nov 17 15:19:47 2004
@@ -167,7 +167,7 @@
                 // Add the dependency if it's a different file and if the file 
exists (it may have been deleted
                 // sometime after the list of classes in this package got 
built.
                 //
-                if ( ! jpfFile.equals( file ) && file.exists() )
+                if ( jpfFile != null && ! jpfFile.equals( file ) && 
file.exists() )
                 {
                     overlapping.add( file.getName() );
                     overlappingFiles.add( file );
@@ -305,13 +305,13 @@
             super( PageFlowChecker.this.getEnv(), 
PageFlowChecker.this.getDiagnostics(),
                    PageFlowChecker.this.getRuntimeVersionChecker(), 
PageFlowChecker.this.getFlowControllerInfo() );
             addMemberType( NESTED_ATTR, new AnnotationMemberType( null, this ) 
);
-            addMemberType( SINGLETON_ATTR, new SingletonAttrType() );
+            addMemberType( LONGLIVED_ATTR, new LongLivedAttrType() );
         }
         
-        protected class SingletonAttrType
+        protected class LongLivedAttrType
             extends AnnotationMemberType
         {
-            public SingletonAttrType()
+            public LongLivedAttrType()
             {
                 super( VERSION_9_0_STRING, JpfControllerGrammar.this );
             }
@@ -319,10 +319,10 @@
             public Object onCheck( AnnotationTypeElementDeclaration valueDecl, 
AnnotationValue value,
                                    AnnotationMirror[] parentAnnotations, 
MemberDeclaration classMember )
             {
-                boolean isSingleton = ( Boolean ) value.getValue();
-                if ( isSingleton && CompilerUtils.isInNestedPageFlow( 
classMember ) )
+                boolean isLongLived = ( Boolean ) value.getValue();
+                if ( isLongLived && CompilerUtils.isInNestedPageFlow( 
classMember ) )
                 {
-                    addError( value, "error.nested-singleton" );
+                    addError( value, "error.nested-long-lived" );
                 }
             
                 return null;

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/diagnostics.properties
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/diagnostics.properties
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/diagnostics.properties
 Wed Nov 17 15:19:47 2004
@@ -94,7 +94,7 @@
 exception-handler {1}.
 
 error.empty-string-not-allowed = This value may not be an empty string.
-error.nested-singleton = A nested page flow may not be a singleton.
+error.nested-long-lived = A nested page flow may not be long-lived.
 warning.unresolvable-forward = There is no forward named "{0}" declared on 
this method or on this class.
 
 error.validation-field-on-non-getter = This annotation may only be present on 
a public, non-static getter method.

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
     Wed Nov 17 15:19:47 2004
@@ -88,10 +88,10 @@
             
             if ( controllerAnnotation != null )
             {
-                boolean nested = CompilerUtils.getBoolean( 
controllerAnnotation, NESTED_ATTR, false ).booleanValue();
-                boolean single = CompilerUtils.getBoolean( 
controllerAnnotation, SINGLETON_ATTR, false ).booleanValue();
+                boolean nested = CompilerUtils.getBoolean( 
controllerAnnotation, NESTED_ATTR, false );
+                boolean longLived = CompilerUtils.getBoolean( 
controllerAnnotation, LONGLIVED_ATTR, false );
                 setNestedPageFlow( nested );
-                setSingletonPageFlow( single );
+                setLongLivedPageFlow( longLived );
                 addMessageResources( controllerAnnotation );
                 addValidationMessages( controllerAnnotation );
                 addSimpleActions( controllerAnnotation );

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/WebappPathType.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/WebappPathType.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/WebappPathType.java
    Wed Nov 17 15:19:47 2004
@@ -120,9 +120,12 @@
             {
                 TypeDeclaration type = CompilerUtils.inferTypeFromPath( 
filePath, getEnv() );
                 fileToCheck = type != null ? CompilerUtils.getOriginalFile( 
type ) : null;
-                if ( fileToCheck == null ) fileExists = false;
+                
+                // Note that if we can't infer the file from the type, we'll 
fall through to the next case, where
+                // we actually look for the file in the webapp.
             }
-            else
+            
+            if ( fileToCheck == null )
             {
                 File webappRoot = getWebFilesRoot( jpfFile, true );
                 fileToCheck = new File( webappRoot + filePath );

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/StrutsApp.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/StrutsApp.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/StrutsApp.java
   Wed Nov 17 15:19:47 2004
@@ -56,7 +56,7 @@
     private boolean _returnToPageDisabled = true;
     private boolean _returnToActionDisabled = true;
     private boolean _isNestedPageFlow = false;
-    private boolean _isSingletonPageFlow = false;
+    private boolean _isLongLivedPageFlow = false;
     private boolean _isSharedFlow = false;
     private List< String > _sharedFlowTypeNames = null;
     private String _controllerClassName = null;
@@ -680,7 +680,7 @@
             }
             
             if ( _isNestedPageFlow ) addSetProperty( controller, 
"isNestedPageFlow", "true" );
-            if ( _isSingletonPageFlow ) addSetProperty( controller, 
"isSingletonPageFlow", "true" );
+            if ( _isLongLivedPageFlow ) addSetProperty( controller, 
"isLongLivedPageFlow", "true" );
             if ( _isSharedFlow ) addSetProperty( controller, "isSharedFlow", 
"true" );
             if ( isReturnToPageDisabled() ) addSetProperty( controller, 
"isReturnToPageDisabled", "true" );
             if ( isReturnToActionDisabled() ) addSetProperty( controller, 
"isReturnToActionDisabled", "true" );
@@ -782,9 +782,9 @@
         _isNestedPageFlow = nestedPageFlow;
     }
 
-    public void setSingletonPageFlow( boolean singletonPageFlow )
+    public void setLongLivedPageFlow( boolean longLivedPageFlow )
     {
-        _isSingletonPageFlow = singletonPageFlow;
+        _isLongLivedPageFlow = longLivedPageFlow;
     }
     
     protected static String getStrutsConfigURI( String containingPackage, 
boolean isSharedFlow )

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
==============================================================================
--- 
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
    Wed Nov 17 15:19:47 2004
@@ -1207,11 +1207,11 @@
     }
 
     /**
-     * Tell whether this is a "singleton" page flow.  Once it is invoked, a 
singleton page flow is never
+     * Tell whether this is a "long lived" page flow.  Once it is invoked, a 
long lived page flow is never
      * removed from the session unless [EMAIL PROTECTED] 
FlowController#delete} is called.  Navigating to another page flow hides
-     * the current singleton controller, but does not remove it.
+     * the current long lived controller, but does not remove it.
      */
-    protected boolean isSingleton()
+    protected boolean isLongLived()
     {
         return false;
     }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowControllerFactory.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowControllerFactory.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowControllerFactory.java
     Wed Nov 17 15:19:47 2004
@@ -241,8 +241,8 @@
         try
         {
             //
-            // First check if this is a request for a singleton page flow.  If 
so, try
-            // PageFlowUtils.getCurrentPageFlow again, with the singleton flag.
+            // First check if this is a request for a "long lived" page flow.  
If so, try
+            // PageFlowUtils.getCurrentPageFlow again, with the longLived flag.
             //
             PageFlowController retVal = null;
             String modulePath = InternalUtils.inferModulePathFromClassName( 
jpfClass.getName() );
@@ -255,15 +255,15 @@
                 return null;
             }
             
-            if ( InternalUtils.isSingleton( mc ) )
+            if ( InternalUtils.isLongLived( mc ) )
             {
-                retVal = InternalUtils.getSingletonPageFlow( modulePath, 
request, false );
+                retVal = InternalUtils.getLongLivedPageFlow( modulePath, 
request, false );
                 
                 if ( _log.isDebugEnabled() )
                 {
                     if ( retVal != null )
                     {
-                        _log.debug( "Using singleton PageFlowController of 
type " + jpfClass.getName() );
+                        _log.debug( "Using long lived PageFlowController of 
type " + jpfClass.getName() );
                     }
                 }
             }
@@ -302,7 +302,7 @@
             }
             
             //
-            // OK, if it's not an existing singleton page flow, and if this 
wasn't a nested page flow already on the
+            // OK, if it's not an existing long lived page flow, and if this 
wasn't a nested page flow already on the
             // stack, then create a new instance.
             //
             if ( retVal == null )

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
        (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
        Wed Nov 17 15:19:47 2004
@@ -129,13 +129,13 @@
     }    
     
     /**
-     * Tell whether this is a "singleton" page flow.  Once it is invoked, a 
singleton page flow is never
+     * Tell whether this is a "long lived" page flow.  Once it is invoked, a 
long lived page flow is never
      * removed from the session unless [EMAIL PROTECTED] #delete} is called.  
Navigating to another page flow hides
-     * the current singleton controller, but does not remove it.
+     * the current long lived controller, but does not remove it.
      */
-    protected boolean isSingleton()
+    protected boolean isLongLived()
     {
-        return InternalUtils.isSingleton( getModuleConfig() );
+        return InternalUtils.isLongLived( getModuleConfig() );
     }    
     
     /**
@@ -146,9 +146,9 @@
         // This request attribute is used in persistInSession to prevent 
re-saving of this instance.
         request.setAttribute( DELETING_PAGEFLOW_ATTR, this );
         
-        if ( isSingleton() )
+        if ( isLongLived() )
         {
-            PageFlowUtils.deleteSingletonPageFlow( getModulePath(), request );
+            PageFlowUtils.deleteLongLivedPageFlow( getModulePath(), request );
         }
         else
         {
@@ -207,16 +207,16 @@
             ServerAdapter serverAdapter = ContextCache.get( 
getServletContext() ).getServerAdapter();
         
             //
-            // If this is a singleton page flow, there are two attributes to 
deal with.
+            // If this is a long-lived page flow, there are two attributes to 
deal with.
             //
-            if ( isSingleton() )
+            if ( isLongLived() )
             {
-                String singletonAttrName = InternalUtils.getSingletonFlowAttr( 
getModulePath() );
-                singletonAttrName = 
ScopedServletUtils.getScopedSessionAttrName( singletonAttrName, 
unwrappedRequest );
-                String currentSingletonAttrName =
-                    ScopedServletUtils.getScopedSessionAttrName( 
CURRENT_SINGLETON_ATTR, unwrappedRequest );
-                serverAdapter.ensureFailover( singletonAttrName, this, 
unwrappedRequest );
-                serverAdapter.ensureFailover( currentSingletonAttrName, 
getModulePath(), unwrappedRequest );
+                String longLivedAttrName = InternalUtils.getLongLivedFlowAttr( 
getModulePath() );
+                longLivedAttrName = 
ScopedServletUtils.getScopedSessionAttrName( longLivedAttrName, 
unwrappedRequest );
+                String currentLongLivedAttrName =
+                    ScopedServletUtils.getScopedSessionAttrName( 
CURRENT_LONGLIVED_ATTR, unwrappedRequest );
+                serverAdapter.ensureFailover( longLivedAttrName, this, 
unwrappedRequest );
+                serverAdapter.ensureFailover( currentLongLivedAttrName, 
getModulePath(), unwrappedRequest );
             }
             else
             {

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
     Wed Nov 17 15:19:47 2004
@@ -274,39 +274,39 @@
     
     
     /**
-     * Delete a "singleton" page flow from the session. Once it is created, a 
singleton page flow
+     * Delete a "long-lived" page flow from the session. Once it is created, a 
long-lived page flow
      * is never removed from the session unless this method or [EMAIL 
PROTECTED] PageFlowController#delete} is
-     * called.  Navigating to another page flow hides the current singleton 
controller, but does not
+     * called.  Navigating to another page flow hides the current long-lived 
controller, but does not
      * remove it.
      */
-    public static void deleteSingletonPageFlow( String modulePath, 
HttpServletRequest request )
+    public static void deleteLongLivedPageFlow( String modulePath, 
HttpServletRequest request )
     {
         HttpServletRequest unwrappedRequest = unwrapMultipart( request );
-        String attrName = InternalUtils.getSingletonFlowAttr( modulePath );
+        String attrName = InternalUtils.getLongLivedFlowAttr( modulePath );
         ScopedServletUtils.removeScopedSessionAttr( attrName, unwrappedRequest 
);
 
         //
-        // Now, if the current page flow is this singleton, delete the 
reference.
+        // Now, if the current page flow is long-lived, delete the reference.
         //
-        String currentSingletonModulePath =
-                ( String ) ScopedServletUtils.getScopedSessionAttr( 
CURRENT_SINGLETON_ATTR, unwrappedRequest );
+        String currentLongLivedModulePath =
+                ( String ) ScopedServletUtils.getScopedSessionAttr( 
CURRENT_LONGLIVED_ATTR, unwrappedRequest );
         
-        if ( modulePath.equals( currentSingletonModulePath ) )
+        if ( modulePath.equals( currentLongLivedModulePath ) )
         {
-            ScopedServletUtils.removeScopedSessionAttr( 
CURRENT_SINGLETON_ATTR, unwrappedRequest );
+            ScopedServletUtils.removeScopedSessionAttr( 
CURRENT_LONGLIVED_ATTR, unwrappedRequest );
         }
     }
     
     /**
-     * Get the singleton page flow instance associated with the given module 
(directory) path.
+     * Get the long-lived page flow instance associated with the given module 
(directory) path.
      * 
-     * @param modulePath the webapp-relative path to the directory containing 
the singleton page flow.
+     * @param modulePath the webapp-relative path to the directory containing 
the long-lived page flow.
      * @param request the current HttpServletRequest.
-     * @return the singleton page flow instance associated with the given 
module, or <code>null</code> if none is found.
+     * @return the long-lived page flow instance associated with the given 
module, or <code>null</code> if none is found.
      */ 
-    public static PageFlowController getSingletonPageFlow( String modulePath, 
HttpServletRequest request )
+    public static PageFlowController getLongLivedPageFlow( String modulePath, 
HttpServletRequest request )
     {
-        return InternalUtils.getSingletonPageFlow( modulePath, request, true );
+        return InternalUtils.getLongLivedPageFlow( modulePath, request, true );
     }
     
     /**

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ServerAdapter.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ServerAdapter.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ServerAdapter.java
     Wed Nov 17 15:19:47 2004
@@ -165,13 +165,4 @@
      * @return a new ControlBeanContext.
      */
     public ControlBeanContext createControlBeanContext( HttpServletRequest 
request, HttpServletResponse response );
-    
-    /**
-     * Get the build directory (or directories) where reloadable classes 
reside.
-     * 
-     * @return an array of URLs to indicate where reloadable classes reside, 
or <code>null</code> if there are no
-     *         appropriate directories.
-     * @see org.apache.beehive.netui.pageflow.handler.ReloadableClassHandler
-     */ 
-    public File[] getReloadableClassDirs();
 }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java
   Wed Nov 17 15:19:47 2004
@@ -56,9 +56,9 @@
         boolean nested() default false;
 
         /**
-         * is pageflow singleton (optional )
+         * is pageflow long-lived (optional )
          */
-        boolean singleton() default false;
+        boolean longLived() default false;
 
         /**
          * roles allowed to access actions in this page flow (optional )

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowControllerConfig.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowControllerConfig.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowControllerConfig.java
   Wed Nov 17 15:19:47 2004
@@ -32,7 +32,7 @@
     private static final String DISK_MULTIPART_HANDLER_CLASS = 
DiskMultipartRequestHandler.class.getName();
     
     private boolean _isNestedPageFlow;
-    private boolean _isSingletonPageFlow;
+    private boolean _isLongLivedPageFlow;
     private boolean _isReturnToPageDisabled;
     private boolean _isReturnToActionDisabled;
     private boolean _isMissingDefaultMessages;
@@ -53,14 +53,14 @@
         _isNestedPageFlow = nestedPageFlow;
     }
 
-    public boolean isSingletonPageFlow()
+    public boolean isLongLivedPageFlow()
     {
-        return _isSingletonPageFlow;
+        return _isLongLivedPageFlow;
     }
 
-    public void setIsSingletonPageFlow( boolean singletonPageFlow )
+    public void setIsLongLivedPageFlow( boolean longLivedPageFlow )
     {
-        _isSingletonPageFlow = singletonPageFlow;
+        _isLongLivedPageFlow = longLivedPageFlow;
     }
 
     public boolean isReturnToPageDisabled()

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultReloadableClassHandler.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultReloadableClassHandler.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultReloadableClassHandler.java
    Wed Nov 17 15:19:47 2004
@@ -53,7 +53,19 @@
         {
             ClassLoader contextClassLoader = 
Thread.currentThread().getContextClassLoader();
             ServerAdapter serverAdapter = ContextCache.get( servletContext 
).getServerAdapter();
-            File[] classDirs = serverAdapter.getReloadableClassDirs();
+            File[] classDirs = null;
+            
+            // TODO: make this configurable in netui-config.xml.  You should 
be able to specify absolute files
+            // and also context-relative paths.
+            {
+                String path = servletContext.getRealPath( "/WEB-INF/classes" );
+                
+                if ( path != null )
+                {
+                    File file = new File( path );
+                    if ( file.isDirectory() ) classDirs = new File[]{ file };
+                }
+            }
             
             if ( classDirs != null && ! serverAdapter.isInProductionMode() )
             {

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultServerAdapter.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultServerAdapter.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultServerAdapter.java
     Wed Nov 17 15:19:47 2004
@@ -114,12 +114,6 @@
         return new PageFlowBeanContext();
     }
 
-    public File[] getReloadableClassDirs()
-    {
-        String path = _servletContext.getRealPath( "/WEB-INF/classes" );
-        return path != null ? new File[]{ new File( path ) } : null;
-    }
-
     protected ServletContext getServletContext()
     {
         return _servletContext;

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalConstants.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalConstants.java
        (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalConstants.java
        Wed Nov 17 15:19:47 2004
@@ -52,7 +52,7 @@
     public static final String RETURNING_FORM_ATTR = ATTR_PREFIX + 
"returningForm";
     public static final String RETURNING_FROM_NESTING_ATTR = ATTR_PREFIX + 
"nestedReturning";
     public static final String CURRENT_JPF_ATTR = ATTR_PREFIX + "curPageFlow";
-    public static final String CURRENT_SINGLETON_ATTR = ATTR_PREFIX + 
"curSingletonModule";
+    public static final String CURRENT_LONGLIVED_ATTR = ATTR_PREFIX + 
"curLongLivedModule";
     public static final String SHARED_FLOW_ATTR_PREFIX = ATTR_PREFIX + 
"sharedFlow:";
 
     

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
    Wed Nov 17 15:19:47 2004
@@ -70,7 +70,7 @@
     private static final String APACHE_XMLOBJECT_CLASSNAME = 
"org.apache.xmlbeans.XmlObject";
     private static final Class BEA_XMLOBJECT_CLASS = loadClassNonFatal( 
BEA_XMLOBJECT_CLASSNAME );
     private static final Class APACHE_XMLOBJECT_CLASS = loadClassNonFatal( 
APACHE_XMLOBJECT_CLASSNAME );
-    private static final String SINGLETON_PAGEFLOWS_ATTR_PREFIX = ATTR_PREFIX 
+ "singletonPageFlow:";
+    private static final String LONGLIVED_PAGEFLOWS_ATTR_PREFIX = ATTR_PREFIX 
+ "longLivedPageFlow:";
     private static final String ACTIONOUTPUT_MAP_ATTR = ATTR_PREFIX + 
"actionOutputs";
     private static final String BINDING_UPDATE_ERRORS_ATTR = ATTR_PREFIX + 
"bindingUpdateErrors";
     private static final String SHARED_FLOW_CLASSNAME_ATTR = ATTR_PREFIX + 
"sharedFlowClass";
@@ -288,16 +288,16 @@
     public static ActionResolver getCurrentActionResolver( HttpServletRequest 
request, boolean warnAboutClassLoaders )
     {
         //
-        // First see if the current page flow is a singleton, which is stored 
in its own attribute.
+        // First see if the current page flow is a long-lived, which is stored 
in its own attribute.
         //
         HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( 
request );
-        String currentSingletonModulePath =
-                ( String ) ScopedServletUtils.getScopedSessionAttr( 
CURRENT_SINGLETON_ATTR, unwrappedRequest );
+        String currentLongLivedModulePath =
+                ( String ) ScopedServletUtils.getScopedSessionAttr( 
CURRENT_LONGLIVED_ATTR, unwrappedRequest );
         ActionResolver retVal;
         
-        if ( currentSingletonModulePath != null )
+        if ( currentLongLivedModulePath != null )
         {
-            retVal = getSingletonPageFlow( currentSingletonModulePath, 
unwrappedRequest, warnAboutClassLoaders );
+            retVal = getLongLivedPageFlow( currentLongLivedModulePath, 
unwrappedRequest, warnAboutClassLoaders );
         }
         else
         {
@@ -360,16 +360,16 @@
     }
     
     /**
-     * Get the singleton page flow instance associated with the given module 
(directory) path.
+     * Get the long-lived page flow instance associated with the given module 
(directory) path.
      * 
-     * @param modulePath the webapp-relative path to the directory containing 
the singleton page flow.
+     * @param modulePath the webapp-relative path to the directory containing 
the long-lived page flow.
      * @param request the current HttpServletRequest.
-     * @return the singleton page flow instance associated with the given 
module, or <code>null</code> if none is found.
+     * @return the long-lived page flow instance associated with the given 
module, or <code>null</code> if none is found.
      */ 
-    public static PageFlowController getSingletonPageFlow( String modulePath, 
HttpServletRequest request,
+    public static PageFlowController getLongLivedPageFlow( String modulePath, 
HttpServletRequest request,
                                                            boolean 
warnAboutClassLoaders )
     {
-        String attr = getSingletonFlowAttr( modulePath );
+        String attr = getLongLivedFlowAttr( modulePath );
         PageFlowController retVal =  ( PageFlowController )
                 ScopedServletUtils.getScopedSessionAttr( attr, 
PageFlowUtils.unwrapMultipart( request ) );
         if ( warnAboutClassLoaders ) warnAboutClassLoaders( retVal, request );
@@ -377,15 +377,15 @@
     }
     
     /**
-     * Tell whether the given module is a singleton page flow.
+     * Tell whether the given module is a long-lived page flow.
      */
-    public static boolean isSingleton( ModuleConfig moduleConfig )
+    public static boolean isLongLived( ModuleConfig moduleConfig )
     {
         ControllerConfig cc = moduleConfig.getControllerConfig();
         
         if ( cc instanceof PageFlowControllerConfig )
         {
-            return ( ( PageFlowControllerConfig ) cc ).isSingletonPageFlow();
+            return ( ( PageFlowControllerConfig ) cc ).isLongLivedPageFlow();
         }
         else
         {
@@ -402,9 +402,9 @@
         return cc instanceof PageFlowControllerConfig && ( ( 
PageFlowControllerConfig ) cc ).isNestedPageFlow();
     }
      
-    public static String getSingletonFlowAttr( String modulePath )
+    public static String getLongLivedFlowAttr( String modulePath )
     {
-        return SINGLETON_PAGEFLOWS_ATTR_PREFIX + modulePath;
+        return LONGLIVED_PAGEFLOWS_ATTR_PREFIX + modulePath;
     }
     
     public static void setCurrentPageFlow( PageFlowController jpf, 
HttpServletRequest request )
@@ -416,7 +416,7 @@
     {
         HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( 
request );
         ScopedServletUtils.removeScopedSessionAttr( CURRENT_JPF_ATTR, 
unwrappedRequest );
-        ScopedServletUtils.removeScopedSessionAttr( CURRENT_SINGLETON_ATTR, 
unwrappedRequest );
+        ScopedServletUtils.removeScopedSessionAttr( CURRENT_LONGLIVED_ATTR, 
unwrappedRequest );
     }
     
     public static String getDecodedURI( HttpServletRequest request )
@@ -822,26 +822,26 @@
         if ( resolver == null )
         {
             ScopedServletUtils.removeScopedSessionAttr( CURRENT_JPF_ATTR, 
unwrappedRequest );
-            ScopedServletUtils.removeScopedSessionAttr( 
CURRENT_SINGLETON_ATTR, unwrappedRequest );
+            ScopedServletUtils.removeScopedSessionAttr( 
CURRENT_LONGLIVED_ATTR, unwrappedRequest );
             return;
         }
         
         //
-        // If this is a singleton page flow, also store the instance in an 
attribute that never goes away.
+        // If this is a long-lived page flow, also store the instance in an 
attribute that never goes away.
         //
         if ( resolver.isPageFlow() &&
-                InternalUtils.isSingleton( ( ( PageFlowController ) resolver 
).getModuleConfig() ) )
+                InternalUtils.isLongLived( ( ( PageFlowController ) resolver 
).getModuleConfig() ) )
         {
-            String singletonAttrName = InternalUtils.getSingletonFlowAttr( 
resolver.getModulePath() );
-            ScopedServletUtils.setScopedSessionAttr( singletonAttrName, 
resolver, unwrappedRequest );
-            ScopedServletUtils.setScopedSessionAttr( CURRENT_SINGLETON_ATTR, 
resolver.getModulePath(),
+            String longLivedAttrName = InternalUtils.getLongLivedFlowAttr( 
resolver.getModulePath() );
+            ScopedServletUtils.setScopedSessionAttr( longLivedAttrName, 
resolver, unwrappedRequest );
+            ScopedServletUtils.setScopedSessionAttr( CURRENT_LONGLIVED_ATTR, 
resolver.getModulePath(),
                                                      unwrappedRequest );
             ScopedServletUtils.removeScopedSessionAttr( CURRENT_JPF_ATTR, 
unwrappedRequest );
         }
         else
         {
             ScopedServletUtils.setScopedSessionAttr( CURRENT_JPF_ATTR, 
resolver, unwrappedRequest );
-            ScopedServletUtils.removeScopedSessionAttr( 
CURRENT_SINGLETON_ATTR, unwrappedRequest );
+            ScopedServletUtils.removeScopedSessionAttr( 
CURRENT_LONGLIVED_ATTR, unwrappedRequest );
         }
     }
     

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/index/Controller.jpf
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/index/Controller.jpf 
(original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/index/Controller.jpf 
Wed Nov 17 15:19:47 2004
@@ -34,7 +34,7 @@
     simpleActions={
         @Jpf.SimpleAction(name="begin", path="index.jsp")
     },
-    singleton = true
+    longLived = true
 )
 public class Controller extends PageFlowController
 {

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/pfSingleton/nav/NavController.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/pfSingleton/nav/NavController.jpf
       (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/pfSingleton/nav/NavController.jpf
       Wed Nov 17 15:19:47 2004
@@ -62,7 +62,7 @@
  * ::
  */
 @Jpf.Controller(
-    singleton = true)
+    longLived = true)
 @Jpf.ViewProperties(
     value = {
         "<!-- This data is auto-generated. Hand-editing this section is not 
recommended. -->",

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/pfSingleton/singleton/SingletonController.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/pfSingleton/singleton/SingletonController.jpf
   (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/pfSingleton/singleton/SingletonController.jpf
   Wed Nov 17 15:19:47 2004
@@ -107,7 +107,7 @@
  * ::
  */
 @Jpf.Controller(
-    singleton = true)
+    longLived = true)
 @Jpf.ViewProperties(
     value = {
         "<!-- This data is auto-generated. Hand-editing this section is not 
recommended. -->",

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest10/jpf1/Jpf1.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest10/jpf1/Jpf1.jpf
 (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest10/jpf1/Jpf1.jpf
 Wed Nov 17 15:19:47 2004
@@ -120,7 +120,7 @@
  *
  */
 @Jpf.Controller(
-    singleton = true,
+    longLived = true,
     forwards = {
         @Jpf.Forward(
             name = "gotoDone",

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest6/jpf1/Jpf1.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest6/jpf1/Jpf1.jpf
  (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest6/jpf1/Jpf1.jpf
  Wed Nov 17 15:19:47 2004
@@ -109,7 +109,7 @@
  *
  */
 @Jpf.Controller(
-    singleton = true,
+    longLived = true,
     forwards = {
         @Jpf.Forward(
             name = "gotoDone",

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest8/jpf1/Jpf1.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest8/jpf1/Jpf1.jpf
  (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest8/jpf1/Jpf1.jpf
  Wed Nov 17 15:19:47 2004
@@ -149,7 +149,7 @@
  *
  */
 @Jpf.Controller(
-    singleton = true,
+    longLived = true,
     forwards = {
         @Jpf.Forward(
             name = "gotoDone",

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest9/jpf2/Jpf2.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest9/jpf2/Jpf2.jpf
  (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/singletonJpf/jpfTest9/jpf2/Jpf2.jpf
  Wed Nov 17 15:19:47 2004
@@ -92,7 +92,7 @@
  *
  */
 @Jpf.Controller(
-    singleton = true,
+    longLived = true,
     forwards = {
         @Jpf.Forward(
             name = "gotoDone",

Reply via email to