Seam SVN: r9596 - trunk.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-11-18 08:22:30 -0500 (Tue, 18 Nov 2008)
New Revision: 9596
Modified:
trunk/changelog.txt
trunk/readme.txt
Log:
for release
Modified: trunk/changelog.txt
===================================================================
--- trunk/changelog.txt 2008-11-18 13:02:38 UTC (rev 9595)
+++ trunk/changelog.txt 2008-11-18 13:22:30 UTC (rev 9596)
@@ -1,6 +1,85 @@
JBoss Seam Changelog
====================
+Release Notes - Seam - Version 2.1.1.CR1
+
+** Bug
+ * [JBSEAM-1738] - seam-gen should uppercase Oracle schema names
+ * [JBSEAM-2209] - Fix passivation/activation of entities loaded using an SMPC
+ * [JBSEAM-2881] - Conversation Switcher doesn't work with natural conversations
+ * [JBSEAM-2933] - Seam 2.1-snapshot, gwt1.5m2, array issues
+ * [JBSEAM-3386] - Building with ant 1.7.1 causes NPE in testing/deployed apps
+ * [JBSEAM-3472] - itext example - NPE on swing component
+ * [JBSEAM-3519] - Excessive JNDI lookups for "java:comp/UserTransation"
+ * [JBSEAM-3544] - Problem sending email in Glassfish v2 in a cluster application
+ * [JBSEAM-3552] - User/role manager in seamspace needs to be QA'ed for stability
+ * [JBSEAM-3575] - Excessive logging from Initialization class for every ajax request
+ * [JBSEAM-3576] - readme.txt in examples dir states old version of jboss
+ * [JBSEAM-3580] - AbstractSeamTest unnecessary cast prevents subclassing
+ * [JBSEAM-3589] - seamspace example shows no users/roles/permissions when attempting to adjust them.
+ * [JBSEAM-3590] - itext example shows 404 not found when accessed
+ * [JBSEAM-3593] - itext example throws a ResourceNotFoundException when you first navigate to the page
+ * [JBSEAM-3594] - Wicket instrumentation fails on inherited components
+ * [JBSEAM-3604] - outjection interferes with page parameters
+ * [JBSEAM-3609] - Performance problem: when using <s:link> or <s:button> with page.xml
+ * [JBSEAM-3613] - NPE in FileDescriptor::hashCode
+ * [JBSEAM-3618] - CNFE javax.ejb.PostActivate with non-ejb3 seam app in websphere v6.1.0.17
+ * [JBSEAM-3619] - JpaPermissionStore fails using diffent properties for PermissionRole and PermissionUser on the same entity
+ * [JBSEAM-3622] - SFSB not removed from session when temporary conversation ends
+ * [JBSEAM-3626] - generated default datasource references dtd that errors and causes JBOSS AS5.0.0CR2 to not load datasource
+ * [JBSEAM-3627] - Wrong code example in reference
+ * [JBSEAM-3646] - Declare log transient in AsynchronousInvocation
+ * [JBSEAM-3650] - Quartz-asynchronous throws NotSerializableException (from AsynchronousInvocation.log)
+ * [JBSEAM-3652] - Major reentrancy problem with "Page Scope" components and injection/disinjection
+ * [JBSEAM-3653] - Remove String concat in ScopeType
+ * [JBSEAM-3654] - Reduce number of checks to see if Jbpm is installed in BusinessProcessContext
+ * [JBSEAM-3655] - Caching in ServerConversationContext
+ * [JBSEAM-3656] - Eliminate unnecessary String concat in PageContext
+ * [JBSEAM-3658] - Wicket components with children that don't implement virtual methods fail to instrument
+ * [JBSEAM-3665] - Updates to WEB-INF/dev classes don't trigger a redeploy
+ * [JBSEAM-3673] - horizontalAlignment="right" broken in PDF cells (regression)
+ * [JBSEAM-3681] - WTF code in RuleBasedPermissionResolver
+ * [JBSEAM-3691] - Seam Excel header for center facet does not work
+ * [JBSEAM-3699] - Slow hot deployment - Seam scans and builds component tree each time to check for hot deploy changes
+ * [JBSEAM-3700] - Exclude xhtml files from those that trigger a redeploy
+ * [JBSEAM-3701] - Timestamp check war changes
+
+** Feature Request
+ * [JBSEAM-164] - Kill all conversations
+ * [JBSEAM-633] - remoting extension in handling exceptions on client side
+ * [JBSEAM-681] - PDF form support
+ * [JBSEAM-2093] - Optimize getting Id in Seam code for better performance
+ * [JBSEAM-2154] - Ability to raise multiple events in pages.xml
+ * [JBSEAM-2310] - Need an option to remove URL parameters from a URL
+ * [JBSEAM-2402] - Validate that @Converter and @Validator components are declared @BypassInterceptors
+ * [JBSEAM-2463] - add legendOutlinePaint to line and bar chart
+ * [JBSEAM-2655] - Support for OpenID
+ * [JBSEAM-3214] - Improve Excel unit/integration tests
+ * [JBSEAM-3276] - Alter Seam deployment SPI to allow delegating metadata discovery to runtime
+ * [JBSEAM-3483] - conditional PARAM tag in .page.xml
+ * [JBSEAM-3486] - Identity Management API allowing inheritance of entity annotations
+ * [JBSEAM-3505] - Support instrumentation of wicket classes at build time
+ * [JBSEAM-3582] - Use a pool for stateless components
+ * [JBSEAM-3596] - Add @SelectItems for exporting a list or hash to a List<SelectItem> context variable
+ * [JBSEAM-3616] - have seam-gen prepare project files for IntelliJ IDEA
+ * [JBSEAM-3642] - Enforce use of JDK >= 1.6.0_04 when using Java 6 for tests in seam-gen or examples
+ * [JBSEAM-3705] - debug.xhtml should have switch disabled by default
+
+** Patch
+ * [JBSEAM-3268] - Calling AuctionService webservice gives marshalling error
+ * [JBSEAM-3621] - Support hot-deployment of instrumented wicket components
+ * [JBSEAM-3638] - SeamTest causing NPE when run in multi-module Maven project on Linux
+ * [JBSEAM-3662] - Document wicket build-time instrumentation
+
+** Task
+ * [JBSEAM-2704] - Document patterns which improve performance
+ * [JBSEAM-3485] - Optimize how the InitialContext is created in org.jboss.seam.util.Naming
+ * [JBSEAM-3553] - context path of demos needs to be predictable
+ * [JBSEAM-3558] - Document conversation-required attribute in pages.xml
+ * [JBSEAM-3687] - Use log.isDebugEnabled() in Contexts.lookupInStatefulContexts
+
+
+
Release Notes - Seam - Version 2.1.0.GA
** Bug
Modified: trunk/readme.txt
===================================================================
--- trunk/readme.txt 2008-11-18 13:02:38 UTC (rev 9595)
+++ trunk/readme.txt 2008-11-18 13:22:30 UTC (rev 9596)
@@ -1,7 +1,7 @@
JBoss Seam - Contextual Component framework for Java EE 5
=========================================================
-version 2.1.1.GA, October 2008
+version 2.1.1.CR1, November 2008
This software is distributed under the terms of the FSF Lesser Gnu
Public License (see lgpl.txt).
16 years
Seam SVN: r9595 - in trunk/src/main/org/jboss/seam: init and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-11-18 08:02:38 -0500 (Tue, 18 Nov 2008)
New Revision: 9595
Added:
trunk/src/main/org/jboss/seam/deployment/ForwardingAbstractScanner.java
trunk/src/main/org/jboss/seam/deployment/ForwardingDeploymentStrategy.java
trunk/src/main/org/jboss/seam/deployment/TimestampCheckForwardingDeploymentStrategy.java
trunk/src/main/org/jboss/seam/deployment/TimestampScanner.java
Removed:
trunk/src/main/org/jboss/seam/deployment/HotDeploymentTimestampCheckStrategy.java
trunk/src/main/org/jboss/seam/deployment/TimestampCheckStrategy.java
trunk/src/main/org/jboss/seam/deployment/TimestampURLScanner.java
trunk/src/main/org/jboss/seam/deployment/WarRootTimestampCheckStrategy.java
Modified:
trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java
trunk/src/main/org/jboss/seam/deployment/DeploymentStrategy.java
trunk/src/main/org/jboss/seam/deployment/Scanner.java
trunk/src/main/org/jboss/seam/deployment/URLScanner.java
trunk/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java
trunk/src/main/org/jboss/seam/init/Initialization.java
Log:
JBSEAM-3699, fix for compatiblity, and improve architecture
Modified: trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java 2008-11-18 12:28:38 UTC (rev 9594)
+++ trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java 2008-11-18 13:02:38 UTC (rev 9595)
@@ -1,7 +1,6 @@
package org.jboss.seam.deployment;
import java.io.DataInputStream;
-import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
@@ -17,6 +16,8 @@
/**
* Abstract base class for {@link Scanner} providing common functionality
*
+ * This class provides file-system orientated scanning
+ *
* @author Pete Muir
*
*/
@@ -134,6 +135,11 @@
ClassFile.class.getPackage(); //to force loading of javassist, throwing an exception if it is missing
}
+ protected AbstractScanner()
+ {
+
+ }
+
protected static boolean hasAnnotations(ClassFile classFile, Set<Class<? extends Annotation>> annotationTypes)
{
if (annotationTypes.size() > 0)
@@ -190,17 +196,15 @@
return Long.MAX_VALUE;
}
- protected boolean handleItem(String name)
+ protected void handleItem(String name)
{
- return new Handler(name, deploymentStrategy.getDeploymentHandlers().entrySet(), deploymentStrategy.getClassLoader()).handle();
+ handle(name);
}
- /**
- * Default impl of scanDirectories with exclusions for backwards compatibility
- */
- public void scanDirectories(File[] directories, File[] excludedDirectories)
+
+ protected boolean handle(String name)
{
- scanDirectories(directories);
+ return new Handler(name, deploymentStrategy.getDeploymentHandlers().entrySet(), deploymentStrategy.getClassLoader()).handle();
}
}
Modified: trunk/src/main/org/jboss/seam/deployment/DeploymentStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/DeploymentStrategy.java 2008-11-18 12:28:38 UTC (rev 9594)
+++ trunk/src/main/org/jboss/seam/deployment/DeploymentStrategy.java 2008-11-18 13:02:38 UTC (rev 9595)
@@ -90,7 +90,7 @@
protected abstract String getDeploymentHandlersKey();
- private void initScanner()
+ protected void initScanner()
{
List<String> scanners = new SeamDeploymentProperties(getClassLoader()).getPropertyValues(SCANNERS_KEY);
for ( String className : scanners )
Added: trunk/src/main/org/jboss/seam/deployment/ForwardingAbstractScanner.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/ForwardingAbstractScanner.java (rev 0)
+++ trunk/src/main/org/jboss/seam/deployment/ForwardingAbstractScanner.java 2008-11-18 13:02:38 UTC (rev 9595)
@@ -0,0 +1,57 @@
+package org.jboss.seam.deployment;
+
+import java.io.File;
+
+
+public abstract class ForwardingAbstractScanner extends AbstractScanner
+{
+
+ @Override
+ public DeploymentStrategy getDeploymentStrategy()
+ {
+ return delegate().getDeploymentStrategy();
+ }
+
+ @Override
+ public long getTimestamp()
+ {
+ return delegate().getTimestamp();
+ }
+
+ public void scanDirectories(File[] directories)
+ {
+ delegate().scanDirectories(directories);
+ }
+
+ public void scanResources(String[] resources)
+ {
+ delegate().scanResources(resources);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ protected boolean handle(String name)
+ {
+ return delegate().handle(name);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+ protected abstract AbstractScanner delegate();
+
+}
Property changes on: trunk/src/main/org/jboss/seam/deployment/ForwardingAbstractScanner.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/org/jboss/seam/deployment/ForwardingDeploymentStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/ForwardingDeploymentStrategy.java (rev 0)
+++ trunk/src/main/org/jboss/seam/deployment/ForwardingDeploymentStrategy.java 2008-11-18 13:02:38 UTC (rev 9595)
@@ -0,0 +1,90 @@
+package org.jboss.seam.deployment;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A decorator for DeploymentStrategy
+ *
+ * @author Dan Allen
+ * @author Pete Muir
+ */
+public abstract class ForwardingDeploymentStrategy extends DeploymentStrategy
+{
+
+ @Override
+ public ClassLoader getClassLoader()
+ {
+ return delegate().getClassLoader();
+ }
+
+ @Override
+ protected String getDeploymentHandlersKey()
+ {
+ return delegate().getDeploymentHandlersKey();
+ }
+
+ @Override
+ public void scan()
+ {
+ delegate().scan();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public Map<String, DeploymentHandler> getDeploymentHandlers()
+ {
+ return delegate().getDeploymentHandlers();
+ }
+
+ @Override
+ public List<File> getFiles()
+ {
+ return delegate().getFiles();
+ }
+
+ @Override
+ protected Scanner getScanner()
+ {
+ return delegate().getScanner();
+ }
+
+ @Override
+ public long getTimestamp()
+ {
+ return delegate().getTimestamp();
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+ @Override
+ protected void postScan()
+ {
+ delegate().postScan();
+ }
+
+ @Override
+ public void setFiles(List<File> files)
+ {
+ delegate().setFiles(files);
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+ protected abstract DeploymentStrategy delegate();
+
+}
\ No newline at end of file
Property changes on: trunk/src/main/org/jboss/seam/deployment/ForwardingDeploymentStrategy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/org/jboss/seam/deployment/HotDeploymentTimestampCheckStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/HotDeploymentTimestampCheckStrategy.java 2008-11-18 12:28:38 UTC (rev 9594)
+++ trunk/src/main/org/jboss/seam/deployment/HotDeploymentTimestampCheckStrategy.java 2008-11-18 13:02:38 UTC (rev 9595)
@@ -1,33 +0,0 @@
-package org.jboss.seam.deployment;
-
-import java.io.File;
-
-/**
- * An accelerated version of the HotDeploymentStrategy that uses the SimpleURLScanner
- * to determine the timestamp of the latest file.
- *
- * @author Dan Allen
- */
-public class HotDeploymentTimestampCheckStrategy extends TimestampCheckStrategy
-{
- private HotDeploymentStrategy delegateStrategy;
-
- public HotDeploymentTimestampCheckStrategy(HotDeploymentStrategy hotDeploymentStrategy)
- {
- delegateStrategy = hotDeploymentStrategy;
- getDeploymentHandlers().putAll(delegateStrategy.getDeploymentHandlers());
- }
-
- @Override
- public DeploymentStrategy getDelegateStrategy()
- {
- return delegateStrategy;
- }
-
- @Override
- public void scan()
- {
- getScanner().scanDirectories(delegateStrategy.getFiles().toArray(new File[0]));
- }
-
-}
Modified: trunk/src/main/org/jboss/seam/deployment/Scanner.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/Scanner.java 2008-11-18 12:28:38 UTC (rev 9594)
+++ trunk/src/main/org/jboss/seam/deployment/Scanner.java 2008-11-18 13:02:38 UTC (rev 9595)
@@ -12,12 +12,6 @@
*/
public interface Scanner
{
- /**
- * Recursively scan directories
- *
- * @param directories An array of the roots of the directory trees to scan
- */
- public void scanDirectories(File[] directories);
/**
* Recursively scan directories, skipping directories in the exclusion list.
@@ -25,7 +19,7 @@
* @param directories An array of the roots of the directory trees to scan
* @param excludedDirectories Directories to skip over during the recursive scan
*/
- public void scanDirectories(File[] directories, File[] excludedDirectories);
+ public void scanDirectories(File[] directories);
/**
* Scan for structures which contain any of the given resources in their root
Copied: trunk/src/main/org/jboss/seam/deployment/TimestampCheckForwardingDeploymentStrategy.java (from rev 9589, trunk/src/main/org/jboss/seam/deployment/TimestampCheckStrategy.java)
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/TimestampCheckForwardingDeploymentStrategy.java (rev 0)
+++ trunk/src/main/org/jboss/seam/deployment/TimestampCheckForwardingDeploymentStrategy.java 2008-11-18 13:02:38 UTC (rev 9595)
@@ -0,0 +1,45 @@
+package org.jboss.seam.deployment;
+
+/**
+ * An accelerated version of the underlying strategy that uses the SimpleURLScanner
+ * to determine the timestamp of the latest file.
+ *
+ * @author Dan Allen
+ */
+public abstract class TimestampCheckForwardingDeploymentStrategy extends ForwardingDeploymentStrategy
+{
+ private Scanner scanner;
+
+ public boolean changedSince(long mark)
+ {
+ scan();
+ return getTimestamp() > mark;
+ }
+
+ @Override
+ protected void initScanner()
+ {
+ if (getScanner() instanceof AbstractScanner)
+ {
+ final AbstractScanner delegate = (AbstractScanner) getScanner();
+ this.scanner = new TimestampScanner()
+ {
+
+ @Override
+ protected AbstractScanner delegate()
+ {
+ return delegate;
+ }
+
+ };
+ }
+
+ }
+
+ @Override
+ protected void postScan()
+ {
+ // No-op
+ }
+
+}
\ No newline at end of file
Deleted: trunk/src/main/org/jboss/seam/deployment/TimestampCheckStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/TimestampCheckStrategy.java 2008-11-18 12:28:38 UTC (rev 9594)
+++ trunk/src/main/org/jboss/seam/deployment/TimestampCheckStrategy.java 2008-11-18 13:02:38 UTC (rev 9595)
@@ -1,48 +0,0 @@
-package org.jboss.seam.deployment;
-
-/**
- * An accelerated version of the underlying strategy that uses the SimpleURLScanner
- * to determine the timestamp of the latest file.
- *
- * @author Dan Allen
- */
-public abstract class TimestampCheckStrategy extends DeploymentStrategy
-{
- private Scanner scanner;
-
- @Override
- public ClassLoader getClassLoader()
- {
- return getDelegateStrategy().getClassLoader();
- }
-
- @Override
- protected String getDeploymentHandlersKey()
- {
- return getDelegateStrategy().getDeploymentHandlersKey();
- }
-
- public abstract DeploymentStrategy getDelegateStrategy();
-
- public boolean changedSince(long mark)
- {
- scan();
- return getTimestamp() > mark;
- }
-
- @Override
- public Scanner getScanner()
- {
- if (scanner == null)
- {
- initScanner();
- }
- return scanner;
- }
-
- protected void initScanner()
- {
- scanner = new TimestampURLScanner(this);
- }
-
-}
\ No newline at end of file
Copied: trunk/src/main/org/jboss/seam/deployment/TimestampScanner.java (from rev 9589, trunk/src/main/org/jboss/seam/deployment/TimestampURLScanner.java)
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/TimestampScanner.java (rev 0)
+++ trunk/src/main/org/jboss/seam/deployment/TimestampScanner.java 2008-11-18 13:02:38 UTC (rev 9595)
@@ -0,0 +1,36 @@
+package org.jboss.seam.deployment;
+
+/**
+ * A no-op version of the URLScanner that merely returns whether the deployment
+ * handler would in fact handle this file. It does not process the file
+ * in any way. This allows us to use this scanner for timestamp checking.
+ *
+ * @author Dan Allen
+ */
+public abstract class TimestampScanner extends ForwardingAbstractScanner
+{
+
+ @Override
+ protected boolean handle(String name)
+ {
+ for (DeploymentHandler handler : getDeploymentStrategy().getDeploymentHandlers().values())
+ {
+ if (handler instanceof ClassDeploymentHandler)
+ {
+ if (name.endsWith(".class"))
+ {
+ return true;
+ }
+ }
+ else
+ {
+ if (name.endsWith(handler.getMetadata().getFileNameSuffix()))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+}
Deleted: trunk/src/main/org/jboss/seam/deployment/TimestampURLScanner.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/TimestampURLScanner.java 2008-11-18 12:28:38 UTC (rev 9594)
+++ trunk/src/main/org/jboss/seam/deployment/TimestampURLScanner.java 2008-11-18 13:02:38 UTC (rev 9595)
@@ -1,40 +0,0 @@
-package org.jboss.seam.deployment;
-
-/**
- * A no-op version of the URLScanner that merely returns whether the deployment
- * handler would in fact handle this file. It does not process the file
- * in any way. This allows us to use this scanner for timestamp checking.
- *
- * @author Dan Allen
- */
-public class TimestampURLScanner extends URLScanner
-{
- public TimestampURLScanner(DeploymentStrategy deploymentStrategy)
- {
- super(deploymentStrategy);
- }
-
- @Override
- protected boolean handleItem(String name)
- {
- for (DeploymentHandler handler : getDeploymentStrategy().getDeploymentHandlers().values())
- {
- if (handler instanceof ClassDeploymentHandler)
- {
- if (name.endsWith(".class"))
- {
- return true;
- }
- }
- else
- {
- if (name.endsWith(handler.getMetadata().getFileNameSuffix()))
- {
- return true;
- }
- }
- }
- return false;
- }
-
-}
Modified: trunk/src/main/org/jboss/seam/deployment/URLScanner.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/URLScanner.java 2008-11-18 12:28:38 UTC (rev 9594)
+++ trunk/src/main/org/jboss/seam/deployment/URLScanner.java 2008-11-18 13:02:38 UTC (rev 9595)
@@ -40,8 +40,7 @@
scanDirectories(directories, new File[0]);
}
- @Override
- public void scanDirectories(File[] directories, File[] excludedDirectories)
+ public void scanDirectories(File[] directories, File... excludedDirectories)
{
for (File directory : directories)
{
@@ -126,7 +125,7 @@
{
ZipEntry entry = entries.nextElement();
String name = entry.getName();
- handleItem(name);
+ handle(name);
}
}
catch (ZipException e)
@@ -161,7 +160,7 @@
}
else
{
- if (handleItem(newPath))
+ if (handle(newPath))
{
// only try to update the timestamp on this scanner if the file was actually handled
touchTimestamp(child);
Modified: trunk/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java 2008-11-18 12:28:38 UTC (rev 9594)
+++ trunk/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java 2008-11-18 13:02:38 UTC (rev 9595)
@@ -69,7 +69,7 @@
@Override
public void scan()
{
- getScanner().scanDirectories(warRoot, excludedDirectories);
+ getScanner().scanDirectories(warRoot/*, excludedDirectories*/);
postScan();
}
Deleted: trunk/src/main/org/jboss/seam/deployment/WarRootTimestampCheckStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/WarRootTimestampCheckStrategy.java 2008-11-18 12:28:38 UTC (rev 9594)
+++ trunk/src/main/org/jboss/seam/deployment/WarRootTimestampCheckStrategy.java 2008-11-18 13:02:38 UTC (rev 9595)
@@ -1,34 +0,0 @@
-package org.jboss.seam.deployment;
-
-import java.io.File;
-
-
-/**
- * An accelerated version of the WarRootDeploymentStrategy that uses the SimpleURLScanner
- * to determine the timestamp of the latest file.
- *
- * @author Dan Allen
- */
-public class WarRootTimestampCheckStrategy extends TimestampCheckStrategy
-{
- private WarRootDeploymentStrategy delegateStrategy;
-
- public WarRootTimestampCheckStrategy(WarRootDeploymentStrategy warRootDeploymentStrategy)
- {
- delegateStrategy = warRootDeploymentStrategy;
- getDeploymentHandlers().putAll(delegateStrategy.getDeploymentHandlers());
- }
-
- @Override
- public DeploymentStrategy getDelegateStrategy()
- {
- return delegateStrategy;
- }
-
- @Override
- public void scan()
- {
- getScanner().scanDirectories(delegateStrategy.getFiles().toArray(new File[0]), delegateStrategy.getExcludedDirectories());
- }
-
-}
Modified: trunk/src/main/org/jboss/seam/init/Initialization.java
===================================================================
--- trunk/src/main/org/jboss/seam/init/Initialization.java 2008-11-18 12:28:38 UTC (rev 9594)
+++ trunk/src/main/org/jboss/seam/init/Initialization.java 2008-11-18 13:02:38 UTC (rev 9595)
@@ -49,13 +49,13 @@
import org.jboss.seam.core.Expressions;
import org.jboss.seam.core.Init;
import org.jboss.seam.deployment.ClassDescriptor;
+import org.jboss.seam.deployment.DeploymentStrategy;
import org.jboss.seam.deployment.FileDescriptor;
import org.jboss.seam.deployment.HotDeploymentStrategy;
-import org.jboss.seam.deployment.HotDeploymentTimestampCheckStrategy;
import org.jboss.seam.deployment.SeamDeploymentProperties;
import org.jboss.seam.deployment.StandardDeploymentStrategy;
+import org.jboss.seam.deployment.TimestampCheckForwardingDeploymentStrategy;
import org.jboss.seam.deployment.WarRootDeploymentStrategy;
-import org.jboss.seam.deployment.WarRootTimestampCheckStrategy;
import org.jboss.seam.exception.Exceptions;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
@@ -756,8 +756,19 @@
{
hotDeploymentStrategy = createHotDeployment(Thread.currentThread().getContextClassLoader(), isHotDeployEnabled(init));
- if (hotDeploymentStrategy.available() && new HotDeploymentTimestampCheckStrategy(hotDeploymentStrategy).changedSince(init.getTimestamp()))
+ boolean changed = new TimestampCheckForwardingDeploymentStrategy()
{
+
+ @Override
+ protected DeploymentStrategy delegate()
+ {
+ return hotDeploymentStrategy;
+ }
+
+ }.changedSince(init.getTimestamp());
+
+ if (hotDeploymentStrategy.available() && changed)
+ {
ServletLifecycle.beginReinitialization(request);
Contexts.getEventContext().set(HotDeploymentStrategy.NAME, hotDeploymentStrategy);
hotDeploymentStrategy.scan();
@@ -792,10 +803,19 @@
ServletLifecycle.endReinitialization();
}
- WarRootDeploymentStrategy warRootDeploymentStrategy = new WarRootDeploymentStrategy(
- Thread.currentThread().getContextClassLoader(), warRoot, new File[] { warClassesDirectory, warLibDirectory, hotDeployDirectory });
- if (new WarRootTimestampCheckStrategy(warRootDeploymentStrategy).changedSince(init.getWarTimestamp()))
+ final WarRootDeploymentStrategy warRootDeploymentStrategy = new WarRootDeploymentStrategy(Thread.currentThread().getContextClassLoader(), warRoot, new File[] { warClassesDirectory, warLibDirectory, hotDeployDirectory });
+ changed = new TimestampCheckForwardingDeploymentStrategy()
{
+
+ @Override
+ protected DeploymentStrategy delegate()
+ {
+ return warRootDeploymentStrategy;
+ }
+
+ }.changedSince(init.getWarTimestamp());
+ if (changed)
+ {
warRootDeploymentStrategy.scan();
if (warRootDeploymentStrategy.getTimestamp() > init.getWarTimestamp())
{
16 years
Seam SVN: r9594 - in branches/enterprise/JBPAPP_4_3_FP01/src: test/unit/org/jboss/seam/test/unit and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-11-18 07:28:38 -0500 (Tue, 18 Nov 2008)
New Revision: 9594
Removed:
branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/FooBar.java
Modified:
branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/core/BijectionInterceptor.java
branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/InterceptorTest.java
Log:
JBPAPP-1122 reverted changes
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/core/BijectionInterceptor.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/core/BijectionInterceptor.java 2008-11-18 12:16:17 UTC (rev 9593)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/core/BijectionInterceptor.java 2008-11-18 12:28:38 UTC (rev 9594)
@@ -1,13 +1,13 @@
//$Id$
package org.jboss.seam.core;
-import java.util.concurrent.locks.ReentrantLock;
-
import org.jboss.seam.Component;
import org.jboss.seam.annotations.intercept.AroundInvoke;
import org.jboss.seam.annotations.intercept.Interceptor;
import org.jboss.seam.intercept.AbstractInterceptor;
import org.jboss.seam.intercept.InvocationContext;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
/**
* Before invoking the component, inject all dependencies. After
@@ -20,89 +20,40 @@
{
private static final long serialVersionUID = 4686458105931528659L;
- private boolean injected;
+ private static final LogProvider log = Logging.getLogProvider(BijectionInterceptor.class);
- private int counter = 0;
+ private boolean reentrant; //OK, since all Seam components are single-threaded
- private ReentrantLock lock = new ReentrantLock();
-
@AroundInvoke
public Object aroundInvoke(InvocationContext invocation) throws Exception
{
- Component component = getComponent();
- boolean enforceRequired = !component.isLifecycleMethod( invocation.getMethod() );
-
- try
+ if (reentrant)
{
- lock.lock();
- try
+ if ( log.isTraceEnabled() )
{
- if (!injected)
- {
- component.inject( invocation.getTarget(), enforceRequired );
- injected = true;
- }
- counter++;
+ log.trace("reentrant call to component: " + getComponent().getName() );
}
-
- finally
- {
- lock.unlock();
- }
-
- Object result = invocation.proceed();
-
- lock.lock();
+ return invocation.proceed();
+ }
+ else
+ {
+ reentrant = true;
try
{
- counter--;
+ Component component = getComponent();
+ boolean enforceRequired = !component.isLifecycleMethod( invocation.getMethod() );
+ component.inject( invocation.getTarget(), enforceRequired );
+ Object result = invocation.proceed();
+ component.outject( invocation.getTarget(), enforceRequired );
+ component.disinject( invocation.getTarget() );
+ return result;
- if (counter == 0)
- {
- try
- {
- component.outject( invocation.getTarget(), enforceRequired );
- }
- finally
- {
- // Avoid an extra lock by disinjecting here instead of the finally block
- if (injected)
- {
- injected = false;
- component.disinject( invocation.getTarget() );
- }
- }
- }
}
finally
{
- lock.unlock();
+ reentrant = false;
}
-
- return result;
}
- finally
- {
- if (injected)
- {
- lock.lock();
- try
- {
- component.disinject( invocation.getTarget() );
- counter--;
-
- if (counter == 0)
- {
- injected = false;
- }
- }
- finally
- {
- lock.unlock();
- }
-
- }
- }
}
}
Deleted: branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/FooBar.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/FooBar.java 2008-11-18 12:16:17 UTC (rev 9593)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/FooBar.java 2008-11-18 12:28:38 UTC (rev 9594)
@@ -1,23 +0,0 @@
- package org.jboss.seam.test.unit;
-import java.util.concurrent.CountDownLatch;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-@Name("fooBar")
-(a)Scope(ScopeType.APPLICATION)
-public class FooBar
-{
- @In Foo foo;
-
- public Foo delayedGetFoo(CountDownLatch latch)
- {
- try
- {
- latch.await();
- }
- catch (InterruptedException ex) {}
-
- return foo;
- }
-}
\ No newline at end of file
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/InterceptorTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/InterceptorTest.java 2008-11-18 12:16:17 UTC (rev 9593)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/InterceptorTest.java 2008-11-18 12:28:38 UTC (rev 9594)
@@ -2,7 +2,6 @@
package org.jboss.seam.test.unit;
import java.lang.reflect.Method;
-import java.util.concurrent.CountDownLatch;
import javax.faces.context.ExternalContext;
import javax.faces.event.PhaseId;
@@ -26,7 +25,6 @@
import org.jboss.seam.core.Manager;
import org.jboss.seam.ejb.RemoveInterceptor;
import org.jboss.seam.faces.FacesMessages;
-import org.jboss.seam.intercept.InvocationContext;
import org.jboss.seam.mock.MockApplication;
import org.jboss.seam.mock.MockExternalContext;
import org.jboss.seam.mock.MockFacesContext;
@@ -237,101 +235,6 @@
}
@Test
- public void testReentrantBijection() throws Exception
- {
- MockServletContext servletContext = new MockServletContext();
- ServletLifecycle.beginApplication(servletContext);
- MockExternalContext externalContext = new MockExternalContext(servletContext);
- Context appContext = new ApplicationContext( externalContext.getApplicationMap() );
- appContext.set( Seam.getComponentName(Init.class), new Init() );
- appContext.set( Seam.getComponentName(ConversationEntries.class) + ".component",
- new Component(ConversationEntries.class, appContext) );
- appContext.set( Seam.getComponentName(Manager.class) + ".component",
- new Component(Manager.class, appContext) );
- appContext.set( Seam.getComponentName(Foo.class) + ".component",
- new Component(Foo.class, appContext) );
- appContext.set( Seam.getComponentName(FooBar.class) + ".component",
- new Component(FooBar.class, appContext) );
- FacesLifecycle.beginRequest(externalContext);
- Manager.instance().setCurrentConversationId("1");
- FacesLifecycle.resumeConversation(externalContext);
- FacesLifecycle.setPhaseId(PhaseId.RENDER_RESPONSE);
-
- final Foo foo = new Foo();
- final FooBar fooBar = new FooBar();
- Contexts.getSessionContext().set("foo", foo);
-
- final BijectionInterceptor bi = new BijectionInterceptor();
- bi.setComponent( new Component(FooBar.class, appContext) );
-
- final Method m = FooBar.class.getMethod("delayedGetFoo", CountDownLatch.class);
-
- final CountDownLatch latchA = new CountDownLatch(1);
- final CountDownLatch latchB = new CountDownLatch(1);
- final CountDownLatch latchC = new CountDownLatch(1);
- final CountDownLatch latchD = new CountDownLatch(1);
-
- final InvocationContext invocationA = new MockInvocationContext() {
- @Override public Object getTarget() { return fooBar; }
- @Override public Method getMethod() { return m; }
- @Override public Object[] getParameters() { return new Object[] { latchA }; }
- };
- final InvocationContext invocationB = new MockInvocationContext() {
- @Override public Object getTarget() { return fooBar; }
- @Override public Method getMethod() { return m; }
- @Override public Object[] getParameters() { return new Object[] { latchB }; }
- };
-
- new Thread(new Runnable() {
- public void run() {
- try
- {
- Foo result = (Foo) bi.aroundInvoke( invocationA );
- assert result == foo;
- }
- catch (Exception ex)
- {
- throw new RuntimeException(ex);
- }
- finally
- {
- latchC.countDown();
- }
- }
- }).start();
-
- new Thread(new Runnable() {
- public void run() {
- try
- {
- Foo result = (Foo) bi.aroundInvoke( invocationB );
- assert result == foo;
- }
- catch (Exception ex)
- {
- throw new RuntimeException(ex);
- }
- finally
- {
- latchD.countDown();
- }
- }
- }).start();
-
- // Allow invocationA to complete
- latchA.countDown();
-
- // Wait for invocationA to finalise
- latchC.await();
-
- // Allow invocationB to proceed
- latchB.countDown();
-
- // Wait for invocationB
- latchD.await();
- }
-
- @Test
public void testConversationInterceptor() throws Exception
{
MockServletContext servletContext = new MockServletContext();
16 years
Seam SVN: r9593 - trunk/examples/wicket.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-11-18 07:16:17 -0500 (Tue, 18 Nov 2008)
New Revision: 9593
Modified:
trunk/examples/wicket/
Log:
svn ingores
Property changes on: trunk/examples/wicket
___________________________________________________________________
Name: svn:ignore
- exploded-archives
dist
+ exploded-archives
dist
instrumented-web
build-web
instrumentcache.properties
16 years
Seam SVN: r9592 - trunk/examples/groovybooking.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-11-18 07:09:35 -0500 (Tue, 18 Nov 2008)
New Revision: 9592
Modified:
trunk/examples/groovybooking/build.xml
Log:
Unbreak the undeployall target (grrr)
Modified: trunk/examples/groovybooking/build.xml
===================================================================
--- trunk/examples/groovybooking/build.xml 2008-11-18 11:25:56 UTC (rev 9591)
+++ trunk/examples/groovybooking/build.xml 2008-11-18 12:09:35 UTC (rev 9592)
@@ -26,15 +26,15 @@
<import file="../build.xml" />
<target name="explode">
- <fail>Please use the target jbosswar.explode to deploy this application.</fail>
+ <antcall target="jbosswar.explode" />
</target>
<target name="restart">
- <fail>Please use the target jbosswar.restart to restart this application.</fail>
+ <antcall target="jbosswar.restart" />
</target>
<target name="unexplode">
- <fail>Please use the target jbosswar.unexplode to undeploy this application.</fail>
+ <antcall target="jbosswar.unexplode" />
</target>
<property name="classes.model.dir" value="${war.dir}/WEB-INF/classes" />
16 years
Seam SVN: r9591 - trunk/src/main/org/jboss/seam/deployment.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-11-18 06:25:56 -0500 (Tue, 18 Nov 2008)
New Revision: 9591
Modified:
trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java
trunk/src/main/org/jboss/seam/deployment/URLScanner.java
Log:
JBSEAM-3699, preserve backwards compatibility
Modified: trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java 2008-11-18 11:21:34 UTC (rev 9590)
+++ trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java 2008-11-18 11:25:56 UTC (rev 9591)
@@ -1,6 +1,7 @@
package org.jboss.seam.deployment;
import java.io.DataInputStream;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
@@ -193,5 +194,13 @@
{
return new Handler(name, deploymentStrategy.getDeploymentHandlers().entrySet(), deploymentStrategy.getClassLoader()).handle();
}
+
+ /**
+ * Default impl of scanDirectories with exclusions for backwards compatibility
+ */
+ public void scanDirectories(File[] directories, File[] excludedDirectories)
+ {
+ scanDirectories(directories);
+ }
}
Modified: trunk/src/main/org/jboss/seam/deployment/URLScanner.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/URLScanner.java 2008-11-18 11:21:34 UTC (rev 9590)
+++ trunk/src/main/org/jboss/seam/deployment/URLScanner.java 2008-11-18 11:25:56 UTC (rev 9591)
@@ -40,6 +40,7 @@
scanDirectories(directories, new File[0]);
}
+ @Override
public void scanDirectories(File[] directories, File[] excludedDirectories)
{
for (File directory : directories)
16 years
Seam SVN: r9590 - trunk/src/main/org/jboss/seam/deployment.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-11-18 06:21:34 -0500 (Tue, 18 Nov 2008)
New Revision: 9590
Modified:
trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java
Log:
minor
Modified: trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java 2008-11-18 10:26:57 UTC (rev 9589)
+++ trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java 2008-11-18 11:21:34 UTC (rev 9590)
@@ -80,8 +80,10 @@
boolean handled = false;
for (Entry<String, DeploymentHandler> entry: deploymentHandlers)
{
- // can handle() and if handle() returns false, take previous value of handled
- handled = (handle(entry.getValue()) || handled);
+ if (handle(entry.getValue()))
+ {
+ handled = true;
+ }
}
return handled;
}
16 years
Seam SVN: r9589 - in trunk: src/excel/org/jboss/seam/excel/ui and 1 other directory.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2008-11-18 05:26:57 -0500 (Tue, 18 Nov 2008)
New Revision: 9589
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Excel.xml
trunk/src/excel/org/jboss/seam/excel/ui/UIWorksheet.java
Log:
Minor. Make Maps iterable
Modified: trunk/doc/Seam_Reference_Guide/en-US/Excel.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Excel.xml 2008-11-18 10:11:20 UTC (rev 9588)
+++ trunk/doc/Seam_Reference_Guide/en-US/Excel.xml 2008-11-18 10:26:57 UTC (rev 9589)
@@ -415,7 +415,10 @@
<para>
<literal>value</literal>
—An EL-expression to the backing data. The
- value is a string.
+ value is a string. The target of this expression is
+ examined for an Iterable. Note that if the target is a Map,
+ the iteration is done over the Map.Entry entrySet(), so you
+ should use a .key or .value to target in your references.
</para>
</listitem>
<listitem>
Modified: trunk/src/excel/org/jboss/seam/excel/ui/UIWorksheet.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/UIWorksheet.java 2008-11-18 10:11:20 UTC (rev 9588)
+++ trunk/src/excel/org/jboss/seam/excel/ui/UIWorksheet.java 2008-11-18 10:26:57 UTC (rev 9589)
@@ -5,6 +5,7 @@
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.faces.model.DataModel;
@@ -556,6 +557,9 @@
{
return ((Iterable) ((DataModel) value).getWrappedData()).iterator();
}
+ else if (value instanceof Map) {
+ return ((Map) value).entrySet().iterator();
+ }
else if (value instanceof Query)
{
return (((Query) value).getResultList()).iterator();
16 years
Seam SVN: r9588 - branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-11-18 05:11:20 -0500 (Tue, 18 Nov 2008)
New Revision: 9588
Modified:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Book_Info.xml
Log:
Comment out xi:include element
Modified: branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Book_Info.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Book_Info.xml 2008-11-18 10:08:19 UTC (rev 9587)
+++ branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Book_Info.xml 2008-11-18 10:11:20 UTC (rev 9588)
@@ -23,7 +23,7 @@
<year>&YEAR;</year>
<holder>&HOLDER;</holder>
</copyright>
- <xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- <xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> -->
<xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</bookinfo>
16 years
Seam SVN: r9587 - in trunk/src: main/org/jboss/seam/deployment and 1 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-11-18 05:08:19 -0500 (Tue, 18 Nov 2008)
New Revision: 9587
Added:
trunk/src/main/org/jboss/seam/deployment/HotDeploymentTimestampCheckStrategy.java
trunk/src/main/org/jboss/seam/deployment/TimestampCheckStrategy.java
trunk/src/main/org/jboss/seam/deployment/TimestampURLScanner.java
trunk/src/main/org/jboss/seam/deployment/WarRootTimestampCheckStrategy.java
Modified:
trunk/src/debug/org/jboss/seam/debug/hot/HotDeployFilter.java
trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java
trunk/src/main/org/jboss/seam/deployment/HotDeploymentStrategy.java
trunk/src/main/org/jboss/seam/deployment/Scanner.java
trunk/src/main/org/jboss/seam/deployment/URLScanner.java
trunk/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java
trunk/src/main/org/jboss/seam/init/Initialization.java
Log:
JBSEAM-3699
JBSEAM-3700
also cleaned up the init and redeploy routines
Modified: trunk/src/debug/org/jboss/seam/debug/hot/HotDeployFilter.java
===================================================================
--- trunk/src/debug/org/jboss/seam/debug/hot/HotDeployFilter.java 2008-11-18 10:06:33 UTC (rev 9586)
+++ trunk/src/debug/org/jboss/seam/debug/hot/HotDeployFilter.java 2008-11-18 10:08:19 UTC (rev 9587)
@@ -36,17 +36,20 @@
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException
{
- Init init = (Init) getServletContext().getAttribute( Seam.getComponentName(Init.class) );
- if ( init!=null)
+ if (request instanceof HttpServletRequest)
{
- try
+ Init init = (Init) getServletContext().getAttribute(Seam.getComponentName(Init.class));
+ if (init != null)
{
- new Initialization( getServletContext() ).redeploy( (HttpServletRequest) request );
+ try
+ {
+ new Initialization(getServletContext()).redeploy((HttpServletRequest) request, init);
+ }
+ catch (InterruptedException e)
+ {
+ log.warn("Unable to redeploy, please try again");
+ }
}
- catch (InterruptedException e)
- {
- log.warn("Unable to redeploy, please try again");
- }
}
chain.doFilter(request, response);
}
Modified: trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java 2008-11-18 10:06:33 UTC (rev 9586)
+++ trunk/src/main/org/jboss/seam/deployment/AbstractScanner.java 2008-11-18 10:08:19 UTC (rev 9587)
@@ -41,8 +41,12 @@
this.classLoader = classLoader;
}
- protected void handle(DeploymentHandler deploymentHandler)
+ /**
+ * Return true if the file was handled (false if it was ignored)
+ */
+ protected boolean handle(DeploymentHandler deploymentHandler)
{
+ boolean handled = false;
if (deploymentHandler instanceof ClassDeploymentHandler)
{
if (name.endsWith(".class"))
@@ -54,6 +58,7 @@
if (getClassDescriptor().getClazz() != null)
{
classDeploymentHandler.getClasses().add(getClassDescriptor());
+ handled = true;
}
}
}
@@ -63,17 +68,22 @@
if (name.endsWith(deploymentHandler.getMetadata().getFileNameSuffix()))
{
deploymentHandler.getResources().add(getFileDescriptor());
+ handled = true;
}
}
+ return handled;
}
- protected void handle()
+ protected boolean handle()
{
log.trace("found " + name);
+ boolean handled = false;
for (Entry<String, DeploymentHandler> entry: deploymentHandlers)
{
- handle(entry.getValue());
+ // can handle() and if handle() returns false, take previous value of handled
+ handled = (handle(entry.getValue()) || handled);
}
+ return handled;
}
private ClassFile getClassFile()
@@ -177,9 +187,9 @@
return Long.MAX_VALUE;
}
- protected void handleItem(String name)
+ protected boolean handleItem(String name)
{
- new Handler(name, deploymentStrategy.getDeploymentHandlers().entrySet(), deploymentStrategy.getClassLoader()).handle();
+ return new Handler(name, deploymentStrategy.getDeploymentHandlers().entrySet(), deploymentStrategy.getClassLoader()).handle();
}
}
Modified: trunk/src/main/org/jboss/seam/deployment/HotDeploymentStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/HotDeploymentStrategy.java 2008-11-18 10:06:33 UTC (rev 9586)
+++ trunk/src/main/org/jboss/seam/deployment/HotDeploymentStrategy.java 2008-11-18 10:08:19 UTC (rev 9587)
@@ -72,7 +72,6 @@
annotationDeploymentHandler = new AnnotationDeploymentHandler(new SeamDeploymentProperties(classLoader).getPropertyValues(AnnotationDeploymentHandler.ANNOTATIONS_KEY), classLoader);
getDeploymentHandlers().put(AnnotationDeploymentHandler.NAME, annotationDeploymentHandler);
}
- getDeploymentHandlers().put(DotPageDotXmlDeploymentHandler.NAME, new DotPageDotXmlDeploymentHandler());
}
}
@@ -91,6 +90,15 @@
}
}
+ /**
+ * It is both enabled and the classpath was detected. Admittedly,
+ * this seems like a redundant confirmation.
+ */
+ public boolean available()
+ {
+ return isEnabled() && isHotDeployClassLoaderEnabled();
+ }
+
public boolean isEnabled()
{
return classLoader != null;
Added: trunk/src/main/org/jboss/seam/deployment/HotDeploymentTimestampCheckStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/HotDeploymentTimestampCheckStrategy.java (rev 0)
+++ trunk/src/main/org/jboss/seam/deployment/HotDeploymentTimestampCheckStrategy.java 2008-11-18 10:08:19 UTC (rev 9587)
@@ -0,0 +1,33 @@
+package org.jboss.seam.deployment;
+
+import java.io.File;
+
+/**
+ * An accelerated version of the HotDeploymentStrategy that uses the SimpleURLScanner
+ * to determine the timestamp of the latest file.
+ *
+ * @author Dan Allen
+ */
+public class HotDeploymentTimestampCheckStrategy extends TimestampCheckStrategy
+{
+ private HotDeploymentStrategy delegateStrategy;
+
+ public HotDeploymentTimestampCheckStrategy(HotDeploymentStrategy hotDeploymentStrategy)
+ {
+ delegateStrategy = hotDeploymentStrategy;
+ getDeploymentHandlers().putAll(delegateStrategy.getDeploymentHandlers());
+ }
+
+ @Override
+ public DeploymentStrategy getDelegateStrategy()
+ {
+ return delegateStrategy;
+ }
+
+ @Override
+ public void scan()
+ {
+ getScanner().scanDirectories(delegateStrategy.getFiles().toArray(new File[0]));
+ }
+
+}
Modified: trunk/src/main/org/jboss/seam/deployment/Scanner.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/Scanner.java 2008-11-18 10:06:33 UTC (rev 9586)
+++ trunk/src/main/org/jboss/seam/deployment/Scanner.java 2008-11-18 10:08:19 UTC (rev 9587)
@@ -20,6 +20,14 @@
public void scanDirectories(File[] directories);
/**
+ * Recursively scan directories, skipping directories in the exclusion list.
+ *
+ * @param directories An array of the roots of the directory trees to scan
+ * @param excludedDirectories Directories to skip over during the recursive scan
+ */
+ public void scanDirectories(File[] directories, File[] excludedDirectories);
+
+ /**
* Scan for structures which contain any of the given resources in their root
*
* @param resources The resources to scan for
Added: trunk/src/main/org/jboss/seam/deployment/TimestampCheckStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/TimestampCheckStrategy.java (rev 0)
+++ trunk/src/main/org/jboss/seam/deployment/TimestampCheckStrategy.java 2008-11-18 10:08:19 UTC (rev 9587)
@@ -0,0 +1,48 @@
+package org.jboss.seam.deployment;
+
+/**
+ * An accelerated version of the underlying strategy that uses the SimpleURLScanner
+ * to determine the timestamp of the latest file.
+ *
+ * @author Dan Allen
+ */
+public abstract class TimestampCheckStrategy extends DeploymentStrategy
+{
+ private Scanner scanner;
+
+ @Override
+ public ClassLoader getClassLoader()
+ {
+ return getDelegateStrategy().getClassLoader();
+ }
+
+ @Override
+ protected String getDeploymentHandlersKey()
+ {
+ return getDelegateStrategy().getDeploymentHandlersKey();
+ }
+
+ public abstract DeploymentStrategy getDelegateStrategy();
+
+ public boolean changedSince(long mark)
+ {
+ scan();
+ return getTimestamp() > mark;
+ }
+
+ @Override
+ public Scanner getScanner()
+ {
+ if (scanner == null)
+ {
+ initScanner();
+ }
+ return scanner;
+ }
+
+ protected void initScanner()
+ {
+ scanner = new TimestampURLScanner(this);
+ }
+
+}
\ No newline at end of file
Added: trunk/src/main/org/jboss/seam/deployment/TimestampURLScanner.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/TimestampURLScanner.java (rev 0)
+++ trunk/src/main/org/jboss/seam/deployment/TimestampURLScanner.java 2008-11-18 10:08:19 UTC (rev 9587)
@@ -0,0 +1,40 @@
+package org.jboss.seam.deployment;
+
+/**
+ * A no-op version of the URLScanner that merely returns whether the deployment
+ * handler would in fact handle this file. It does not process the file
+ * in any way. This allows us to use this scanner for timestamp checking.
+ *
+ * @author Dan Allen
+ */
+public class TimestampURLScanner extends URLScanner
+{
+ public TimestampURLScanner(DeploymentStrategy deploymentStrategy)
+ {
+ super(deploymentStrategy);
+ }
+
+ @Override
+ protected boolean handleItem(String name)
+ {
+ for (DeploymentHandler handler : getDeploymentStrategy().getDeploymentHandlers().values())
+ {
+ if (handler instanceof ClassDeploymentHandler)
+ {
+ if (name.endsWith(".class"))
+ {
+ return true;
+ }
+ }
+ else
+ {
+ if (name.endsWith(handler.getMetadata().getFileNameSuffix()))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+}
Modified: trunk/src/main/org/jboss/seam/deployment/URLScanner.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/URLScanner.java 2008-11-18 10:06:33 UTC (rev 9586)
+++ trunk/src/main/org/jboss/seam/deployment/URLScanner.java 2008-11-18 10:08:19 UTC (rev 9587)
@@ -37,9 +37,14 @@
public void scanDirectories(File[] directories)
{
+ scanDirectories(directories, new File[0]);
+ }
+
+ public void scanDirectories(File[] directories, File[] excludedDirectories)
+ {
for (File directory : directories)
{
- handleDirectory(directory, null);
+ handleDirectory(directory, null, excludedDirectories);
}
}
@@ -131,18 +136,35 @@
private void handleDirectory(File file, String path)
{
- log.trace("directory: " + file);
+ handleDirectory(file, path, new File[0]);
+ }
+
+ private void handleDirectory(File file, String path, File[] excludedDirectories)
+ {
+ for (File excludedDirectory : excludedDirectories)
+ {
+ if (file.equals(excludedDirectory))
+ {
+ log.trace("skipping excluded directory: " + file);
+ return;
+ }
+ }
+
+ log.trace("handling directory: " + file);
for ( File child: file.listFiles() )
{
String newPath = path==null ? child.getName() : path + '/' + child.getName();
if ( child.isDirectory() )
{
- handleDirectory(child, newPath);
+ handleDirectory(child, newPath, excludedDirectories);
}
else
{
- touchTimestamp(child);
- handleItem(newPath);
+ if (handleItem(newPath))
+ {
+ // only try to update the timestamp on this scanner if the file was actually handled
+ touchTimestamp(child);
+ }
}
}
}
Modified: trunk/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java 2008-11-18 10:06:33 UTC (rev 9586)
+++ trunk/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java 2008-11-18 10:08:19 UTC (rev 9587)
@@ -22,6 +22,8 @@
private File[] warRoot;
+ private File[] excludedDirectories;
+
public static final String HANDLERS_KEY = "org.jboss.seam.deployment.deploymentHandlers";
public static final String NAME = "warRootDeploymentStrategy";
@@ -30,11 +32,18 @@
public WarRootDeploymentStrategy(ClassLoader classLoader, File warRoot)
{
+ this(classLoader, warRoot, new File[0]);
+ }
+
+ public WarRootDeploymentStrategy(ClassLoader classLoader, File warRoot, File[] excludedDirectories)
+ {
this.classLoader = classLoader;
this.warRoot = new File[1];
+ this.excludedDirectories = excludedDirectories;
if (warRoot != null)
{
this.warRoot[0] = warRoot;
+ getFiles().add(warRoot);
}
else
{
@@ -60,10 +69,15 @@
@Override
public void scan()
{
- getScanner().scanDirectories(warRoot);
+ getScanner().scanDirectories(warRoot, excludedDirectories);
postScan();
}
+ public File[] getExcludedDirectories()
+ {
+ return excludedDirectories;
+ }
+
public Set<FileDescriptor> getDotPageDotXmlFileNames()
{
return dotPageDotXmlDeploymentHandler.getResources();
Added: trunk/src/main/org/jboss/seam/deployment/WarRootTimestampCheckStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/WarRootTimestampCheckStrategy.java (rev 0)
+++ trunk/src/main/org/jboss/seam/deployment/WarRootTimestampCheckStrategy.java 2008-11-18 10:08:19 UTC (rev 9587)
@@ -0,0 +1,34 @@
+package org.jboss.seam.deployment;
+
+import java.io.File;
+
+
+/**
+ * An accelerated version of the WarRootDeploymentStrategy that uses the SimpleURLScanner
+ * to determine the timestamp of the latest file.
+ *
+ * @author Dan Allen
+ */
+public class WarRootTimestampCheckStrategy extends TimestampCheckStrategy
+{
+ private WarRootDeploymentStrategy delegateStrategy;
+
+ public WarRootTimestampCheckStrategy(WarRootDeploymentStrategy warRootDeploymentStrategy)
+ {
+ delegateStrategy = warRootDeploymentStrategy;
+ getDeploymentHandlers().putAll(delegateStrategy.getDeploymentHandlers());
+ }
+
+ @Override
+ public DeploymentStrategy getDelegateStrategy()
+ {
+ return delegateStrategy;
+ }
+
+ @Override
+ public void scan()
+ {
+ getScanner().scanDirectories(delegateStrategy.getFiles().toArray(new File[0]), delegateStrategy.getExcludedDirectories());
+ }
+
+}
Modified: trunk/src/main/org/jboss/seam/init/Initialization.java
===================================================================
--- trunk/src/main/org/jboss/seam/init/Initialization.java 2008-11-18 10:06:33 UTC (rev 9586)
+++ trunk/src/main/org/jboss/seam/init/Initialization.java 2008-11-18 10:08:19 UTC (rev 9587)
@@ -51,9 +51,11 @@
import org.jboss.seam.deployment.ClassDescriptor;
import org.jboss.seam.deployment.FileDescriptor;
import org.jboss.seam.deployment.HotDeploymentStrategy;
+import org.jboss.seam.deployment.HotDeploymentTimestampCheckStrategy;
import org.jboss.seam.deployment.SeamDeploymentProperties;
import org.jboss.seam.deployment.StandardDeploymentStrategy;
import org.jboss.seam.deployment.WarRootDeploymentStrategy;
+import org.jboss.seam.deployment.WarRootTimestampCheckStrategy;
import org.jboss.seam.exception.Exceptions;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
@@ -95,6 +97,8 @@
private HotDeploymentStrategy hotDeploymentStrategy;
private WarRootDeploymentStrategy warRootDeploymentStrategy;
+ private File warClassesDirectory;
+ private File warLibDirectory;
private File hotDeployDirectory;
private File warRoot;
@@ -116,6 +120,8 @@
{
this.servletContext = servletContext;
this.warRoot = getRealFile(servletContext, "/");
+ this.warClassesDirectory = getRealFile(servletContext, "/WEB-INF/classes");
+ this.warLibDirectory = getRealFile(servletContext, "/WEB-INF/lib");
this.hotDeployDirectory = getRealFile(servletContext, HotDeploymentStrategy.DEFAULT_HOT_DEPLOYMENT_DIRECTORY_PATH);
}
@@ -686,38 +692,36 @@
}
ServletLifecycle.beginInitialization();
Contexts.getApplicationContext().set(Component.PROPERTIES, properties);
- hotDeploymentStrategy = createHotDeployment(Thread.currentThread().getContextClassLoader());
- scanForComponents();
addComponent( new ComponentDescriptor(Init.class), Contexts.getApplicationContext());
Init init = (Init) Component.getInstance(Init.class, ScopeType.APPLICATION);
- init.setHotDeployPaths( hotDeploymentStrategy.getHotDeploymentPaths() );
+ // Make the deployment strategies available in the contexts. This gives
+ // access to custom deployment handlers for processing custom annotations
+ Contexts.getEventContext().set(StandardDeploymentStrategy.NAME, standardDeploymentStrategy);
+ scanForComponents();
ComponentDescriptor desc = findDescriptor(Jbpm.class);
if (desc != null && desc.isInstalled())
{
init.setJbpmInstalled(true);
}
init.checkDefaultInterceptors();
- init.setTimestamp( System.currentTimeMillis() );
+ init.setTimestamp(System.currentTimeMillis());
addSpecialComponents(init);
// Add the war root deployment
- warRootDeploymentStrategy = new WarRootDeploymentStrategy(Thread.currentThread().getContextClassLoader(), warRoot);
+ warRootDeploymentStrategy = new WarRootDeploymentStrategy(
+ Thread.currentThread().getContextClassLoader(), warRoot, new File[] { warClassesDirectory, warLibDirectory, hotDeployDirectory });
+ Contexts.getEventContext().set(WarRootDeploymentStrategy.NAME, warRootDeploymentStrategy);
warRootDeploymentStrategy.scan();
+ init.setWarTimestamp(System.currentTimeMillis());
- // Make the deployment strategies available in the contexts. This gives
- // access to custom deployment handlers for processing custom annotations
- // etc.
- Contexts.getEventContext().set(StandardDeploymentStrategy.NAME, standardDeploymentStrategy);
+ hotDeploymentStrategy = createHotDeployment(Thread.currentThread().getContextClassLoader(), isHotDeployEnabled(init));
Contexts.getEventContext().set(HotDeploymentStrategy.NAME, hotDeploymentStrategy);
- Contexts.getEventContext().set(WarRootDeploymentStrategy.NAME, warRootDeploymentStrategy);
+ init.setHotDeployPaths( hotDeploymentStrategy.getHotDeploymentPaths() );
- if (hotDeploymentStrategy.isEnabled())
+ if (hotDeploymentStrategy.available())
{
hotDeploymentStrategy.scan();
- if (hotDeploymentStrategy.isHotDeployClassLoaderEnabled())
- {
- installHotDeployableComponents();
- }
+ installHotDeployableComponents();
}
installComponents(init);
@@ -734,21 +738,33 @@
public void redeploy(HttpServletRequest request) throws InterruptedException
{
+ redeploy(request, (Init) ServletLifecycle.getServletContext().getAttribute( Seam.getComponentName(Init.class) ));
+ }
+
+ public void redeploy(HttpServletRequest request, Init init) throws InterruptedException
+ {
+ // It's possible to have the HotDeployFilter installed but disabled
+ if (!isHotDeployEnabled(init))
+ {
+ return;
+ }
+
ReentrantLock lock = new ReentrantLock();
if (lock.tryLock(500, TimeUnit.MILLISECONDS))
{
try
{
- hotDeploymentStrategy = createHotDeployment(Thread.currentThread().getContextClassLoader());
- if (hotDeploymentStrategy.isEnabled())
+ hotDeploymentStrategy = createHotDeployment(Thread.currentThread().getContextClassLoader(), isHotDeployEnabled(init));
+
+ if (hotDeploymentStrategy.available() && new HotDeploymentTimestampCheckStrategy(hotDeploymentStrategy).changedSince(init.getTimestamp()))
{
+ ServletLifecycle.beginReinitialization(request);
+ Contexts.getEventContext().set(HotDeploymentStrategy.NAME, hotDeploymentStrategy);
hotDeploymentStrategy.scan();
- Init init = (Init) ServletLifecycle.getServletContext().getAttribute( Seam.getComponentName(Init.class) );
- if (init.getTimestamp() < hotDeploymentStrategy.getTimestamp())
+ if (hotDeploymentStrategy.getTimestamp() > init.getTimestamp())
{
- log.info("redeploying");
- ServletLifecycle.beginReinitialization(request);
+ log.info("redeploying components");
Seam.clearComponentNameCache();
for ( String name: init.getHotDeployableComponents() )
{
@@ -765,30 +781,33 @@
Contexts.getApplicationContext().remove(name + COMPONENT_SUFFIX);
}
- if (hotDeploymentStrategy.isHotDeployClassLoaderEnabled())
- {
- installHotDeployableComponents();
- }
- Contexts.getEventContext().set(HotDeploymentStrategy.NAME, hotDeploymentStrategy);
- init.setTimestamp( System.currentTimeMillis() );
+ init.getHotDeployableComponents().clear();
+ installHotDeployableComponents();
installComponents(init);
- ServletLifecycle.endReinitialization();
- log.info("done redeploying");
+ log.info("done redeploying components");
}
+ // update the timestamp outside of the second timestamp check to be sure we don't cause an unnecessary scan
+ // the second scan checks annotations (the slow part) which might happen to exclude the most recent file
+ init.setTimestamp(System.currentTimeMillis());
+ ServletLifecycle.endReinitialization();
+ }
- WarRootDeploymentStrategy warRootDeploymentStrategy = new WarRootDeploymentStrategy(Thread.currentThread().getContextClassLoader(), warRoot);
+ WarRootDeploymentStrategy warRootDeploymentStrategy = new WarRootDeploymentStrategy(
+ Thread.currentThread().getContextClassLoader(), warRoot, new File[] { warClassesDirectory, warLibDirectory, hotDeployDirectory });
+ if (new WarRootTimestampCheckStrategy(warRootDeploymentStrategy).changedSince(init.getWarTimestamp()))
+ {
warRootDeploymentStrategy.scan();
- if (init.getWarTimestamp() < warRootDeploymentStrategy.getTimestamp())
+ if (warRootDeploymentStrategy.getTimestamp() > init.getWarTimestamp())
{
+ log.info("redeploying page descriptors...");
Pages pages = (Pages) ServletLifecycle.getServletContext().getAttribute(Seam.getComponentName(Pages.class));
- if (pages!= null) {
+ if (pages != null) {
pages.initialize(warRootDeploymentStrategy.getDotPageDotXmlFileNames());
}
- ServletLifecycle.getServletContext().removeAttribute( Seam.getComponentName(Exceptions.class) );
+ ServletLifecycle.getServletContext().removeAttribute(Seam.getComponentName(Exceptions.class));
init.setWarTimestamp(warRootDeploymentStrategy.getTimestamp());
+ log.info("done redeploying page descriptors");
}
-
-
}
}
finally
@@ -807,26 +826,27 @@
}
}
- private HotDeploymentStrategy createHotDeployment(ClassLoader classLoader)
+ private HotDeploymentStrategy createHotDeployment(ClassLoader classLoader, boolean hotDeployEnabled)
{
if (isGroovyPresent())
{
log.debug("Using Java + Groovy hot deploy");
- return HotDeploymentStrategy.createInstance("org.jboss.seam.deployment.GroovyHotDeploymentStrategy", classLoader, hotDeployDirectory, isDebugEnabled());
+ return HotDeploymentStrategy.createInstance("org.jboss.seam.deployment.GroovyHotDeploymentStrategy", classLoader, hotDeployDirectory, hotDeployEnabled);
}
else
{
log.debug("Using Java hot deploy");
- return new HotDeploymentStrategy(classLoader, hotDeployDirectory, isDebugEnabled());
+ return new HotDeploymentStrategy(classLoader, hotDeployDirectory, hotDeployEnabled);
}
}
- private static boolean isDebugEnabled()
+ private boolean isHotDeployEnabled(Init init)
{
return Resources.getResource("META-INF/debug.xhtml", null) != null;
+ //return init.isDebug();
}
- private static boolean isGroovyPresent()
+ private boolean isGroovyPresent()
{
try
{
@@ -1033,7 +1053,8 @@
}
private void addSpecialComponents(Init init)
- {}
+ {
+ }
private void installComponents(Init init)
{
@@ -1126,7 +1147,7 @@
descriptor.getJndiName()
);
context.set(componentName, component);
- if ( hotDeploymentStrategy.isEnabled() && hotDeploymentStrategy.isFromHotDeployClassLoader( descriptor.getComponentClass() ) )
+ if ( hotDeploymentStrategy != null && hotDeploymentStrategy.isEnabled() && hotDeploymentStrategy.isFromHotDeployClassLoader( descriptor.getComponentClass() ) )
{
Init.instance().addHotDeployableComponent( component.getName() );
}
16 years