[jboss-cvs] JBossAS SVN: r63663 - branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jun 27 04:18:56 EDT 2007


Author: wolfc
Date: 2007-06-27 04:18:55 -0400 (Wed, 27 Jun 2007)
New Revision: 63663

Modified:
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulClusterProxyFactory.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java
Log:
EJBTHREE-994: merged fix from trunk

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulClusterProxyFactory.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulClusterProxyFactory.java	2007-06-27 08:18:23 UTC (rev 63662)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulClusterProxyFactory.java	2007-06-27 08:18:55 UTC (rev 63663)
@@ -63,7 +63,7 @@
 {
    private static final Logger log = Logger.getLogger(StatefulClusterProxyFactory.class);
    
-   public static final String FACTORY_ATTRIBUTE = ",element=ProxyFactory,partition=";
+//   public static final String FACTORY_ATTRIBUTE = ",element=ProxyFactory,partition=";
    
    private RemoteBinding binding;
    private InvokerLocator locator;
@@ -131,6 +131,7 @@
          namingException.setRootCause(e);
          throw namingException;
       }
+      assert !Dispatcher.singleton.isRegistered(targetId) : targetId + " is already registered";
       Dispatcher.singleton.registerTarget(targetId, this);
 
    }
@@ -195,10 +196,14 @@
       return handle;
    }
    
+   /**
+    * @return unique name for this proxy factory
+    */
    protected String getTargetId()
-   {  
+   {
+      assert jndiName != null : "jndiName is null";      
       String partition = ((StatefulContainer) container).getPartitionName();
-      return container.getObjectName().getCanonicalName() + FACTORY_ATTRIBUTE + partition;
+      return jndiName + PROXY_FACTORY_NAME + "@" + partition;
    }
    
    public synchronized void replicantsChanged (String key, 

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java	2007-06-27 08:18:23 UTC (rev 63662)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java	2007-06-27 08:18:55 UTC (rev 63663)
@@ -55,7 +55,7 @@
 {
    private static final Logger log = Logger.getLogger(StatefulRemoteProxyFactory.class);
    
-   public static final String FACTORY_ATTRIBUTE = ",element=ProxyFactory";
+//   public static final String FACTORY_ATTRIBUTE = ",element=ProxyFactory";
    
    private RemoteBinding binding;
    private InvokerLocator locator;
@@ -127,6 +127,7 @@
          namingException.setRootCause(e);
          throw namingException;
       }
+      assert !Dispatcher.singleton.isRegistered(targetId) : targetId + " is already registered";
       Dispatcher.singleton.registerTarget(targetId, this);
 
       StatefulContainer statefulContainer = (StatefulContainer) container;
@@ -258,9 +259,13 @@
       }
    }
    
+   /**
+    * @return unique name for this proxy factory
+    */
    protected String getTargetId()
    {  
-      return container.getObjectName().getCanonicalName() + FACTORY_ATTRIBUTE;
+      assert jndiName != null : "jndiName is null"; 
+      return jndiName + PROXY_FACTORY_NAME;
    }
    
    protected Object createPojiProxy(Object oid, Class[] interfaces, String uri) throws Exception




More information about the jboss-cvs-commits mailing list