[jboss-cvs] JBossAS SVN: r80605 - in trunk/server/src/main/org/jboss: tm/usertx/server and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Nov 6 13:17:04 EST 2008


Author: galder.zamarreno at jboss.com
Date: 2008-11-06 13:17:04 -0500 (Thu, 06 Nov 2008)
New Revision: 80605

Modified:
   trunk/server/src/main/org/jboss/proxy/GenericProxyFactory.java
   trunk/server/src/main/org/jboss/tm/usertx/server/ClientUserTransactionService.java
Log:
[JBAS-6056] Some TRACE added to GenericProxyFactory and ClientUserTransactionService register itself in the system registry to be used by server side invoker.

Modified: trunk/server/src/main/org/jboss/proxy/GenericProxyFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/proxy/GenericProxyFactory.java	2008-11-06 18:14:24 UTC (rev 80604)
+++ trunk/server/src/main/org/jboss/proxy/GenericProxyFactory.java	2008-11-06 18:17:04 UTC (rev 80605)
@@ -30,6 +30,7 @@
 import org.jboss.invocation.InvocationContext;
 import org.jboss.invocation.InvocationKey;
 import org.jboss.invocation.Invoker;
+import org.jboss.logging.Logger;
 import org.jboss.system.Registry;
 import org.jboss.util.NestedRuntimeException;
 
@@ -39,10 +40,12 @@
  *
  * @todo generalize the proxy/invoker factory object
  * @author Scott.Stark at jboss.org
+ * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
  * @version $Revision$
  */
 public class GenericProxyFactory
 {
+   private static final Logger log = Logger.getLogger(GenericProxyFactory.class);
 
    /** Create a composite proxy for the given interfaces, invoker.
     @param id the cache id for the target object if any
@@ -102,6 +105,10 @@
       else
          context = new InvocationContext();
       Integer nameHash = new Integer(targetName.hashCode());
+      if (log.isTraceEnabled())
+      {
+         log.trace("Target name " + targetName + " and corresponding hash code" +  nameHash);
+      }      
       context.setObjectName(nameHash);
       context.setCacheId(id);
       if( jndiName != null )

Modified: trunk/server/src/main/org/jboss/tm/usertx/server/ClientUserTransactionService.java
===================================================================
--- trunk/server/src/main/org/jboss/tm/usertx/server/ClientUserTransactionService.java	2008-11-06 18:14:24 UTC (rev 80604)
+++ trunk/server/src/main/org/jboss/tm/usertx/server/ClientUserTransactionService.java	2008-11-06 18:17:04 UTC (rev 80605)
@@ -32,6 +32,7 @@
 import javax.naming.InitialContext;
 import javax.naming.Context;
 
+import org.jboss.system.Registry;
 import org.jboss.system.ServiceMBeanSupport;
 import org.jboss.tm.usertx.client.ClientUserTransaction;
 import org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory;
@@ -45,6 +46,7 @@
  *
  * @author <a href="mailto:osh at sparre.dk">Ole Husgaard</a>
  * @author Scott.Stark at jboss.org
+ * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
  * @version $Revision$
  */
 public class ClientUserTransactionService
@@ -163,6 +165,14 @@
          tmpMap.put(hash, method);
       }
       marshalledInvocationMapping = Collections.unmodifiableMap(tmpMap);
+      
+      // Place our ObjectName hash into the Registry so invokers can resolve it.
+      // We need this for the HA Proxy case where the only the target service 
+      // is added to the registry, which is how it should be. 
+      // In the non HA Proxy case, JRMPProxyFactory acts both as a proxy factory
+      // and proxy which is conceptually wrong, hence this is an extra step in 
+      // that case.
+      Registry.bind(new Integer(serviceName.hashCode()), serviceName);
    }
 
    protected void stopService()
@@ -176,6 +186,9 @@
       {
          log.warn("Failed to unbind "+JNDI_NAME, e);
       }
+      
+      // Remove our ObjectName hash from Registry if the proxy factory had not  
+      Registry.unbind(new Integer(serviceName.hashCode()));
    }
 
 }




More information about the jboss-cvs-commits mailing list