[jboss-cvs] JBossAS SVN: r82363 - in projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas: vfs and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Dec 18 07:30:09 EST 2008
Author: alesj
Date: 2008-12-18 07:30:09 -0500 (Thu, 18 Dec 2008)
New Revision: 82363
Modified:
projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vdf/BaseAttachmentVDFConnector.java
projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vdf/NamedAttachmentVDFConnector.java
projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/SeamResourceDiscovery.java
Log:
Allow hierarchy lookup.
Fix SeamRD.
Modified: projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vdf/BaseAttachmentVDFConnector.java
===================================================================
--- projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vdf/BaseAttachmentVDFConnector.java 2008-12-18 11:34:22 UTC (rev 82362)
+++ projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vdf/BaseAttachmentVDFConnector.java 2008-12-18 12:30:09 UTC (rev 82363)
@@ -34,6 +34,8 @@
*/
public abstract class BaseAttachmentVDFConnector<U> extends AttachmentVDFConnector<U>
{
+ private boolean allowHierarchyLookup;
+
protected BaseAttachmentVDFConnector(ServletContext servletContext)
{
super(servletContext);
@@ -48,6 +50,37 @@
protected U getUtilityFromAttribute(DeploymentUnit unit)
{
+ U utility = lookup(unit);
+ if (utility == null && allowHierarchyLookup)
+ {
+ DeploymentUnit parent = unit.getParent();
+ while(parent != null && utility == null)
+ {
+ utility = lookup(parent);
+ parent = parent.getParent();
+ }
+ }
+ return utility;
+ }
+
+ /**
+ * Do attachment lookup.
+ *
+ * @param unit the deployment unit
+ * @return the lookup result
+ */
+ protected U lookup(DeploymentUnit unit)
+ {
return unit.getAttachment(getAttachmentType());
}
+
+ /**
+ * Do we allow to do hierarchy attachment lookup on deployment unit.
+ *
+ * @param allowHierarchyLookup the allow hierarchy lookup flag
+ */
+ public void setAllowHierarchyLookup(boolean allowHierarchyLookup)
+ {
+ this.allowHierarchyLookup = allowHierarchyLookup;
+ }
}
\ No newline at end of file
Modified: projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vdf/NamedAttachmentVDFConnector.java
===================================================================
--- projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vdf/NamedAttachmentVDFConnector.java 2008-12-18 11:34:22 UTC (rev 82362)
+++ projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vdf/NamedAttachmentVDFConnector.java 2008-12-18 12:30:09 UTC (rev 82363)
@@ -45,7 +45,7 @@
*/
protected abstract String getAttchmentName();
- protected U getUtilityFromAttribute(DeploymentUnit unit)
+ protected U lookup(DeploymentUnit unit)
{
return unit.getAttachment(getAttchmentName(), getAttachmentType());
}
Modified: projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/SeamResourceDiscovery.java
===================================================================
--- projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/SeamResourceDiscovery.java 2008-12-18 11:34:22 UTC (rev 82362)
+++ projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/SeamResourceDiscovery.java 2008-12-18 12:30:09 UTC (rev 82363)
@@ -73,9 +73,14 @@
{
}
-
- public long getTimestamp()
+
+ public void scanDirectories(File[] directories, File[] excludedDirectories)
{
+ // TODO
+ }
+
+ public long getTimestamp()
+ {
// TODO Return the time when the last resource that Seam is interested in was modified (any resource visited by the above methods)
return Long.MAX_VALUE;
}
More information about the jboss-cvs-commits
mailing list