[jboss-cvs] JBossAS SVN: r59854 - in trunk/system/src/main/org/jboss: profileservice/spi and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jan 19 13:41:02 EST 2007


Author: scott.stark at jboss.org
Date: 2007-01-19 13:41:02 -0500 (Fri, 19 Jan 2007)
New Revision: 59854

Modified:
   trunk/system/src/main/org/jboss/deployers/spi/management/ManagementView.java
   trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java
   trunk/system/src/main/org/jboss/profileservice/spi/Profile.java
   trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java
   trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
Log:
Add remove and matching name query functions to the ManagementView

Modified: trunk/system/src/main/org/jboss/deployers/spi/management/ManagementView.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/ManagementView.java	2007-01-19 18:39:08 UTC (rev 59853)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/ManagementView.java	2007-01-19 18:41:02 UTC (rev 59854)
@@ -61,6 +61,16 @@
       throws NoSuchProfileException;
 
    /**
+    * Search for a deployment matching the regex expression.
+    * @param regex - the regex to query deployment name 
+    * @return the deployment name.
+    * @throws NoSuchProfileException if key is not valie
+    * @throws NoSuchDeploymentException if no matches are found 
+    */
+   public Set<String> getMatchingDeploymentName(ProfileKey key, String regex)
+      throws NoSuchProfileException, NoSuchDeploymentException;
+
+   /**
     * Obtain the top-level management view for a deployment. This is
     * done by identifying all DeploymentBeans annotated with
     * @link{org.jboss.annotation.management.ManagedObject}
@@ -91,7 +101,7 @@
     * 
     * @param name - the deployment name to identify the template to retrieve
     * @return the named DeploymentTemplate
-    * @throws NoSuchDeploymentException - if there is no such deployment
+    * @throws NoSuchDeploymentException - if there is no such template
     */
    public DeploymentTemplateInfo getTemplate(String name) throws NoSuchDeploymentException;
 
@@ -106,4 +116,14 @@
    public void applyTemplate(ProfileKey key, DeploymentPhase phase,
          String deploymentBaseName, DeploymentTemplateInfo info)
          throws Exception;
+
+   /**
+    * Remove a deployment
+    * 
+    * @param name
+    * @throws NoSuchProfileException
+    * @throws NoSuchDeploymentException
+    */
+   public void removeDeployment(ProfileKey key, String deploymentName, DeploymentPhase phase)
+      throws NoSuchProfileException, NoSuchDeploymentException, Exception;
 }

Modified: trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java	2007-01-19 18:39:08 UTC (rev 59853)
+++ trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java	2007-01-19 18:41:02 UTC (rev 59854)
@@ -86,7 +86,7 @@
     * @param phase - the phase of the deployment as it relates to when the
     * deployment is loaded
     */
-   public void removeDeployment(String vfsPath, DeploymentPhase phase)
+   public DeploymentContext removeDeployment(String vfsPath, DeploymentPhase phase)
       throws Exception;
 
    /**

Modified: trunk/system/src/main/org/jboss/profileservice/spi/Profile.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/spi/Profile.java	2007-01-19 18:39:08 UTC (rev 59853)
+++ trunk/system/src/main/org/jboss/profileservice/spi/Profile.java	2007-01-19 18:41:02 UTC (rev 59854)
@@ -109,23 +109,24 @@
 
    /**
     * Remove a deployment
-        * 
-        * @param name the name
+    * 
+    * @param name the deployment name
     * @param phase - the phase of the deployment as it relates to when the
     * deployment is loaded
-        */
-   public void removeDeployment(String name, DeploymentPhase phase)
+    * @return the DeploymentContext for the name if found
+    */
+   public DeploymentContext removeDeployment(String name, DeploymentPhase phase)
       throws Exception;
 
    /**
     * Get a named deployment.
-        * 
+    * 
     * @param name - the deployment name
     * @param phase - the phase of the deployment as it relates to when the
     * deployment is loaded
-        * @return the named bootstrap
-        * @throws NoSuchDeploymentException - if there is no such bootstrap
-        */
+    * @return the named bootstrap
+    * @throws NoSuchDeploymentException - if there is no such bootstrap
+    */
    public DeploymentContext getDeployment(String name, DeploymentPhase phase)
       throws Exception, NoSuchDeploymentException;
 

Modified: trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java	2007-01-19 18:39:08 UTC (rev 59853)
+++ trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java	2007-01-19 18:41:02 UTC (rev 59854)
@@ -214,21 +214,23 @@
       return ctxs;
    }
 
