[jboss-cvs] JBossAS SVN: r68546 - in trunk: system/src/main/org/jboss/system/server/profileservice and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Dec 24 16:04:14 EST 2007


Author: alesj
Date: 2007-12-24 16:04:14 -0500 (Mon, 24 Dec 2007)
New Revision: 68546

Added:
   trunk/system/src/main/org/jboss/system/server/profileservice/DeploymentPhaseVFSScanner.java
Modified:
   trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScanner.java
   trunk/system/src/main/org/jboss/system/server/profileservice/VFSBootstrapScannerImpl.java
   trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeployerScannerImpl.java
   trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java
Log:
DeploymentPhaseVFSScanner introduction.

Modified: trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScanner.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScanner.java	2007-12-24 20:53:22 UTC (rev 68545)
+++ trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScanner.java	2007-12-24 21:04:14 UTC (rev 68546)
@@ -22,10 +22,8 @@
 package org.jboss.ha.singleton;
 
 import java.net.URI;
-import java.util.List;
 import java.util.StringTokenizer;
 
-import org.jboss.system.ServiceMBean;
 import org.jboss.system.server.profileservice.VFSDeploymentScannerImpl;
 
 /**
@@ -35,9 +33,7 @@
  * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
  * @version $Revision: 1.1 $
  */
-public class HASingletonDeploymentScanner 
-   extends VFSDeploymentScannerImpl
-   implements HASingletonDeploymentScannerMBean
+public class HASingletonDeploymentScanner extends VFSDeploymentScannerImpl implements HASingletonDeploymentScannerMBean
 {
    public void deploySingletons(String uris) throws Exception
    {
@@ -46,9 +42,8 @@
       {
          String uri = tokenizer.nextToken();
          uri = uri.trim();
-         addURI(new URI(uris));
+         addURI(new URI(uri));
       }
-      
       scan();
    }
    
@@ -59,9 +54,8 @@
       {
          String uri = tokenizer.nextToken();
          uri = uri.trim();
-         removeURI(new URI(uris));
-      }
-      
+         removeURI(new URI(uri));
+      }      
       scan();
    }
 }

Added: trunk/system/src/main/org/jboss/system/server/profileservice/DeploymentPhaseVFSScanner.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/DeploymentPhaseVFSScanner.java	                        (rev 0)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/DeploymentPhaseVFSScanner.java	2007-12-24 21:04:14 UTC (rev 68546)
@@ -0,0 +1,57 @@
+/*
+* 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.system.server.profileservice;
+
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.managed.api.ManagedDeployment;
+
+/**
+ * DeploymentPhaseScanner.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class DeploymentPhaseVFSScanner extends VFSScanner
+{
+   private ManagedDeployment.DeploymentPhase phase;
+
+   protected DeploymentPhaseVFSScanner(ManagedDeployment.DeploymentPhase phase)
+   {
+      if (phase == null)
+         throw new IllegalArgumentException("Null deployment phase");
+      this.phase = phase;
+   }
+
+   protected VFSDeployment add(Profile profile, VirtualFile file) throws Exception
+   {
+      VFSDeployment deployment = createDeployment(file);
+      if(profile.hasDeployment(deployment.getName(), phase) == false)
+         profile.addDeployment(deployment, phase);
+      return deployment;
+   }
+
+   protected void remove(Profile profile, String name) throws Exception
+   {
+      profile.removeDeployment(name, phase);
+   }
+}

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/VFSBootstrapScannerImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/VFSBootstrapScannerImpl.java	2007-12-24 20:53:22 UTC (rev 68545)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/VFSBootstrapScannerImpl.java	2007-12-24 21:04:14 UTC (rev 68546)
@@ -21,10 +21,7 @@
  */
 package org.jboss.system.server.profileservice;
 
-import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
-import org.jboss.profileservice.spi.Profile;
-import org.jboss.virtual.VirtualFile;
 
 /**
  * VFSBootstrapScannerImpl.
@@ -32,18 +29,10 @@
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision: 1.1 $
  */
-public class VFSBootstrapScannerImpl extends VFSScanner
+public class VFSBootstrapScannerImpl extends DeploymentPhaseVFSScanner
 {
-   protected VFSDeployment add(Profile profile, VirtualFile file) throws Exception
+   public VFSBootstrapScannerImpl()
    {
-      VFSDeployment deployment = createDeployment(file);;
-      if( !profile.hasDeployment(deployment.getName(), DeploymentPhase.BOOTSTRAP) )
-            profile.addDeployment(deployment, DeploymentPhase.BOOTSTRAP);
-      return deployment;
+      super(DeploymentPhase.BOOTSTRAP);
    }
-
-   protected void remove(Profile profile, String name) throws Exception
-   {
-      profile.removeDeployment(name, DeploymentPhase.BOOTSTRAP);
-   }
 }

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeployerScannerImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeployerScannerImpl.java	2007-12-24 20:53:22 UTC (rev 68545)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeployerScannerImpl.java	2007-12-24 21:04:14 UTC (rev 68546)
@@ -21,10 +21,7 @@
  */
 package org.jboss.system.server.profileservice;
 
-import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
-import org.jboss.profileservice.spi.Profile;
-import org.jboss.virtual.VirtualFile;
 
 /**
  * VFSDeployerScannerImpl.
@@ -32,18 +29,10 @@
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision: 1.1 $
  */
-public class VFSDeployerScannerImpl extends VFSScanner
+public class VFSDeployerScannerImpl extends DeploymentPhaseVFSScanner
 {
-   protected VFSDeployment add(Profile profile, VirtualFile file) throws Exception
+   public VFSDeployerScannerImpl()
    {
-      VFSDeployment deployment = createDeployment(file);;
-      if( !profile.hasDeployment(deployment.getName(), DeploymentPhase.DEPLOYER) )
-         profile.addDeployment(deployment, DeploymentPhase.DEPLOYER);
-      return deployment;
+      super(DeploymentPhase.DEPLOYER);
    }
-   
-   protected void remove(Profile profile, String name) throws Exception
-   {
-      profile.removeDeployment(name, DeploymentPhase.DEPLOYER);
-   }
 }

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java	2007-12-24 20:53:22 UTC (rev 68545)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java	2007-12-24 21:04:14 UTC (rev 68546)
@@ -21,10 +21,7 @@
  */
 package org.jboss.system.server.profileservice;
 
-import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
-import org.jboss.profileservice.spi.Profile;
-import org.jboss.virtual.VirtualFile;
 
 /**
  * VFSDeploymentScannerImpl.
@@ -32,19 +29,11 @@
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision: 1.1 $
  */
-public class VFSDeploymentScannerImpl extends VFSScanner
+public class VFSDeploymentScannerImpl extends DeploymentPhaseVFSScanner
 {
-   protected VFSDeployment add(Profile profile, VirtualFile file) throws Exception
+   public VFSDeploymentScannerImpl()
    {
-      VFSDeployment deployment = createDeployment(file);
-      if( !profile.hasDeployment(deployment.getName(), DeploymentPhase.APPLICATION) )
-         profile.addDeployment(deployment, DeploymentPhase.APPLICATION);
-      return deployment;
+      super(DeploymentPhase.APPLICATION);
    }
-   
-   protected void remove(Profile profile, String name) throws Exception
-   {
-      profile.removeDeployment(name, DeploymentPhase.APPLICATION);
-   }
 }
 




More information about the jboss-cvs-commits mailing list