[jboss-cvs] JBossAS SVN: r97212 - projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 1 05:26:55 EST 2009


Author: thomas.diesler at jboss.com
Date: 2009-12-01 05:26:54 -0500 (Tue, 01 Dec 2009)
New Revision: 97212

Added:
   projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/DeploymentFactory.java
Modified:
   projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java
Log:
Add a DeploymentFactory

Modified: projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java
===================================================================
--- projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java	2009-12-01 10:25:24 UTC (rev 97211)
+++ projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java	2009-12-01 10:26:54 UTC (rev 97212)
@@ -25,7 +25,6 @@
 
 import java.net.URL;
 
-import org.jboss.osgi.deployment.internal.DeploymentImpl;
 import org.jboss.osgi.spi.util.BundleInfo;
 import org.jboss.virtual.VirtualFile;
 
@@ -39,18 +38,16 @@
 {
    public Deployment createDeployment(URL url)
    {
-      BundleInfo info = BundleInfo.createBundleInfo(url);
-      return new DeploymentImpl(info);
+      return DeploymentFactory.createDeployment(url);
    }
    
    public Deployment createDeployment(VirtualFile file)
    {
-      BundleInfo info = BundleInfo.createBundleInfo(file);
-      return new DeploymentImpl(info);
+      return DeploymentFactory.createDeployment(file);
    }
    
    public Deployment createDeployment(BundleInfo info)
    {
-      return new DeploymentImpl(info);
+      return DeploymentFactory.createDeployment(info);
    }
 }
\ No newline at end of file

Added: projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/DeploymentFactory.java
===================================================================
--- projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/DeploymentFactory.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/DeploymentFactory.java	2009-12-01 10:26:54 UTC (rev 97212)
@@ -0,0 +1,61 @@
+/*
+ * 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.osgi.deployment.deployer;
+
+//$Id$
+
+import java.net.URL;
+
+import org.jboss.osgi.deployment.internal.DeploymentImpl;
+import org.jboss.osgi.spi.util.BundleInfo;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * A deployment factory.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 16-Oct-2009
+ */
+public class DeploymentFactory
+{
+   // Hide default ctor
+   private DeploymentFactory()
+   {
+   }
+   
+   public static Deployment createDeployment(URL url)
+   {
+      BundleInfo info = BundleInfo.createBundleInfo(url);
+      return new DeploymentImpl(info);
+   }
+   
+   public static Deployment createDeployment(VirtualFile file)
+   {
+      BundleInfo info = BundleInfo.createBundleInfo(file);
+      return new DeploymentImpl(info);
+   }
+   
+   public static Deployment createDeployment(BundleInfo info)
+   {
+      return new DeploymentImpl(info);
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/DeploymentFactory.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the jboss-cvs-commits mailing list