-   public void removeDeployment(String name, DeploymentPhase phase)
+   public DeploymentContext removeDeployment(String name, DeploymentPhase phase)
       throws Exception
    {
+      DeploymentContext ctx = null;
       switch( phase )
       {
          case BOOTSTRAP:
-            this.removeBootstrap(name);
+            ctx = this.removeBootstrap(name);
             break;
          case DEPLOYER:
-            this.removeDeployer(name);
+            ctx = this.removeDeployer(name);
             break;
          case APPLICATION:
-            this.removeApplication(name);
+            ctx = this.removeApplication(name);
             break;
       }
+      return ctx;
    }
 
    public Map<String, Object> getConfig()
@@ -242,9 +244,9 @@
       bootstraps.put(d.getName(), d);
    }
 
-   protected void removeBootstrap(String name)
+   protected DeploymentContext removeBootstrap(String name)
    {
-      bootstraps.remove(name);
+      return bootstraps.remove(name);
    }
 
    protected DeploymentContext getBootstrap(String name) throws NoSuchDeploymentException
@@ -263,9 +265,9 @@
       deployers.put(d.getName(), d);
    }
 
-   protected void removeDeployer(String name)
+   protected DeploymentContext removeDeployer(String name)
    {
-      deployers.remove(name);
+      return deployers.remove(name);
    }
 
    protected DeploymentContext getDeployer(String name) throws NoSuchDeploymentException
@@ -284,9 +286,9 @@
       applications.put(d.getName(), d);
    }
 
-   protected void removeApplication(String name)
+   protected DeploymentContext removeApplication(String name)
    {
-      applications.remove(name);
+      return applications.remove(name);
    }
 
    protected DeploymentContext getApplication(String name)

Modified: trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java	2007-01-19 18:39:08 UTC (rev 59853)
+++ trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java	2007-01-19 18:41:02 UTC (rev 59854)
@@ -123,10 +123,10 @@
    {
       return repository.getDeployment(name, phase);
    }
-   public void removeDeployment(String name, DeploymentPhase phase)
+   public DeploymentContext removeDeployment(String name, DeploymentPhase phase)
       throws Exception
    {
-      repository.removeDeployment(name, phase);
+      return repository.removeDeployment(name, phase);
    }
 
    public Map<String, Object> getConfig()

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java	2007-01-19 18:39:08 UTC (rev 59853)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java	2007-01-19 18:41:02 UTC (rev 59854)
@@ -274,21 +274,23 @@
       }
       return ctxs;
    }
-   public void removeDeployment(String name, DeploymentPhase phase)
+   public DeploymentContext removeDeployment(String name, DeploymentPhase phase)
       throws Exception
    {
+      DeploymentContext ctx = null;
       switch( phase )
       {
          case BOOTSTRAP:
-            this.removeBootstrap(name);
+            ctx = this.removeBootstrap(name);
             break;
          case DEPLOYER:
-            this.removeDeployer(name);
+            ctx = this.removeDeployer(name);
             break;
          case APPLICATION:
-            this.removeApplication(name);
+            ctx = this.removeApplication(name);
             break;
       }
+      return ctx;
    }
    public String toString()
    {
@@ -519,23 +521,26 @@
       return ctxs;
    }
 
-   protected void removeBootstrap(String vfsPath) throws IOException
+   protected DeploymentContext removeBootstrap(String vfsPath) throws IOException
    {
       File bootstrapFile = new File(bootstrapDir, vfsPath);
       if( bootstrapFile.delete() == false )
          throw new IOException("Failed to delete: "+bootstrapFile);
+      return bootstrapCtxs.remove(vfsPath);
    }
-   protected void removeDeployer(String vfsPath) throws IOException
+   protected DeploymentContext removeDeployer(String vfsPath) throws IOException
    {
       File deployerFile = new File(deployersDir, vfsPath);
       if( Files.delete(deployerFile) == false )
          throw new IOException("Failed to delete: "+deployerFile);
+      return this.removeDeployer(vfsPath);
    }
-   protected void removeApplication(String vfsPath) throws IOException
+   protected DeploymentContext removeApplication(String vfsPath) throws IOException
    {
       File deploymentFile = new File(applicationDir, vfsPath);
       if( Files.delete(deploymentFile) == false )
          throw new IOException("Failed to delete: "+deploymentFile);
+      return this.removeApplication(vfsPath);
    }
    protected void setBootstrapURI(URI uri)
    {




More information about the jboss-cvs-commits mailing list