[jboss-cvs] JBossAS SVN: r76097 - projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jul 22 07:31:17 EDT 2008


Author: alesj
Date: 2008-07-22 07:31:17 -0400 (Tue, 22 Jul 2008)
New Revision: 76097

Added:
   projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/FilesUrlIntegrationDeployer.java
   projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/MetaDataUrlIntegrationDeployer.java
   projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/PathUrlIntegrationDeployer.java
Log:
Add integration deployers, non-abstract part - TODO on tests.


Added: projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/FilesUrlIntegrationDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/FilesUrlIntegrationDeployer.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/FilesUrlIntegrationDeployer.java	2008-07-22 11:31:17 UTC (rev 76097)
@@ -0,0 +1,58 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.deployers.vfs.plugins.classloader;
+
+/**
+ * Checks files if matching integration deployment.
+ *
+ * @param <T> exact output type
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class FilesUrlIntegrationDeployer<T> extends UrlIntegrationDeployer<T>
+{
+   private String[] files;
+
+   protected FilesUrlIntegrationDeployer(Class<T> input)
+   {
+      super(input);
+   }
+
+   /**
+    * Get the matching files.
+    *
+    * @return the files
+    */
+   public String[] getFiles()
+   {
+      return files;
+   }
+
+   /**
+    * Set the matching files.
+    *
+    * @param files the files
+    */
+   public void setFiles(String[] files)
+   {
+      this.files = files;
+   }
+}
\ No newline at end of file

Copied: projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/MetaDataUrlIntegrationDeployer.java (from rev 76093, projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/UrlIntegrationDeployer.java)
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/MetaDataUrlIntegrationDeployer.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/MetaDataUrlIntegrationDeployer.java	2008-07-22 11:31:17 UTC (rev 76097)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.deployers.vfs.plugins.classloader;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Checks metadata if matching integration deployment.
+ *
+ * @param <T> exact output type
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class MetaDataUrlIntegrationDeployer<T> extends FilesUrlIntegrationDeployer<T>
+{
+   public MetaDataUrlIntegrationDeployer(Class<T> input)
+   {
+      super(input);
+   }
+
+   protected boolean isIntegrationDeployment(VFSDeploymentUnit unit)
+   {
+      String[] files = getFiles();
+      if (files == null || files.length == 0)
+         return false;
+
+      for(String file : files)
+      {
+         VirtualFile vf = unit.getMetaDataFile(file);
+         if (vf != null)
+            return true;
+      }
+
+      return false;
+   }
+}
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/PathUrlIntegrationDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/PathUrlIntegrationDeployer.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/PathUrlIntegrationDeployer.java	2008-07-22 11:31:17 UTC (rev 76097)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.deployers.vfs.plugins.classloader;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Checks path if matching integration deployment.
+ *
+ * @param <T> exact output type
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class PathUrlIntegrationDeployer<T> extends FilesUrlIntegrationDeployer<T>
+{
+   public PathUrlIntegrationDeployer(Class<T> input)
+   {
+      super(input);
+   }
+
+   protected boolean isIntegrationDeployment(VFSDeploymentUnit unit)
+   {
+      String[] files = getFiles();
+      if (files == null || files.length == 0)
+         return false;
+
+      for(String path : files)
+      {
+         VirtualFile vf = unit.getFile(path);
+         if (vf != null)
+            return true;
+      }
+
+      return false;
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list