[jboss-cvs] JBossAS SVN: r58909 - in trunk/ejb3/src/main/org/jboss/ejb3: . deployers

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Dec 7 16:58:05 EST 2006


Author: bill.burke at jboss.com
Date: 2006-12-07 16:58:03 -0500 (Thu, 07 Dec 2006)
New Revision: 58909

Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/MCDependencyPolicy.java
   trunk/ejb3/src/main/org/jboss/ejb3/deployers/JBoss5DependencyPolicy.java
Log:
create a real DataSource dependency

Modified: trunk/ejb3/src/main/org/jboss/ejb3/MCDependencyPolicy.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/MCDependencyPolicy.java	2006-12-07 21:38:31 UTC (rev 58908)
+++ trunk/ejb3/src/main/org/jboss/ejb3/MCDependencyPolicy.java	2006-12-07 21:58:03 UTC (rev 58909)
@@ -34,7 +34,7 @@
  */
 public class MCDependencyPolicy implements DependencyPolicy
 {
-   protected HashSet<String> dependencies = new HashSet<String>();
+   protected HashSet dependencies = new HashSet();
 
    public void addDependency(String dependency)
    {
@@ -59,7 +59,7 @@
    public HashSet<DemandMetaData> getDependencies()
    {
       HashSet<DemandMetaData> set = new HashSet<DemandMetaData>();
-      for (String depends : dependencies)
+      for (Object depends : dependencies)
       {
          set.add(new AbstractDemandMetaData(depends));
       }

Modified: trunk/ejb3/src/main/org/jboss/ejb3/deployers/JBoss5DependencyPolicy.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/deployers/JBoss5DependencyPolicy.java	2006-12-07 21:38:31 UTC (rev 58908)
+++ trunk/ejb3/src/main/org/jboss/ejb3/deployers/JBoss5DependencyPolicy.java	2006-12-07 21:58:03 UTC (rev 58909)
@@ -23,6 +23,9 @@
 
 import org.jboss.ejb3.MCDependencyPolicy;
 
+import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
+
 /**
  * Comment
  *
@@ -33,6 +36,18 @@
 {
    public void addDatasource(String jndiName)
    {
-      // todo can't implement this until I know how to create the dependency
+      String ds = jndiName;
+      if (ds.startsWith("java:/"))
+      {
+         ds = ds.substring(6);
+
+      }
+      else if (ds.startsWith("java:"))
+      {
+         ds = ds.substring(5);
+      }
+      //tring onStr = "jboss.jca:name=" + ds + ",service=ManagedConnectionFactory";
+      String onStr = "jboss.jca:name=" + ds + ",service=DataSourceBinding";
+      dependencies.add(onStr);
    }
 }




More information about the jboss-cvs-commits mailing list