[jboss-cvs] JBossAS SVN: r62499 - in trunk/system/src/main/org/jboss: system/server/profile/basic and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Apr 23 22:55:40 EDT 2007


Author: scott.stark at jboss.org
Date: 2007-04-23 22:55:40 -0400 (Mon, 23 Apr 2007)
New Revision: 62499

Modified:
   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/basic/ProfileServiceImpl.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/ProfileServiceImpl.java
Log:
Add a key accessor to the Profile interface

Modified: trunk/system/src/main/org/jboss/profileservice/spi/Profile.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/spi/Profile.java	2007-04-23 22:49:32 UTC (rev 62498)
+++ trunk/system/src/main/org/jboss/profileservice/spi/Profile.java	2007-04-24 02:55:40 UTC (rev 62499)
@@ -47,6 +47,12 @@
    };
 
    /**
+    * Get the key used to create the Profile
+    * @return the key used to create the Profile
+    */
+   public ProfileKey getKey();
+
+   /**
     * The x.y.z version of the profile
     * 
     * @return the version if known, null if its unspecified.

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-04-23 22:49:32 UTC (rev 62498)
+++ trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java	2007-04-24 02:55:40 UTC (rev 62499)
@@ -37,6 +37,7 @@
 import org.jboss.profileservice.spi.ModificationInfo;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.ModificationInfo.ModifyStatus;
 import org.jboss.util.JBossObject;
 import org.jboss.virtual.VFS;
@@ -55,7 +56,7 @@
 public class ProfileImpl extends JBossObject
    implements Profile
 {
-   private String name;
+   private ProfileKey key;
    /** The directory containing the profiles */
    private File profileRoot;
    private LinkedHashMap<String,DeploymentContext> bootstraps = new LinkedHashMap<String,DeploymentContext>();
@@ -64,18 +65,23 @@
    /** Is hot deployment checking enabled */
    private volatile boolean hotdeployEnabled;
 
-   public ProfileImpl(String profileRoot, String name)
+   public ProfileImpl(String profileRoot, ProfileKey key)
    {
-      this.name = name;
+      this.key = key;
       this.profileRoot = new File(profileRoot);
       log.info("Using profile root:"+this.profileRoot.getAbsolutePath());
    }
 
    public String getName()
    {
-      return name;
+      return key.getName();
    }
 
+   public ProfileKey getKey()
+   {
+      return key;
+   }
+
    public String getVersion()
    {
       return null;

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-04-23 22:49:32 UTC (rev 62498)
+++ trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java	2007-04-24 02:55:40 UTC (rev 62499)
@@ -32,6 +32,7 @@
 import org.jboss.profileservice.spi.ModificationInfo;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.Profile.DeploymentPhase;
 import org.jboss.util.JBossObject;
 import org.jboss.virtual.VFS;
@@ -47,7 +48,7 @@
 public class ProfileImpl extends JBossObject
    implements Profile
 {
-   private String name;
+   private ProfileKey key;
    private String version;
    /** The repository containing the deployment contents */
    private DeploymentRepository repository;
@@ -59,18 +60,23 @@
     * @param repository
     * @param name
     */
-   public ProfileImpl(DeploymentRepository repository, String name)
+   public ProfileImpl(DeploymentRepository repository, ProfileKey key)
    {
-      this.name = name;
+      this.key = key;
       this.repository = repository;
       log.info("Using repository:"+repository);
    }
 
    public String getName()
    {
-      return name;
+      return key.getName();
    }
-   
+
+   public ProfileKey getKey()
+   {
+      return key;
+   }
+
    public String getVersion()
    {
       return version;

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/basic/ProfileServiceImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/basic/ProfileServiceImpl.java	2007-04-23 22:49:32 UTC (rev 62498)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/basic/ProfileServiceImpl.java	2007-04-24 02:55:40 UTC (rev 62499)
@@ -73,7 +73,8 @@
 
    public void start()
    {
-      defaultImpl = new ProfileImpl(profileRoot, name);
+      ProfileKey key = new ProfileKey(name);
+      defaultImpl = new ProfileImpl(profileRoot, key);
    }
 
    // ProfileService implementation --------------------
@@ -123,7 +124,7 @@
    // Admin of profiles @todo could be an option plugin
    public Profile newProfile(ProfileKey key)
    {
-      return new ProfileImpl(profileRoot, name);
+      return new ProfileImpl(profileRoot, key);
    }
 
    public void removeProfile(ProfileKey key)

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/ProfileServiceImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/ProfileServiceImpl.java	2007-04-23 22:49:32 UTC (rev 62498)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/ProfileServiceImpl.java	2007-04-24 02:55:40 UTC (rev 62499)
@@ -110,13 +110,13 @@
       if( profileRepository == null )
          throw new IllegalStateException("No profileRepository specified");
       // Obtain the deployment repository for the profile
+      ProfileKey key = new ProfileKey(name);
       if( deploymentRepository == null )
       {
-         ProfileKey key = new ProfileKey(name);
          deploymentRepository = profileRepository.getProfileDeploymentRepository(key);
       }
       log.info("Loading profile: "+name+" from: "+deploymentRepository);
-      profile = new ProfileImpl(deploymentRepository, name);
+      profile = new ProfileImpl(deploymentRepository, key);
    }
 
    // ProfileService implementation --------------------
@@ -173,7 +173,7 @@
       throws Exception
    {
       DeploymentRepository repo = profileRepository.createProfileDeploymentRepository(key);
-      return new ProfileImpl(repo, key.getName());
+      return new ProfileImpl(repo, key);
    }
 
    public void removeProfile(ProfileKey key)




More information about the jboss-cvs-commits mailing list