[jboss-cvs] JBossAS SVN: r57111 - trunk/system/src/main/org/jboss/system/server/profile/basic

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Sep 23 23:43:58 EDT 2006


Author: scott.stark at jboss.org
Date: 2006-09-23 23:43:56 -0400 (Sat, 23 Sep 2006)
New Revision: 57111

Added:
   trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java
Log:
Missed the ProfileImpl checkin from the MC_VDF_WORK merge

Added: trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java	2006-09-24 03:43:53 UTC (rev 57110)
+++ trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java	2006-09-24 03:43:56 UTC (rev 57111)
@@ -0,0 +1,150 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.profile.basic;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.profileservice.spi.DeploymentTemplate;
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.util.JBossObject;
+
+/**
+ * A basic profile implementation that uses the filesystem to store deployments
+ * and admin metadata.
+ * 
+ * TODO: this needs to be converted to a read/write VFS implementation.
+ * 
+ * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
+ * @version $Revision$
+ */
+public class ProfileImpl extends JBossObject
+   implements Profile
+{
+   private String name;
+   /** The directory containing the profiles */
+   private File profileRoot;
+   private LinkedHashMap<String,DeploymentContext> bootstraps = new LinkedHashMap<String,DeploymentContext>();
+   private LinkedHashMap<String,DeploymentContext> deployments = new LinkedHashMap<String,DeploymentContext>();
+   private LinkedHashMap<String,DeploymentContext> deployers = new LinkedHashMap<String,DeploymentContext>();
+
+   public ProfileImpl(String profileRoot, String name)
+   {
+      this.name = name;
+      this.profileRoot = new File(profileRoot);
+      log.info("Using profile root:"+this.profileRoot.getAbsolutePath());
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public String getVersion()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   public void addBootstrap(DeploymentContext d)
+   {
+      bootstraps.put(d.getName(), d);
+   }
+
+   public void removeBootstrap(String name)
+   {
+      bootstraps.remove(name);
+   }
+
+   public DeploymentContext getBootstrap(String name) throws NoSuchDeploymentException
+   {
+      DeploymentContext deployment = bootstraps.get(name);
+      return deployment;
+   }
+
+   public Collection<DeploymentContext> getBootstraps()
+   {
+      return Collections.unmodifiableCollection(bootstraps.values());
+   }
+
+   public void addDeployer(DeploymentContext d)
+   {
+      deployers.put(d.getName(), d);
+   }
+
+   public void removeDeployer(String name)
+   {
+      deployers.remove(name);
+   }
+
+   public DeploymentContext getDeployer(String name) throws NoSuchDeploymentException
+   {
+      DeploymentContext deployment = deployers.get(name);
+      return deployment;
+   }
+
+   public Collection<DeploymentContext> getDeployers()
+   {
+      return Collections.unmodifiableCollection(deployers.values());
+   }
+
+   public DeploymentTemplate getTemplate(String name)
+         throws NoSuchDeploymentException
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   public void addDeployment(DeploymentContext d)
+   {
+      deployments.put(d.getName(), d);
+   }
+
+   public void removeDeployment(String name)
+   {
+      deployments.remove(name);
+   }
+
+   public DeploymentContext getDeployment(String name)
+         throws NoSuchDeploymentException
+   {
+      DeploymentContext deployment = deployments.get(name);
+      return deployment;
+   }
+
+   public Collection<DeploymentContext> getDeployments()
+   {
+      return Collections.unmodifiableCollection(deployments.values());
+   }
+
+   public Map<String, Object> getConfig()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+}




More information about the jboss-cvs-commits mailing list