[jboss-cvs] JBossAS SVN: r64262 - in branches/Branch_4_2/ejb3: src/main/org/jboss/ejb3 and 17 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jul 24 17:59:08 EDT 2007


Author: bdecoste
Date: 2007-07-24 17:59:08 -0400 (Tue, 24 Jul 2007)
New Revision: 64262

Added:
   branches/Branch_4_2/ejb3/src/resources/test-configs/localfromremote1/
   branches/Branch_4_2/ejb3/src/resources/test-configs/localfromremote1/deploy/
   branches/Branch_4_2/ejb3/src/resources/test-configs/localfromremote2/
   branches/Branch_4_2/ejb3/src/resources/test-configs/localfromremote2/conf/
   branches/Branch_4_2/ejb3/src/resources/test-configs/localfromremote2/conf/jboss-service.xml
   branches/Branch_4_2/ejb3/src/resources/test-configs/localfromremote2/deploy/
   branches/Branch_4_2/ejb3/src/resources/test/localfromremote/
   branches/Branch_4_2/ejb3/src/resources/test/localfromremote/jndi1.properties
   branches/Branch_4_2/ejb3/src/resources/test/localfromremote/jndi2.properties
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulBean.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulRemote.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatelessBean.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatelessLocal.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/unit/
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/unit/LocalTestCase.java
Modified:
   branches/Branch_4_2/ejb3/build-test.xml
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/BaseSessionContext.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/Ejb3Registry.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/SessionContainer.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/remoting/BaseRemoteProxy.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/remoting/IsLocalInterceptor.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceContainer.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceLocalProxy.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceRemoteProxy.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceRemoteProxyFactory.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/session/BaseSessionRemoteProxy.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/NestedStatefulBeanContext.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulBeanContext.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulBeanContextReference.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulClusterProxyFactory.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulClusteredProxy.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulHomeRemoteProxy.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalHomeProxy.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxy.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxy.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessClusterProxyFactory.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessClusteredProxy.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessContainer.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxy.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxy.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/TimerServiceFactory.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/jboss/JBossTimerServiceFactory.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/jboss/TimerServiceFacade.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/quartz/QuartzTimerServiceFactory.java
Log:
[EJBTHREE-1019] fix and test for invoking Local proxies remotely. Modified Ejb3Registry to use a GUID instead of the ObjectName of the container.

Modified: branches/Branch_4_2/ejb3/build-test.xml
===================================================================
--- branches/Branch_4_2/ejb3/build-test.xml	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/build-test.xml	2007-07-24 21:59:08 UTC (rev 64262)
@@ -58,6 +58,8 @@
    <property name="node0" value="localhost" />
    <property name="node0.http.url" value="http://${node0}:8080" />
    <property name="node0.jndi.url" value="jnp://${node0}:1099" />
+   <property name="node0.jndi.port1.url" value="jnp://${node0}:1199" />
+   <property name="node0.http.port1.url" value="http://${node0}:8180" />
    <property name="node1" value="${hostname}" />
    <property name="node1.http.url" value="http://${node1}:8080" />
    <property name="node1.jndi.url" value="jnp://${node1}:1099" />
@@ -2782,7 +2784,40 @@
    	
 	  <copy file="${build.lib}/stateless-test.jar" tofile="${build.lib}/stateless-test.ejb3"/>
    </target>
+   
+   <target name="localfromremote"
+      description="Builds all jar files."
+      depends="compile-classes">
 
+      <mkdir dir="${build.lib}"/>
+
+      <copy file="${resources}/test/localfromremote/jndi1.properties" tofile="${resources}/test/localfromremote/jndi.properties"/>
+      <jar jarfile="${build.lib}/localfromremote-test1.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/ejb3/test/localfromremote/*.class"/>
+         </fileset>
+         
+         <fileset dir="${resources}/test/localfromremote">
+            <include name="jndi.properties"/>
+         </fileset>
+      </jar>
+      <delete file="${resources}/test/localfromremote/jndi.properties"/>
+      <copy file="${build.lib}/localfromremote-test1.jar" tofile="${resources}/test-configs/localfromremote1/deploy/localfromremote-test.jar"/>
+      
+      <copy file="${resources}/test/localfromremote/jndi2.properties" tofile="${resources}/test/localfromremote/jndi.properties"/>
+      <jar jarfile="${build.lib}/localfromremote-test2.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/ejb3/test/localfromremote/*.class"/>
+         </fileset>
+         
+         <fileset dir="${resources}/test/localfromremote">
+            <include name="jndi.properties"/>
+         </fileset>
+      </jar>
+      <delete file="${resources}/test/localfromremote/jndi.properties"/>
+      <copy file="${build.lib}/localfromremote-test2.jar" tofile="${resources}/test-configs/localfromremote2/deploy/localfromremote-test.jar"/>
+   </target>
+
    <target name="concurrentnaming"
       description="Builds all jar files."
       depends="compile-classes">
@@ -3247,7 +3282,7 @@
 	  </copy>
    </target>
    
-   <target name="jars" depends="clusteredjms, entityoptimisticlocking, concurrentnaming, propertyreplacement, persistenceunits, invalidtxmdb, descriptortypo, libdeployment, homeinterface, timestampentity, servicexmbean, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader, 
+   <target name="jars" depends="localfromremote, clusteredjms, entityoptimisticlocking, concurrentnaming, propertyreplacement, persistenceunits, invalidtxmdb, descriptortypo, libdeployment, homeinterface, timestampentity, servicexmbean, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader, 
       circulardependency, jsp, timerdependency, servicedependency, servlet, stateless14, webservices, ear, ejbthree440, 
       ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree724, ejbthree751, ejbthree832, ejbthree921,
       ejbthree959, ejbthree963, ejbthree994,
@@ -3530,6 +3565,7 @@
       <antcall target="iiop-tests"  inheritRefs="true"/>
       <antcall target="arjuna-test"  inheritRefs="true"/>
       <antcall target="libdeployment-test"  inheritRefs="true"/>
+      <antcall target="multi-instance-localfromremote-test"  inheritRefs="true"/>
    </target>
 
    <target name="no-start-jboss-tests" depends="init" description="Execute all tests">
@@ -4104,6 +4140,37 @@
 
    </target>
    
+   <target name="multi-instance-localfromremote-test">
+      <create-config baseconf="default" newconf="localfromremote1">
+         <patternset>
+	        <include name="conf/**"/>
+	        <include name="deploy*/**"/>
+	        <include name="lib/**"/>
+         </patternset>
+      </create-config>
+      <create-config baseconf="default" newconf="localfromremote2">
+         <patternset>
+	        <include name="conf/**"/>
+	        <include name="deploy*/**"/>
+	        <include name="lib/**"/>
+         </patternset>
+      </create-config>
+       
+      <start-jboss conf="localfromremote1" host="${node0}" jvmargs="${ejb3.jboss.jvmargs}"/>
+	  <start-jboss conf="localfromremote2" host="${node0}" jvmargs="${ejb3.jboss.jvmargs}"/>
+	  
+	  <antcall target="tests-multi-instance-wait"/> 
+	
+	  <antcall target="test-with-jvmargs" inheritRefs="true">
+         <param name="test" value="localfromremote"/>
+         <param name="jvmargs" value=""/>
+      </antcall>
+      
+      <stop-jboss url="${node0.jndi.url}" jboss.dist="${ejb3.dist}"/>
+      <stop-jboss url="${node0.jndi.port1.url}" jboss.dist="${ejb3.dist}"/>
+
+   </target>
+   
    <target name="clustered-jms-test">
       <create-config baseconf="all" newconf="clusteredjms">
          <patternset>
@@ -4150,6 +4217,19 @@
       <fail message="Timeout waiting for nodes to start" if="cluster.timeout"/>
       <echo message="Nodes have started, waiting for cluster to stablize..."/>
    </target>
+   
+   <target name="tests-multi-instance-wait" unless="${tests.clustering.skip.startup}">
+      <echo message="Waiting for nodes to start..."/>
+      <waitfor maxwait="120" maxwaitunit="second"
+         checkevery="5" checkeveryunit="second" timeoutproperty="cluster.timeout">
+         <and>
+            <http url="${node0.http.url}"/>
+            <http url="${node0.http.port1.url}"/>
+         </and>
+      </waitfor>
+      <fail message="Timeout waiting for nodes to start" if="cluster.timeout"/>
+      <echo message="Nodes have started, waiting for cluster to stablize..."/>
+   </target>
 
    <macrodef name="create-ejb3-cluster-node"
       description="Create a simplified cluster configuration for ejb3 testing">

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/BaseSessionContext.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/BaseSessionContext.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/BaseSessionContext.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -122,7 +122,7 @@
 
    public void writeExternal(ObjectOutput out) throws IOException
    {
-      out.writeUTF(container.getObjectName().getCanonicalName());
+      out.writeUTF(Ejb3Registry.guid(container));
    }
 
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/Ejb3Registry.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/Ejb3Registry.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/Ejb3Registry.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -46,9 +46,9 @@
     * @param oid    the canonical object name of the container
     * @return       the container or null if not found
     */
-   public static Container findContainer(String oid)
+   public static Container findContainer(String guid)
    {
-      return containers.get(oid);
+      return containers.get(guid);
    }
 
    /**
@@ -57,14 +57,14 @@
     * @param oid    the canonical object name of the container
     * @return       true if found, false otherwise
     */
-   public static boolean hasContainer(String oid)
+   public static boolean hasContainer(String guid)
    {
-      return containers.containsKey(oid);
+      return containers.containsKey(guid);
    }
    
-   private static final String oid(Container container)
+   public static final String guid(Container container)
    {
-      return container.getObjectName().getCanonicalName();
+      return container.getObjectName().getCanonicalName() + "-" + container.hashCode();
    }
    
    /**
@@ -75,10 +75,10 @@
     */
    public static void register(Container container)
    {
-      String oid = oid(container);
-      if(hasContainer(oid))
-         throw new IllegalStateException("Container " + oid + " + is already registered");
-      containers.put(oid, container);
+      String guid = guid(container);
+      if(hasContainer(guid))
+         throw new IllegalStateException("Container " + guid + " + is already registered");
+      containers.put(guid, container);
    }
 
    /**
@@ -89,10 +89,10 @@
     */
    public static void unregister(Container container)
    {
-      String oid = oid(container);
-      if(!hasContainer(oid))
-         throw new IllegalStateException("Container " + oid + " + is not registered");
-      containers.remove(oid);
+      String guid = guid(container);
+      if(!hasContainer(guid))
+         throw new IllegalStateException("Container " + guid + " + is not registered");
+      containers.remove(guid);
    }
 
    /**
@@ -103,11 +103,11 @@
     * @return                       the container
     * @throws IllegalStateException if the container is not registered
     */
-   public static Container getContainer(String oid)
+   public static Container getContainer(String guid)
    {
-      if(!hasContainer(oid))
-         throw new IllegalStateException("Container " + oid + " is not registered");
-      return containers.get(oid);
+      if(!hasContainer(guid))
+         throw new IllegalStateException("Container " + guid + " is not registered");
+      return containers.get(guid);
    }
 
    /**
@@ -119,5 +119,4 @@
    {
       return Collections.unmodifiableCollection(containers.values());
    }
-
 }

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/SessionContainer.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/SessionContainer.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/SessionContainer.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -229,7 +229,7 @@
 
    public static InvocationResponse marshallException(Invocation invocation, Throwable exception, Map responseContext) throws Throwable
    {
-      if (!invocation.getMetaData().hasTag(IsLocalInterceptor.IS_LOCAL)) throw exception;
+      if (invocation.getMetaData(IsLocalInterceptor.IS_LOCAL,IsLocalInterceptor.IS_LOCAL) == null) throw exception;
 
       InvocationResponse response = new InvocationResponse();
       response.setContextInfo(responseContext);
@@ -244,7 +244,7 @@
    {
       InvocationResponse response;
       // marshall return value
-      if (rtn != null && invocation.getMetaData().hasTag(IsLocalInterceptor.IS_LOCAL))
+      if (rtn != null && invocation.getMetaData(IsLocalInterceptor.IS_LOCAL, IsLocalInterceptor.IS_LOCAL) != null)
       {
          response = new InvocationResponse(new MarshalledObjectForLocalCalls(rtn));
       }

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/remoting/BaseRemoteProxy.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/remoting/BaseRemoteProxy.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/remoting/BaseRemoteProxy.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -26,6 +26,9 @@
 import org.jboss.aop.advice.Interceptor;
 import org.jboss.aop.metadata.SimpleMetaData;
 
+import org.jboss.ejb3.Container;
+import org.jboss.ejb3.Ejb3Registry;
+
 /**
  * Comment
  *
@@ -34,13 +37,22 @@
  */
 public abstract class BaseRemoteProxy implements java.io.Serializable, InvocationHandler, RemoteProxy
 {
-   protected Object containerId;
+   protected String containerId;
+   protected String containerGuid;
    protected Interceptor[] interceptors;
    protected SimpleMetaData metadata;
 
-   protected BaseRemoteProxy(Object containerId, Interceptor[] interceptors)
+   protected BaseRemoteProxy(Container container, Interceptor[] interceptors)
    {
+      this.containerId = container.getObjectName().getCanonicalName();
+      this.containerGuid = Ejb3Registry.guid(container);
+      this.interceptors = interceptors;
+   }
+   
+   protected BaseRemoteProxy(String containerId, String containerGuid, Interceptor[] interceptors)
+   {
       this.containerId = containerId;
+      this.containerGuid = containerGuid;
       this.interceptors = interceptors;
    }
 

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/remoting/IsLocalInterceptor.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/remoting/IsLocalInterceptor.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/remoting/IsLocalInterceptor.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -48,6 +48,8 @@
    private static final long serialVersionUID = 337700910587744646L;
 
    private static final Logger log = Logger.getLogger(IsLocalInterceptor.class);
+   
+   public static final String GUID = "GUID";
 
    public static final String IS_LOCAL = "IS_LOCAL";
    public static final String IS_LOCAL_EXCEPTION = "IS_LOCAL_EXCEPTION";
@@ -64,8 +66,8 @@
    {
       if (isLocal())
       {
-         Object oid = invocation.getMetaData(Dispatcher.DISPATCHER, Dispatcher.OID);
-         Container container = Ejb3Registry.getContainer(oid.toString());
+         String guid = (String)invocation.getMetaData(IS_LOCAL, GUID);
+         Container container = Ejb3Registry.getContainer(guid);
          
          return invokeLocal(invocation, container);
       }

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceContainer.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceContainer.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceContainer.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -147,7 +147,7 @@
          initBeanContext();
 
          // make sure the timer service is there before injection takes place
-         timerService = TimerServiceFactory.getInstance().createTimerService(this.getObjectName(), this);
+         timerService = TimerServiceFactory.getInstance().createTimerService(this, this);
 
          injectDependencies(beanContext);
 

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceLocalProxy.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceLocalProxy.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceLocalProxy.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -73,7 +73,7 @@
          return ret;
       }
 
-      ServiceContainer sc = (ServiceContainer) container;
+      ServiceContainer sc = (ServiceContainer) getContainer();
       return sc.localInvoke(method, args, (FutureHolder) provider);
    }
 
@@ -84,7 +84,7 @@
       {
          Class[] interfaces = ProxyUtils.addAsynchProviderInterface(infs);
          AsynchMixin mixin = new AsynchMixin();
-         ServiceLocalProxy handler = new ServiceLocalProxy(mixin, container);
+         ServiceLocalProxy handler = new ServiceLocalProxy(mixin, getContainer());
          return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaces, handler);
       }
 
@@ -108,7 +108,7 @@
 
    public String toString()
    {
-      return container.getEjbName().toString();
+      return proxyName;
    }
 
 }

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceRemoteProxy.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceRemoteProxy.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceRemoteProxy.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -31,9 +31,12 @@
 import org.jboss.aspects.asynch.AsynchMixin;
 import org.jboss.aspects.asynch.AsynchProvider;
 import org.jboss.aspects.remoting.InvokeRemoteInterceptor;
+import org.jboss.ejb3.Container;
+import org.jboss.ejb3.Ejb3Registry;
 import org.jboss.ejb3.JBossProxy;
 import org.jboss.ejb3.ProxyUtils;
 import org.jboss.ejb3.asynchronous.AsynchronousInterceptor;
+import org.jboss.ejb3.remoting.IsLocalInterceptor;
 import org.jboss.remoting.InvokerLocator;
 
 /**
@@ -47,15 +50,15 @@
    protected InvokerLocator uri;
    AsynchProvider provider;
 
-   public ServiceRemoteProxy(Object containerId, Interceptor[] interceptors, InvokerLocator uri)
+   public ServiceRemoteProxy(Container container, Interceptor[] interceptors, InvokerLocator uri)
    {
-      super(containerId, interceptors);
+      super(container, interceptors);
       this.uri = uri;
    }
 
-   public ServiceRemoteProxy(AsynchProvider provider, Object containerId, Interceptor[] interceptors, InvokerLocator uri)
+   public ServiceRemoteProxy(AsynchProvider provider, String containerId, String containerGuid, Interceptor[] interceptors, InvokerLocator uri)
    {
-      super(containerId, interceptors);
+      super(containerId, containerGuid, interceptors);
       this.uri = uri;
       this.provider = provider;
    }
@@ -86,7 +89,8 @@
       sri.getMetaData().addMetaData(Dispatcher.DISPATCHER, Dispatcher.OID, containerId, PayloadKey.AS_IS);
       sri.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.INVOKER_LOCATOR, uri, PayloadKey.AS_IS);
       sri.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.SUBSYSTEM, "AOP", PayloadKey.AS_IS);
-
+      sri.getMetaData().addMetaData(IsLocalInterceptor.IS_LOCAL, IsLocalInterceptor.GUID, containerGuid, PayloadKey.AS_IS);
+      
       if (provider != null)
       {
          sri.getMetaData().addMetaData(AsynchronousInterceptor.ASYNCH, AsynchronousInterceptor.INVOKE_ASYNCH, "YES", PayloadKey.AS_IS);
@@ -102,7 +106,7 @@
          Class[] interfaces = ProxyUtils.addAsynchProviderInterface(infs);
          AsynchMixin mixin = new AsynchMixin();
          Interceptor[] newInterceptors = ProxyUtils.addAsynchProxyInterceptor(mixin, interceptors);
-         ServiceRemoteProxy handler = new ServiceRemoteProxy(mixin, containerId, newInterceptors, uri);
+         ServiceRemoteProxy handler = new ServiceRemoteProxy(mixin, containerId, containerGuid, newInterceptors, uri);
          return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaces, handler);
       }
 

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceRemoteProxyFactory.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceRemoteProxyFactory.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/service/ServiceRemoteProxyFactory.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -71,14 +71,13 @@
    {
       try
       {
-         Object containerId = container.getObjectName().getCanonicalName();
          String stackName = "ServiceClientInterceptors";
          if (binding.interceptorStack() != null && !binding.interceptorStack().equals(""))
          {
             stackName = binding.interceptorStack();
          }
          AdviceStack stack = AspectManager.instance().getAdviceStack(stackName);
-         Object[] args = {new ServiceRemoteProxy(containerId, stack.createInterceptors((Advisor) container, null), locator)};
+         Object[] args = {new ServiceRemoteProxy(container, stack.createInterceptors((Advisor) container, null), locator)};
          return proxyConstructor.newInstance(args);
       }
       catch (InstantiationException e)

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/session/BaseSessionRemoteProxy.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/session/BaseSessionRemoteProxy.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/session/BaseSessionRemoteProxy.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -27,6 +27,8 @@
 import org.jboss.aop.advice.Interceptor;
 import org.jboss.proxy.ejb.handle.StatefulHandleImpl;
 
+import org.jboss.ejb3.Container;
+
 /**
  * Comment
  *
@@ -41,11 +43,16 @@
    protected HomeHandle homeHandle;
    protected EJBMetaData ejbMetaData;
    
-   public BaseSessionRemoteProxy(Object containerId, Interceptor[] interceptors)
+   public BaseSessionRemoteProxy(Container container, Interceptor[] interceptors)
    {
-      super(containerId, interceptors);
+      super(container, interceptors);
    }
    
+   public BaseSessionRemoteProxy(String containerId, String containerGuid, Interceptor[] interceptors)
+   {
+      super(containerId, containerGuid, interceptors);
+   }
+   
    protected BaseSessionRemoteProxy()
    {
    }

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/NestedStatefulBeanContext.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/NestedStatefulBeanContext.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/NestedStatefulBeanContext.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -30,6 +30,8 @@
 import javax.persistence.EntityManager;
 import org.jboss.aop.metadata.SimpleMetaData;
 
+import org.jboss.ejb3.Ejb3Registry;
+
 /**
  * Overrides superclass to not use MarshalledValue in externalization,
  * as a nested context is meant to be serialized as part of its parent
@@ -47,7 +49,7 @@
 
    public void writeExternal(ObjectOutput out) throws IOException
    {
-      out.writeUTF(getContainer().getObjectName().getCanonicalName());
+      out.writeUTF(Ejb3Registry.guid(getContainer()));
       out.writeObject(id);
       out.writeObject(metadata);
       out.writeObject(bean);

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulBeanContext.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulBeanContext.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulBeanContext.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -720,7 +720,7 @@
    public void setContainer(Container container)
    {
       super.setContainer(container);
-      containerName = container.getObjectName().getCanonicalName();
+      containerName = Ejb3Registry.guid(container);
    }
 
    public Container getContainer()

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulBeanContextReference.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulBeanContextReference.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulBeanContextReference.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -52,7 +52,7 @@
    {
       this.beanContext = beanContext;
       oid = beanContext.getId();
-      containerId = beanContext.getContainer().getObjectName().getCanonicalName();
+      containerId = Ejb3Registry.guid(beanContext.getContainer());
    }
 
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

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-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulClusterProxyFactory.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -140,7 +140,6 @@
    {
       try
       {
-         Object containerId = container.getObjectName().getCanonicalName();
          String stackName = "ClusteredStatefulSessionClientInterceptors";
          if (binding.interceptorStack() != null && !binding.interceptorStack().equals(""))
          {
@@ -148,7 +147,7 @@
          }
          AdviceStack stack = AspectManager.instance().getAdviceStack(stackName);
          String partitionName = ((StatefulContainer) container).getPartitionName();
-         Object[] args = {new StatefulClusteredProxy(containerId, stack.createInterceptors((Advisor) container, null), 
+         Object[] args = {new StatefulClusteredProxy(container, stack.createInterceptors((Advisor) container, null), 
                                                      wrapper, lbPolicy, partitionName)};
          
          return proxyConstructor.newInstance(args);

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulClusteredProxy.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulClusteredProxy.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulClusteredProxy.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -32,10 +32,13 @@
 import org.jboss.aspects.remoting.ClusterConstants;
 import org.jboss.aspects.remoting.FamilyWrapper;
 import org.jboss.aspects.remoting.InvokeRemoteInterceptor;
+import org.jboss.ejb3.Container;
+import org.jboss.ejb3.Ejb3Registry;
 import org.jboss.ejb3.JBossProxy;
 import org.jboss.ejb3.ProxyUtils;
 import org.jboss.ejb3.asynchronous.AsynchronousInterceptor;
 import org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor;
+import org.jboss.ejb3.remoting.IsLocalInterceptor;
 import org.jboss.ha.framework.interfaces.LoadBalancePolicy;
 import org.jboss.util.id.GUID;
 
@@ -57,18 +60,21 @@
    protected String partitionName;
 
 
-   public StatefulClusteredProxy(Object containerId, Interceptor[] interceptors, FamilyWrapper family, LoadBalancePolicy lb, String partitionName)
+   public StatefulClusteredProxy(Container container, Interceptor[] interceptors, FamilyWrapper family, LoadBalancePolicy lb, String partitionName)
    {
-      super(containerId, interceptors);
+      super(container, interceptors);
       this.family = family;
       this.lbPolicy = lb;
       this.partitionName = partitionName;
    }
 
-   public StatefulClusteredProxy(AsynchProvider provider, Object containerId, Interceptor[] interceptors, FamilyWrapper family, LoadBalancePolicy lb, String partitionName)
+   public StatefulClusteredProxy(AsynchProvider provider, String containerId, String containerGuid, Interceptor[] interceptors, FamilyWrapper family, LoadBalancePolicy lb, String partitionName)
    {
-      this(containerId, interceptors, family, lb, partitionName);
+      super(containerId, containerGuid, interceptors);
       this.provider = provider;
+      this.family = family;
+      this.lbPolicy = lb;
+      this.partitionName = partitionName;
    }
 
    protected StatefulClusteredProxy()
@@ -98,7 +104,8 @@
       sri.getMetaData().addMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.LOADBALANCE_POLICY, lbPolicy, PayloadKey.AS_IS);
       sri.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.SUBSYSTEM, "AOP", PayloadKey.AS_IS);
       sri.getMetaData().addMetaData(ClusteredIsLocalInterceptor.PARTITION_NAME, ClusteredIsLocalInterceptor.PARTITION_NAME, partitionName, PayloadKey.TRANSIENT);
-
+      sri.getMetaData().addMetaData(IsLocalInterceptor.IS_LOCAL, IsLocalInterceptor.GUID, containerGuid, PayloadKey.AS_IS);
+      
       if (provider != null)
       {
          sri.getMetaData().addMetaData(AsynchronousInterceptor.ASYNCH, AsynchronousInterceptor.INVOKE_ASYNCH, "YES", PayloadKey.AS_IS);
@@ -130,7 +137,7 @@
          Class[] interfaces = ProxyUtils.addAsynchProviderInterface(infs);
          AsynchMixin mixin = new AsynchMixin();
          Interceptor[] newInterceptors = ProxyUtils.addAsynchProxyInterceptor(mixin, interceptors);
-         StatefulClusteredProxy handler = new StatefulClusteredProxy(mixin, containerId, newInterceptors, family, lbPolicy, partitionName);
+         StatefulClusteredProxy handler = new StatefulClusteredProxy(mixin, containerId, containerGuid, newInterceptors, family, lbPolicy, partitionName);
          return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaces, handler);
       }
 

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulHomeRemoteProxy.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulHomeRemoteProxy.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulHomeRemoteProxy.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -29,7 +29,9 @@
 import org.jboss.aop.util.MethodHashing;
 import org.jboss.aop.util.PayloadKey;
 import org.jboss.aspects.remoting.InvokeRemoteInterceptor;
+import org.jboss.ejb3.Container;
 import org.jboss.ejb3.ProxyUtils;
+import org.jboss.ejb3.remoting.IsLocalInterceptor;
 import org.jboss.logging.Logger;
 import org.jboss.remoting.InvokerLocator;
 
@@ -49,15 +51,15 @@
    private HomeHandle homeHandle;
    private EJBMetaData ejbMetaData;
 
-   public StatefulHomeRemoteProxy(Object containerId, Interceptor[] interceptors, InvokerLocator uri)
+   public StatefulHomeRemoteProxy(Container container, Interceptor[] interceptors, InvokerLocator uri)
    {
-      super(containerId, interceptors);
+      super(container, interceptors);
       this.uri = uri;
    }
 
-   public StatefulHomeRemoteProxy(Object containerId, Interceptor[] interceptors, InvokerLocator uri, Object id)
+   public StatefulHomeRemoteProxy(Container container, Interceptor[] interceptors, InvokerLocator uri, Object id)
    {
-      super(containerId, interceptors);
+      super(container, interceptors);
       this.uri = uri;
       this.id = id;
    }
@@ -104,7 +106,8 @@
       sri.getMetaData().addMetaData(Dispatcher.DISPATCHER, Dispatcher.OID, containerId, PayloadKey.AS_IS);
       sri.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.INVOKER_LOCATOR, uri, PayloadKey.AS_IS);
       sri.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.SUBSYSTEM, "AOP", PayloadKey.AS_IS);
-
+      sri.getMetaData().addMetaData(IsLocalInterceptor.IS_LOCAL, IsLocalInterceptor.GUID, containerGuid, PayloadKey.AS_IS);
+      
       return sri.invokeNext();
    }
 

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalHomeProxy.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalHomeProxy.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalHomeProxy.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -47,7 +47,7 @@
    public Object invoke(Object proxy, Method method, Object[] args)
            throws Throwable
    {
-      StatefulContainer sfsb = (StatefulContainer) container;
+      StatefulContainer sfsb = (StatefulContainer) getContainer();
       return sfsb.localHomeInvoke(method, args);
    }
 
@@ -58,7 +58,7 @@
 
    public String toString()
    {
-      return container.getObjectName().getCanonicalName() + ": Home Proxy";
+      return proxyName + ": Home Proxy";
    }
 
 }

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxy.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxy.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxy.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -27,6 +27,9 @@
 import java.io.ObjectInput;
 import java.io.IOException;
 import java.io.ObjectOutput;
+
+import javax.ejb.EJBException;
+
 import org.jboss.aspects.asynch.AsynchMixin;
 import org.jboss.aspects.asynch.AsynchProvider;
 import org.jboss.aspects.asynch.FutureHolder;
@@ -90,13 +93,17 @@
       }
 
       //Make sure we get the cache id before getting the asynchronous interface
-      StatefulContainer sfsb = (StatefulContainer) getContainer();
       Object ret = ProxyUtils.handleCallLocally(proxy, this, method, args);
       if (ret != null)
       {
          return ret;
       }
+      
+      if (getContainer() == null)
+         throw new EJBException("Invalid (i.e. remote) invocation of local interface (null container)");
 
+      StatefulContainer sfsb = (StatefulContainer) getContainer();
+      
       return sfsb.localInvoke(id, method, args, (FutureHolder) provider);
    }
 
@@ -117,16 +124,12 @@
 
    public String toString()
    {
-      if (id != null)
+      if (getContainer() != null && id != null)
       {
          return getContainer().getEjbName().toString() + ":" + id.toString();
       }
-      else
-      {
-         //If the proxy has not been used yet, create a temporary id 
-         GUID guid = new GUID();
-         return getContainer().getEjbName().toString() + ":" + guid.toString();
-      }
+
+      return proxyName;
    }
 
 }

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxy.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxy.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxy.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -33,8 +33,11 @@
 import org.jboss.aspects.asynch.AsynchMixin;
 import org.jboss.aspects.asynch.AsynchProvider;
 import org.jboss.aspects.remoting.InvokeRemoteInterceptor;
+import org.jboss.ejb3.Container;
+import org.jboss.ejb3.Ejb3Registry;
 import org.jboss.ejb3.ProxyUtils;
 import org.jboss.ejb3.asynchronous.AsynchronousInterceptor;
+import org.jboss.ejb3.remoting.IsLocalInterceptor;
 import org.jboss.logging.Logger;
 import org.jboss.remoting.InvokerLocator;
 import org.jboss.util.id.GUID;
@@ -58,22 +61,22 @@
    private HomeHandle homeHandle;
    private EJBMetaData ejbMetaData;
 
-   public StatefulRemoteProxy(Object containerId, Interceptor[] interceptors, InvokerLocator uri)
+   public StatefulRemoteProxy(Container container, Interceptor[] interceptors, InvokerLocator uri)
    {
-      super(containerId, interceptors);
+      super(container, interceptors);
       this.uri = uri;
    }
 
-   public StatefulRemoteProxy(Object containerId, Interceptor[] interceptors, InvokerLocator uri, Object id)
+   public StatefulRemoteProxy(Container container, Interceptor[] interceptors, InvokerLocator uri, Object id)
    {
-      super(containerId, interceptors);
+      super(container, interceptors);
       this.uri = uri;
       this.id = id;
    }
 
-   public StatefulRemoteProxy(AsynchProvider provider, Object containerId, Interceptor[] interceptors, InvokerLocator uri)
+   public StatefulRemoteProxy(AsynchProvider provider, String containerId, String containerGuid, Interceptor[] interceptors, InvokerLocator uri)
    {
-      super(containerId, interceptors);
+      super(containerId, containerGuid, interceptors);
       this.uri = uri;
       this.provider = provider;
    }
@@ -125,7 +128,8 @@
       sri.getMetaData().addMetaData(Dispatcher.DISPATCHER, Dispatcher.OID, containerId, PayloadKey.AS_IS);
       sri.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.INVOKER_LOCATOR, uri, PayloadKey.AS_IS);
       sri.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.SUBSYSTEM, "AOP", PayloadKey.AS_IS);
-
+      sri.getMetaData().addMetaData(IsLocalInterceptor.IS_LOCAL, IsLocalInterceptor.GUID, containerGuid, PayloadKey.AS_IS);
+      
       if (provider != null)
       {
          sri.getMetaData().addMetaData(AsynchronousInterceptor.ASYNCH, AsynchronousInterceptor.INVOKE_ASYNCH, "YES", PayloadKey.AS_IS);
@@ -157,7 +161,7 @@
          Class[] interfaces = ProxyUtils.addAsynchProviderInterface(infs);
          AsynchMixin mixin = new AsynchMixin();
          Interceptor[] newInterceptors = ProxyUtils.addAsynchProxyInterceptor(mixin, interceptors);
-         StatefulRemoteProxy handler = new StatefulRemoteProxy(mixin, containerId, newInterceptors, uri);
+         StatefulRemoteProxy handler = new StatefulRemoteProxy(mixin, containerId, containerGuid, newInterceptors, uri);
          return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaces, handler);
       }
 

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-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -166,7 +166,7 @@
          }
          AdviceStack stack = AspectManager.instance().getAdviceStack(stackName);
          if (stack == null) throw new RuntimeException("unable to find interceptor stack: " + stackName);
-         StatefulHomeRemoteProxy proxy = new StatefulHomeRemoteProxy(containerId, stack.createInterceptors((Advisor) container, null), locator);
+         StatefulHomeRemoteProxy proxy = new StatefulHomeRemoteProxy(container, stack.createInterceptors((Advisor) container, null), locator);
 
 
          setEjb21Objects(proxy);
@@ -182,7 +182,6 @@
    {
       try
       {
-         Object containerId = container.getObjectName().getCanonicalName();
          String stackName = "StatefulSessionClientInterceptors";
          if (binding.interceptorStack() != null && !binding.interceptorStack().equals(""))
          {
@@ -190,7 +189,7 @@
          }
          AdviceStack stack = AspectManager.instance().getAdviceStack(stackName);
          if (stack == null) throw new RuntimeException("unable to find interceptor stack: " + stackName);
-         StatefulRemoteProxy proxy = new StatefulRemoteProxy(containerId, stack.createInterceptors((Advisor) container, null), locator);
+         StatefulRemoteProxy proxy = new StatefulRemoteProxy(container, stack.createInterceptors((Advisor) container, null), locator);
 
 
          setEjb21Objects(proxy);
@@ -229,14 +228,13 @@
    {
       try
       {
-         Object containerId = container.getObjectName().getCanonicalName();
          String stackName = "StatefulSessionClientInterceptors";
          if (binding.interceptorStack() != null && !binding.interceptorStack().equals(""))
          {
             stackName = binding.interceptorStack();
          }
          AdviceStack stack = AspectManager.instance().getAdviceStack(stackName);
-         StatefulRemoteProxy proxy = new StatefulRemoteProxy(containerId, stack.createInterceptors((Advisor) container, null), locator, id);
+         StatefulRemoteProxy proxy = new StatefulRemoteProxy(container, stack.createInterceptors((Advisor) container, null), locator, id);
          setEjb21Objects(proxy);
          Object[] args = {proxy};
          return proxyConstructor.newInstance(args);

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessClusterProxyFactory.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessClusterProxyFactory.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessClusterProxyFactory.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -123,7 +123,6 @@
    {
 //      try
       {
-         Object containerId = container.getObjectName().getCanonicalName();
          String stackName = "ClusteredStatelessSessionClientInterceptors";
          if (binding.interceptorStack() != null && !binding.interceptorStack().equals(""))
          {
@@ -136,7 +135,7 @@
          */
          String partitionName = ((StatelessContainer) container).getPartitionName();
          
-         proxy = constructProxy(new StatelessClusteredProxy(containerId, stack.createInterceptors((Advisor) container, null), 
+         proxy = constructProxy(new StatelessClusteredProxy(container, stack.createInterceptors((Advisor) container, null), 
                                                             wrapper, lbPolicy, partitionName));
          return proxy;
       }

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessClusteredProxy.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessClusteredProxy.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessClusteredProxy.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -33,11 +33,14 @@
 import org.jboss.aspects.remoting.ClusterConstants;
 import org.jboss.aspects.remoting.FamilyWrapper;
 import org.jboss.aspects.remoting.InvokeRemoteInterceptor;
+import org.jboss.ejb3.Container;
+import org.jboss.ejb3.Ejb3Registry;
 import org.jboss.ejb3.JBossProxy;
 import org.jboss.ejb3.ProxyUtils;
 import org.jboss.ejb3.asynchronous.AsynchronousInterceptor;
 import org.jboss.ejb3.remoting.BaseRemoteProxy;
 import org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor;
+import org.jboss.ejb3.remoting.IsLocalInterceptor;
 import org.jboss.ha.framework.interfaces.LoadBalancePolicy;
 
 /**
@@ -56,18 +59,21 @@
    AsynchProvider provider;
    protected String partitionName;
 
-   public StatelessClusteredProxy(Object containerId, Interceptor[] interceptors, FamilyWrapper family, LoadBalancePolicy lbPolicy, String partitionName)
+   public StatelessClusteredProxy(Container container, Interceptor[] interceptors, FamilyWrapper family, LoadBalancePolicy lbPolicy, String partitionName)
    {
-      super(containerId, interceptors);
+      super(container, interceptors);
       this.family = family;
       this.lbPolicy = lbPolicy;
       this.partitionName = partitionName;
    }
 
-   public StatelessClusteredProxy(AsynchProvider provider, Object containerId, Interceptor[] interceptors, FamilyWrapper family, LoadBalancePolicy lbPolicy, String partitionName)
+   public StatelessClusteredProxy(AsynchProvider provider, String containerId, String containerGuid, Interceptor[] interceptors, FamilyWrapper family, LoadBalancePolicy lbPolicy, String partitionName)
    {
-      this(containerId, interceptors, family, lbPolicy, partitionName);
+      super(containerId, containerGuid, interceptors);
       this.provider = provider;
+      this.family = family;
+      this.lbPolicy = lbPolicy;
+      this.partitionName = partitionName;
    }
 
    public StatelessClusteredProxy()
@@ -97,7 +103,8 @@
       sri.getMetaData().addMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.LOADBALANCE_POLICY, lbPolicy, PayloadKey.AS_IS);
       sri.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.SUBSYSTEM, "AOP", PayloadKey.AS_IS);
       sri.getMetaData().addMetaData(ClusteredIsLocalInterceptor.PARTITION_NAME, ClusteredIsLocalInterceptor.PARTITION_NAME, partitionName, PayloadKey.TRANSIENT);
-
+      sri.getMetaData().addMetaData(IsLocalInterceptor.IS_LOCAL, IsLocalInterceptor.GUID, containerGuid, PayloadKey.AS_IS);
+      
       if (provider != null)
       {
          sri.getMetaData().addMetaData(AsynchronousInterceptor.ASYNCH, AsynchronousInterceptor.INVOKE_ASYNCH, "YES", PayloadKey.AS_IS);
@@ -113,7 +120,7 @@
          Class[] interfaces = ProxyUtils.addAsynchProviderInterface(infs);
          AsynchMixin mixin = new AsynchMixin();
          Interceptor[] newInterceptors = ProxyUtils.addAsynchProxyInterceptor(mixin, interceptors);
-         StatelessClusteredProxy handler = new StatelessClusteredProxy(mixin, containerId, newInterceptors, family, lbPolicy, partitionName);
+         StatelessClusteredProxy handler = new StatelessClusteredProxy(mixin, containerId, containerGuid, newInterceptors, family, lbPolicy, partitionName);
          return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaces, handler);
       }
 

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessContainer.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessContainer.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessContainer.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -93,7 +93,7 @@
       {
          super.start();
          
-         timerService = TimerServiceFactory.getInstance().createTimerService(this.getObjectName(), this);
+         timerService = TimerServiceFactory.getInstance().createTimerService(this, this);
          
          TimerServiceFactory.getInstance().restoreTimerService(timerService);
       }

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxy.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxy.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxy.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -31,6 +31,7 @@
 import org.jboss.ejb3.Container;
 import org.jboss.ejb3.LocalProxy;
 import org.jboss.ejb3.ProxyUtils;
+import org.jboss.logging.Logger;
 
 /**
  * Comment
@@ -42,6 +43,8 @@
 {
    private static final long serialVersionUID = -3241008127518089831L;
    
+   private static final Logger log = Logger.getLogger(StatelessLocalProxy.class);
+   
    AsynchProvider provider;
 
    public StatelessLocalProxy()
@@ -72,11 +75,11 @@
       {
          return ret;
       }
-      
-      if (container == null)
-         throw new EJBException("Invalid invocation of local interface (null container)");
+       
+      if (getContainer() == null)
+         throw new EJBException("Invalid (i.e. remote) invocation of local interface (null container)");
 
-      StatelessContainer stateless = (StatelessContainer) container;
+      StatelessContainer stateless = (StatelessContainer) getContainer();
 
       return stateless.localInvoke(method, args, (FutureHolder) provider);
    }
@@ -88,31 +91,19 @@
       {
          Class[] interfaces = ProxyUtils.addAsynchProviderInterface(infs);
          AsynchMixin mixin = new AsynchMixin();
-         StatelessLocalProxy handler = new StatelessLocalProxy(mixin, container);
+         StatelessLocalProxy handler = new StatelessLocalProxy(mixin, getContainer());
          return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaces, handler);
       }
 
       //I was already asynchronous
       return proxy;
    }
-/*
-   @Override
-   public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
-   {
-      super.readExternal(in);
-      provider = (AsynchProvider)in.readObject();
-   }
 
-   @Override
-   public void writeExternal(ObjectOutput out) throws IOException
-   {
-      super.writeExternal(out);
-      out.writeObject(provider);
-   }
-*/
-
    public String toString()
    {
-      return container.getEjbName().toString();
+      if (getContainer() == null)
+         return proxyName;
+      else
+         return getContainer().getEjbName();
    }
 }

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxy.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxy.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxy.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -31,8 +31,11 @@
 import org.jboss.aspects.asynch.AsynchMixin;
 import org.jboss.aspects.asynch.AsynchProvider;
 import org.jboss.aspects.remoting.InvokeRemoteInterceptor;
+import org.jboss.ejb3.Container;
+import org.jboss.ejb3.Ejb3Registry;
 import org.jboss.ejb3.ProxyUtils;
 import org.jboss.ejb3.asynchronous.AsynchronousInterceptor;
+import org.jboss.ejb3.remoting.IsLocalInterceptor;
 import org.jboss.logging.Logger;
 import org.jboss.remoting.InvokerLocator;
 
@@ -50,15 +53,15 @@
    protected InvokerLocator uri;
    AsynchProvider provider;
 
-   public StatelessRemoteProxy(Object containerId, Interceptor[] interceptors, InvokerLocator uri)
+   public StatelessRemoteProxy(Container container, Interceptor[] interceptors, InvokerLocator uri)
    {
-      super(containerId, interceptors);
+      super(container, interceptors);
       this.uri = uri;
    }
 
-   public StatelessRemoteProxy(AsynchProvider provider, Object containerId, Interceptor[] interceptors, InvokerLocator uri)
+   public StatelessRemoteProxy(AsynchProvider provider, String containerId, String containerGuid, Interceptor[] interceptors, InvokerLocator uri)
    {
-      super(containerId, interceptors);
+      super(containerId, containerGuid, interceptors);
       this.uri = uri;
       this.provider = provider;
    }
@@ -95,6 +98,7 @@
       sri.getMetaData().addMetaData(Dispatcher.DISPATCHER, Dispatcher.OID, containerId, PayloadKey.AS_IS);
       sri.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.INVOKER_LOCATOR, uri, PayloadKey.AS_IS);
       sri.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.SUBSYSTEM, "AOP", PayloadKey.AS_IS);
+      sri.getMetaData().addMetaData(IsLocalInterceptor.IS_LOCAL, IsLocalInterceptor.GUID, containerGuid, PayloadKey.AS_IS);
 
       if (provider != null)
       {
@@ -111,7 +115,7 @@
          Class[] interfaces = ProxyUtils.addAsynchProviderInterface(infs);
          AsynchMixin mixin = new AsynchMixin();
          Interceptor[] newInterceptors = ProxyUtils.addAsynchProxyInterceptor(mixin, interceptors);
-         StatelessRemoteProxy handler = new StatelessRemoteProxy(mixin, containerId, newInterceptors, uri);
+         StatelessRemoteProxy handler = new StatelessRemoteProxy(mixin, containerId, containerGuid, newInterceptors, uri);
          return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaces, handler);
       }
 

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -156,9 +156,7 @@
 
    public Object createHomeProxy(Class homeInterface)
    {
-      try {
-         Object containerId = container.getObjectName().getCanonicalName();
-         ;
+      try {     
          String stackName = "StatelessSessionClientInterceptors";
          if (binding.interceptorStack() != null
                && !binding.interceptorStack().equals(""))
@@ -166,7 +164,7 @@
             stackName = binding.interceptorStack();
          }
          AdviceStack stack = AspectManager.instance().getAdviceStack(stackName);
-         StatelessRemoteProxy proxy = new StatelessRemoteProxy(containerId,
+         StatelessRemoteProxy proxy = new StatelessRemoteProxy(container,
                stack.createInterceptors((Advisor) container, null), locator);
          setEjb21Objects(proxy);
          Class[] interfaces = { homeInterface };
@@ -183,8 +181,6 @@
    {
       // try
       {
-         Object containerId = container.getObjectName().getCanonicalName();
-         ;
          String stackName = "StatelessSessionClientInterceptors";
          if (binding.interceptorStack() != null
                && !binding.interceptorStack().equals(""))
@@ -192,7 +188,7 @@
             stackName = binding.interceptorStack();
          }
          AdviceStack stack = AspectManager.instance().getAdviceStack(stackName);
-         StatelessRemoteProxy proxy = new StatelessRemoteProxy(containerId,
+         StatelessRemoteProxy proxy = new StatelessRemoteProxy(container,
                stack.createInterceptors((Advisor) container, null), locator);
          setEjb21Objects(proxy);
          /*

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/TimerServiceFactory.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/TimerServiceFactory.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/TimerServiceFactory.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -25,6 +25,8 @@
 import javax.ejb.TimerService;
 import javax.management.ObjectName;
 
+import org.jboss.ejb3.Container;
+
 /**
  * Comment
  *
@@ -64,7 +66,7 @@
       }
    }
    
-   public abstract TimerService createTimerService(ObjectName objectName, TimedObjectInvoker invoker);
+   public abstract TimerService createTimerService(Container container, TimedObjectInvoker invoker);
    
    public static TimerServiceFactory getInstance()
    {

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/jboss/JBossTimerServiceFactory.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/jboss/JBossTimerServiceFactory.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/jboss/JBossTimerServiceFactory.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -25,6 +25,8 @@
 import javax.management.ObjectName;
 
 import org.jboss.ejb.txtimer.EJBTimerService;
+import org.jboss.ejb3.Container;
+import org.jboss.ejb3.Ejb3Registry;
 import org.jboss.ejb3.EJBContainer;
 import org.jboss.ejb3.timerservice.TimedObjectInvoker;
 import org.jboss.ejb3.timerservice.TimerServiceFactory;
@@ -46,14 +48,14 @@
     * @see org.jboss.ejb3.timerservice.TimerServiceFactory#createTimerService(javax.management.ObjectName, org.jboss.ejb3.timerservice.TimedObjectInvoker)
     */
    @Override
-   public TimerService createTimerService(ObjectName containerId, TimedObjectInvoker invoker)
+   public TimerService createTimerService(Container container, TimedObjectInvoker invoker)
    {
       TimerService timerService = null;
       try
       {
          EJBTimerService service = getEJBTimerService();
-         TimerService delegate = service.createTimerService(containerId, null, invoker);
-         timerService = new TimerServiceFacade(containerId, delegate);
+         TimerService delegate = service.createTimerService(container.getObjectName(), null, invoker);
+         timerService = new TimerServiceFacade(container, delegate);
       }
       catch (Exception e)
       {

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/jboss/TimerServiceFacade.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/jboss/TimerServiceFacade.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/jboss/TimerServiceFacade.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -30,8 +30,8 @@
 import javax.ejb.TimerService;
 import javax.management.ObjectName;
 
+import org.jboss.ejb3.Container;
 import org.jboss.ejb3.EJBContainer;
-import org.jboss.ejb3.Ejb3Registry;
 
 /**
  * Comment
@@ -43,11 +43,11 @@
 {
    private TimerService delegate;
    
-   private ObjectName containerId;
+   private Container container;
    
-   protected TimerServiceFacade(ObjectName containerId, TimerService delegate)
+   protected TimerServiceFacade(Container container, TimerService delegate)
    {
-      this.containerId = containerId;
+      this.container = container;
       this.delegate = delegate;
    }
 
@@ -73,12 +73,12 @@
 
    protected EJBContainer getContainer()
    {
-      return (EJBContainer) Ejb3Registry.getContainer(getContainerId().getCanonicalName());
+      return (EJBContainer) container;
    }
    
    protected ObjectName getContainerId()
    {
-      return containerId;
+      return container.getObjectName();
    }
    
    public Collection getTimers() throws IllegalStateException, EJBException

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/quartz/QuartzTimerServiceFactory.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/quartz/QuartzTimerServiceFactory.java	2007-07-24 21:13:43 UTC (rev 64261)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/timerservice/quartz/QuartzTimerServiceFactory.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -37,6 +37,7 @@
 import javax.transaction.SystemException;
 import javax.transaction.TransactionManager;
 
+import org.jboss.ejb3.Container;
 import org.jboss.ejb3.InitialContextFactory;
 import org.jboss.ejb3.timerservice.TimedObjectInvoker;
 import org.jboss.ejb3.timerservice.TimerServiceFactory;
@@ -153,12 +154,12 @@
     * @param invoker    the invoker to call on timeouts
     * @return           an EJB TimerService
     */
-   public TimerService createTimerService(ObjectName objectName, TimedObjectInvoker invoker)
+   public TimerService createTimerService(Container container, TimedObjectInvoker invoker)
    {
       Scheduler scheduler = getScheduler();
       if (scheduler == null) return null;
       
-      return new TimerServiceImpl(scheduler, objectName, invoker);
+      return new TimerServiceImpl(scheduler, container.getObjectName(), invoker);
    }
    
    private boolean execute(Connection conn, String stmtName) throws SQLException

Added: branches/Branch_4_2/ejb3/src/resources/test/localfromremote/jndi1.properties
===================================================================
--- branches/Branch_4_2/ejb3/src/resources/test/localfromremote/jndi1.properties	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/resources/test/localfromremote/jndi1.properties	2007-07-24 21:59:08 UTC (rev 64262)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+java.naming.provider.url=jnp://localhost:1199
\ No newline at end of file

Added: branches/Branch_4_2/ejb3/src/resources/test/localfromremote/jndi2.properties
===================================================================
--- branches/Branch_4_2/ejb3/src/resources/test/localfromremote/jndi2.properties	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/resources/test/localfromremote/jndi2.properties	2007-07-24 21:59:08 UTC (rev 64262)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+java.naming.provider.url=jnp://localhost:1099
\ No newline at end of file

Added: branches/Branch_4_2/ejb3/src/resources/test-configs/localfromremote2/conf/jboss-service.xml
===================================================================
--- branches/Branch_4_2/ejb3/src/resources/test-configs/localfromremote2/conf/jboss-service.xml	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/resources/test-configs/localfromremote2/conf/jboss-service.xml	2007-07-24 21:59:08 UTC (rev 64262)
@@ -0,0 +1,695 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id: jboss-service.xml 62434 2007-04-19 21:22:50Z dimitris at jboss.org $ -->
+
+<!-- ===================================================================== -->
+<!--  JBoss Server Configuration                                           -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <!-- Load all jars from the JBOSS_DIST/server/<config>/lib directory. This
+     can be restricted to specific jars by specifying them in the archives
+     attribute.
+    -->
+   <classpath codebase="${jboss.server.lib.url:lib}" archives="*"/>
+
+   <!-- ==================================================================== -->
+   <!-- JSR-77 Single JBoss Server Management Domain                         -->
+   <!-- ==================================================================== -->
+   <mbean code="org.jboss.management.j2ee.LocalJBossServerDomain"
+      name="jboss.management.local:j2eeType=J2EEDomain,name=Manager">
+      <attribute name="MainDeployer">jboss.system:service=MainDeployer</attribute>
+      <attribute name="SARDeployer">jboss.system:service=ServiceDeployer</attribute>
+      <attribute name="EARDeployer">jboss.j2ee:service=EARDeployer</attribute>
+      <attribute name="EJBDeployer">jboss.ejb:service=EJBDeployer</attribute>
+      <attribute name="RARDeployer">jboss.jca:service=RARDeployer</attribute>
+      <attribute name="CMDeployer">jboss.jca:service=ConnectionFactoryDeployer</attribute>
+      <attribute name="WARDeployer">jboss.web:service=WebServer</attribute>
+      <attribute name="CARDeployer">jboss.j2ee:service=ClientDeployer</attribute>
+      <attribute name="MailService">jboss:service=Mail</attribute>
+      <attribute name="JMSService">jboss.mq:service=DestinationManager</attribute>
+      <attribute name="JNDIService">jboss:service=Naming</attribute>
+      <attribute name="JTAService">jboss:service=TransactionManager</attribute>
+      <attribute name="UserTransactionService">jboss:service=ClientUserTransaction</attribute>
+      <attribute name="RMI_IIOPService">jboss:service=CorbaORB</attribute>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- XMBean Persistence                                                   -->
+   <!-- ==================================================================== -->
+   <mbean code="org.jboss.system.pm.AttributePersistenceService"
+      name="jboss:service=AttributePersistenceService"
+      xmbean-dd="resource:xmdesc/AttributePersistenceService-xmbean.xml">
+      <!-- the AttributePersistenceService is persistent, itself -->
+
+      <!--
+      <attribute name="AttributePersistenceManagerClass">org.jboss.system.pm.XMLAttributePersistenceManager</attribute>
+      <attribute name="AttributePersistenceManagerConfig">
+         <data-directory>data/xmbean-attrs</data-directory>
+      </attribute>
+      <attribute name="ApmDestroyOnServiceStop">false</attribute>
+      <attribute name="VersionTag"></attribute>
+      -->
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Thread Pool                                                          -->
+   <!-- ==================================================================== -->
+   
+   <!-- A Thread pool service -->
+   <mbean code="org.jboss.util.threadpool.BasicThreadPool"
+      name="jboss.system:service=ThreadPool">
+      <attribute name="Name">JBoss System Threads</attribute>
+      <attribute name="ThreadGroupName">System Threads</attribute>
+      <!-- How long a thread will live without any tasks in MS -->
+      <attribute name="KeepAliveTime">60000</attribute>
+      <!-- The max number of threads in the pool -->
+      <attribute name="MaximumPoolSize">10</attribute>
+      <!-- The max number of tasks before the queue is full -->
+      <attribute name="MaximumQueueSize">1000</attribute>
+      <!-- The behavior of the pool when a task is added and the queue is full.
+      abort - a RuntimeException is thrown
+      run - the calling thread executes the task
+      wait - the calling thread blocks until the queue has room
+      discard - the task is silently discarded without being run
+      discardOldest - check to see if a task is about to complete and enque
+         the new task if possible, else run the task in the calling thread
+      -->
+      <attribute name="BlockingMode">run</attribute>
+   </mbean>
+
+   <!-- Preload all custom editors for VMs that don't use the thread
+        context class loader when searching for PropertyEditors. Uncomment
+        if your JDK 1.3.0 VM fails to find JBoss PropertyEditors.
+   <mbean code="org.jboss.varia.property.PropertyEditorManagerService"
+     name="jboss:type=Service,name=BootstrapEditors">
+     <attribute name="BootstrapEditors">
+       java.math.BigDecimal=org.jboss.util.propertyeditor.BigDecimalEditor
+       java.lang.Boolean=org.jboss.util.propertyeditor.BooleanEditor
+       java.lang.Class=org.jboss.util.propertyeditor.ClassEditor
+       java.util.Date=org.jboss.util.propertyeditor.DateEditor
+       java.io.File=org.jboss.util.propertyeditor.FileEditor
+       java.net.InetAddress=org.jboss.util.propertyeditor.InetAddressEditor
+       java.lang.Integer=org.jboss.util.propertyeditor.IntegerEditor
+       javax.management.ObjectName=org.jboss.mx.util.propertyeditor.ObjectNameEditor
+       java.util.Properties=org.jboss.util.propertyeditor.PropertiesEditor
+       [Ljava.lang.String;=org.jboss.util.propertyeditor.StringArrayEditor
+       java.net.URL=org.jboss.util.propertyeditor.URLEditor
+     </attribute>
+   </mbean>
+   -->
+
+   <!-- ==================================================================== -->
+   <!-- Log4j Initialization                                                 -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.logging.Log4jService"
+      name="jboss.system:type=Log4jService,service=Logging"
+	  xmbean-dd="resource:xmdesc/Log4jService-xmbean.xml">
+      <attribute name="ConfigurationURL">resource:jboss-log4j.xml</attribute>
+      <!-- Set the org.apache.log4j.helpers.LogLog.setQuiteMode. As of log4j1.2.8
+      this needs to be set to avoid a possible deadlock on exception at the
+      appender level. See bug#696819.
+      -->
+      <attribute name="Log4jQuietMode">true</attribute>
+      <!-- How frequently in seconds the ConfigurationURL is checked for changes -->
+      <attribute name="RefreshPeriod">60</attribute>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Active Alarm Table                                                   -->
+   <!-- ==================================================================== -->
+
+   <!--
+      | The ActiveAlarmTable service is a simple JMX notification listener
+      | that maintains a table with the received notifications (alarms).
+      | The alarms can be acknowledged through the jmx or the web console.
+      | Modify the SubscriptionList below to subscribe for any notification
+      | in the system and treat it as an alarm.
+      | The JMXNotificationAppender is a log4j Appender that can be configured
+      | in log4j.xml, that trasforms logging events to JMX notification so they
+      | can be fed back into the table. By storing the WARN or higher level logging
+      | events you can have a quick view of important system faults.
+      |
+      | The following attributes may be set:
+      |
+      | MaxTableSize (default 1000)
+      |  - set an upper limit to the number of stored alarms
+      | LogLevel (default DEBUG)
+      |  - the log level to use for received notification, can be set to NONE
+      | ServerId (default jboss)
+      |  - used to construct unique alarm ids
+      | SubscriptionList
+      |  - subscribe for the notifications to be stored in the table
+
+   <mbean code="org.jboss.monitor.services.ActiveAlarmTable"
+          name="jboss.monitor:service=ActiveAlarmTable">
+      <attribute name="SubscriptionList">
+         <subscription-list>
+            <mbean name="jboss.monitor:*">
+               <notification type="jboss.alarm"/>
+               <notification type="JBOSS_MONITOR_NOTIFICATION"/>
+            </mbean>
+            <mbean name="jboss.system:service=Logging,type=JMXNotificationAppender"/>
+         </subscription-list>
+      </attribute>
+   </mbean>
+   -->
+
+   <!-- ==================================================================== -->
+   <!-- JBoss RMI Classloader - only install when available                  -->
+   <!-- ==================================================================== -->
+   <mbean code="org.jboss.util.property.jmx.SystemPropertyClassValue"
+      name="jboss.rmi:type=RMIClassLoader">
+      <attribute name="Property">java.rmi.server.RMIClassLoaderSpi</attribute>
+      <attribute name="ClassName">org.jboss.system.JBossRMIClassLoader</attribute>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Service Binding                                                      -->
+   <!-- ==================================================================== -->
+
+   <!-- Automatically activated when generatting the clustering environment -->
+   <!-- @TESTSUITE_CLUSTER_CONFIG@ -->
+
+   <!--
+      | Binding service manager for port/host mapping. This is a sample
+      | config that demonstrates a JBoss instances with a server name 'ports-01'
+      | loading its bindings from an XML file using the ServicesStoreFactory
+      | implementation returned by the XMLServicesStoreFactory.
+      |
+      | ServerName: The unique name assigned to a JBoss server instance for
+      | lookup purposes. This allows a single ServicesStore to handle mulitiple
+      | JBoss servers.
+      |
+      | StoreURL: The URL string passed to org.jboss.services.binding.ServicesStore
+      | during initialization that specifies how to connect to the bindings store.
+      | StoreFactory: The org.jboss.services.binding.ServicesStoreFactory interface
+      | implementation to create to obtain the ServicesStore instance.
+   -->
+   <mbean code="org.jboss.services.binding.ServiceBindingManager"
+     name="jboss.system:service=ServiceBindingManager">
+     <attribute name="ServerName">ports-01</attribute>
+     <attribute name="StoreURL">${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
+     <attribute name="StoreFactoryClassName">
+       org.jboss.services.binding.XMLServicesStoreFactory
+     </attribute>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Class Loading                                                        -->
+   <!-- ==================================================================== -->
+
+   <!-- A mini webserver used for dynamic and class and resource loading --> 
+   <mbean code="org.jboss.web.WebService"
+      name="jboss:service=WebService">
+      <!-- The Bind address and Port -->
+      <attribute name="BindAddress">${jboss.bind.address}</attribute>      
+      <attribute name="Port">8083</attribute>
+      <!--  The address to use for the host portion of the RMI codebase URL -->
+      <attribute name="Host">${java.rmi.server.hostname}</attribute>
+      <!-- Should non-EJB .class files be downloadable -->
+      <attribute name="DownloadServerClasses">true</attribute>
+      <!-- Should resources other than .class files be downloadable. Both
+         DownloadServerClasses and DownloadResources must be true for resources
+         to be downloadable. This is false by default because its generally a
+         bad idea as server configuration files that container security
+         information can be accessed.
+       -->
+      <attribute name="DownloadResources">false</attribute>
+
+      <!-- Use the default thread pool for dynamic class loading -->
+      <depends optional-attribute-name="ThreadPool"
+         proxy-type="attribute">jboss.system:service=ThreadPool</depends>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- JNDI                                                                 -->
+   <!-- ==================================================================== -->
+
+   <!-- A simple mbean wrapper around the jndi Naming object. This
+   only handles an in memory instance. The NamingService uses this
+   as the JNDI store and exposes it remotely.
+   -->
+   <mbean code="org.jnp.server.NamingBeanImpl"
+      name="jboss:service=NamingBeanImpl"
+      xmbean-dd="resource:xmdesc/NamingBean-xmbean.xml">
+   </mbean>
+   
+   <mbean code="org.jboss.naming.NamingService"
+      name="jboss:service=Naming"
+      xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
+      <!-- The call by value mode. true if all lookups are unmarshalled using
+         the caller's TCL, false if in VM lookups return the value by reference.
+      -->
+      <attribute name="CallByValue">false</attribute>
+      <!-- The listening port for the bootstrap JNP service. Set this to -1
+         to run the NamingService without the JNP invoker listening port.
+      -->
+      <attribute name="Port">1099</attribute>
+      <!-- The bootstrap JNP server bind address. This also sets the default
+         RMI service bind address. Empty == all addresses
+      -->
+      <attribute name="BindAddress">${jboss.bind.address}</attribute>
+      <!-- The port of the RMI naming service, 0 == anonymous -->
+      <attribute name="RmiPort">1098</attribute>
+      <!-- The RMI service bind address. Empty == all addresses
+      -->
+      <attribute name="RmiBindAddress">${jboss.bind.address}</attribute>
+      <!-- The thread pool service used to control the bootstrap lookups -->
+      <depends optional-attribute-name="LookupPool"
+         proxy-type="attribute">jboss.system:service=ThreadPool</depends>
+      <!-- An example of using the unifed invoker as the transport.
+         <depends optional-attribute-name="InvokerProxyFactory"
+         proxy-type="attribute">jboss:service=proxyFactory,type=unified,target=Naming</depends>
+      -->
+      <depends optional-attribute-name="Naming"
+         proxy-type="attribute">jboss:service=NamingBeanImpl</depends>
+   </mbean>
+   
+   <mbean code="org.jboss.naming.JNDIView"
+   	name="jboss:service=JNDIView"
+   	xmbean-dd="resource:xmdesc/JNDIView-xmbean.xml">
+   	<!-- The HANamingService service name -->
+   	<attribute name="HANamingService">jboss:service=HAJNDI</attribute>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Security                                                             -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.security.plugins.SecurityConfig"
+      name="jboss.security:service=SecurityConfig">
+      <attribute name="LoginConfig">jboss.security:service=XMLLoginConfig</attribute>
+   </mbean>
+   <mbean code="org.jboss.security.auth.login.XMLLoginConfig"
+      name="jboss.security:service=XMLLoginConfig">
+      <attribute name="ConfigResource">login-config.xml</attribute>
+   </mbean>
+
+   <!-- JAAS security manager and realm mapping -->
+   <mbean code="org.jboss.security.plugins.JaasSecurityManagerService"
+      name="jboss.security:service=JaasSecurityManager">
+      <!-- A flag which indicates whether the SecurityAssociation server mode
+      is set on service creation. This is true by default since the
+      SecurityAssociation should be thread local for multi-threaded server
+      operation.
+      -->
+      <attribute name="ServerMode">true</attribute>
+      <attribute name="SecurityManagerClassName">org.jboss.security.plugins.JaasSecurityManager</attribute>
+      <attribute name="DefaultUnauthenticatedPrincipal">anonymous</attribute>
+      <!-- DefaultCacheTimeout: Specifies the default timed cache policy timeout
+      in seconds.
+      If you want to disable caching of security credentials, set this to 0 to
+      force authentication to occur every time. This has no affect if the
+      AuthenticationCacheJndiName has been changed from the default value.
+      -->
+      <attribute name="DefaultCacheTimeout">1800</attribute>
+      <!-- DefaultCacheResolution: Specifies the default timed cache policy
+      resolution in seconds. This controls the interval at which the cache
+      current timestamp is updated and should be less than the DefaultCacheTimeout
+      in order for the timeout to be meaningful. This has no affect if the
+      AuthenticationCacheJndiName has been changed from the default value.
+      -->
+      <attribute name="DefaultCacheResolution">60</attribute>
+      <!-- DeepCopySubjectMode: This set the copy mode of subjects done by the
+      security managers to be deep copies that makes copies of the subject
+      principals and credentials if they are cloneable. It should be set to
+      true if subject include mutable content that can be corrupted when
+      multiple threads have the same identity and cache flushes/logout clearing
+      the subject in one thread results in subject references affecting other
+      threads.
+      -->
+      <attribute name="DeepCopySubjectMode">false</attribute>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Transactions                                                         -->
+   <!-- ==================================================================== -->
+
+   <!-- The configurable Xid factory.  For use with Oracle, set pad to true -->
+   <mbean code="org.jboss.tm.XidFactory"
+      name="jboss:service=XidFactory">
+      <!--attribute name="Pad">true</attribute-->
+   </mbean>
+
+   <!--
+      | The fast in-memory transaction manager.
+      | Deprecated in JBossAS v4.2. Use JBossTS JTA instead.
+    - ->
+   <mbean code="org.jboss.tm.TransactionManagerService"
+      name="jboss:service=TransactionManager"
+      xmbean-dd="resource:xmdesc/TransactionManagerService-xmbean.xml">
+      <attribute name="TransactionTimeout">300</attribute>
+      <!- - set to false to disable transaction demarcation over IIOP - ->
+      <attribute name="GlobalIdsEnabled">true</attribute>
+      <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
+
+      <!- - Transaction Integrity Checking - ->
+      <!- - Force a rollback if another thread is associated with the transaction at commit - ->
+      <!- - <depends optional-attribute-name="TransactionIntegrityFactory"
+               proxy-type="org.jboss.tm.integrity.TransactionIntegrityFactory">
+         <mbean code="org.jboss.tm.integrity.FailIncompleteTransaction"
+                name="jboss:service=TransactionManager,plugin=TransactionIntegrity"/>
+      </depends> - ->
+   </mbean>
+   -->
+
+   <!-- JBoss Transactions JTA -->
+   <mbean code="com.arjuna.ats.jbossatx.jta.TransactionManagerService"
+      name="jboss:service=TransactionManager">
+      <attribute name="TransactionTimeout">300</attribute>
+      <attribute name="ObjectStoreDir">${jboss.server.data.dir}/tx-object-store</attribute> 
+   </mbean>
+
+   <!--
+      | UserTransaction support.
+    -->
+   <mbean code="org.jboss.tm.usertx.server.ClientUserTransactionService"
+      name="jboss:service=ClientUserTransaction"
+      xmbean-dd="resource:xmdesc/ClientUserTransaction-xmbean.xml">
+      <depends>
+         <mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+            name="jboss:service=proxyFactory,target=ClientUserTransactionFactory">
+            <attribute name="InvokerName">jboss:service=invoker,type=jrmp</attribute>
+            <attribute name="TargetName">jboss:service=ClientUserTransaction</attribute>
+            <attribute name="JndiName">UserTransactionSessionFactory</attribute>
+            <attribute name="ExportedInterface">org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory</attribute>
+            <attribute name="ClientInterceptors">
+               <interceptors>
+                  <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
+                  <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
+               </interceptors>
+            </attribute>
+            <depends>jboss:service=invoker,type=jrmp</depends>
+         </mbean>
+      </depends>
+      <depends optional-attribute-name="TxProxyName">
+         <mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+            name="jboss:service=proxyFactory,target=ClientUserTransaction">
+            <attribute name="InvokerName">jboss:service=invoker,type=jrmp</attribute>
+            <attribute name="TargetName">jboss:service=ClientUserTransaction</attribute>
+            <attribute name="JndiName"></attribute>
+            <attribute name="ExportedInterface">org.jboss.tm.usertx.interfaces.UserTransactionSession</attribute>
+            <attribute name="ClientInterceptors">
+               <interceptors>
+                  <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
+                  <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
+               </interceptors>
+            </attribute>
+            <depends>jboss:service=invoker,type=jrmp</depends>
+         </mbean>
+      </depends>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Invokers to the JMX node                                             -->
+   <!-- ==================================================================== -->
+
+   <!-- Unified invoker (based on remoting) -->
+   <mbean code="org.jboss.invocation.unified.server.UnifiedInvoker"
+      name="jboss:service=invoker,type=unified">
+      <!-- To turn on strict RMI exception propagation uncomment block below -->
+      <!-- This will cause the UnifiedInvokerProxy to wrap RemoteExceptions  -->
+      <!-- within a ServerException, otherwise will throw root exception     -->
+      <!-- (not RemoteException)                                             -->
+      <!-- <attribute name="StrictRMIException">true</attribute> -->
+      <depends>jboss:service=TransactionManager</depends>
+      <depends>jboss.remoting:service=Connector,transport=socket</depends>
+   </mbean>
+
+   <!-- RMI/JRMP invoker -->
+   <mbean code="org.jboss.invocation.jrmp.server.JRMPInvoker"
+      name="jboss:service=invoker,type=jrmp">
+      <attribute name="RMIObjectPort">4444</attribute>
+      <attribute name="ServerAddress">${jboss.bind.address}</attribute>
+      <!--
+      <attribute name="RMIClientSocketFactory">custom</attribute>
+      <attribute name="RMIServerSocketFactory">custom</attribute>
+      <attribute name="RMIServerSocketAddr">custom</attribute>
+      <attribute name="SecurityDomain">ssl-domain-name</attribute>
+      -->
+      <depends>jboss:service=TransactionManager</depends>
+   </mbean>
+
+   <mbean code="org.jboss.invocation.local.LocalInvoker"
+      name="jboss:service=invoker,type=local">
+
+      <depends>jboss:service=TransactionManager</depends>
+   </mbean>
+
+   <mbean code="org.jboss.invocation.pooled.server.PooledInvoker"
+      name="jboss:service=invoker,type=pooled">
+      <attribute name="NumAcceptThreads">1</attribute>
+      <attribute name="MaxPoolSize">300</attribute>
+      <attribute name="ClientMaxPoolSize">300</attribute>
+      <attribute name="SocketTimeout">60000</attribute>
+      <attribute name="ServerBindAddress">${jboss.bind.address}</attribute>
+      <attribute name="ServerBindPort">4445</attribute>
+      <attribute name="ClientConnectAddress">${jboss.bind.address}</attribute>
+      <attribute name="ClientConnectPort">0</attribute>
+      <attribute name="ClientRetryCount">1</attribute>
+      <attribute name="EnableTcpNoDelay">false</attribute>
+
+      <!-- Customized socket factory attributes
+      <attribute name="ClientSocketFactoryName">custom.client.factory</attribute>
+      <attribute name="ServerSocketFactoryName">custom.server.factory</attribute>
+      <attribute name="SslDomain">java:/jaas/pooledInvoker</attribute>
+      -->
+      <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Remoting services 						                                   -->
+   <!-- ==================================================================== -->
+
+   <!-- For detailed description of all these configuration attributes, please see the -->
+   <!-- JBoss Remoting User's Guide or wiki (http://labs.jboss.com/portal/jbossremoting/docs/guide/index.html) -->
+
+    <!-- The NetworkRegistry contains all the local and remote -->
+    <!-- servers that it recognizes.  The remote ones registered -->
+    <!-- are dependant on the detectors running and which domains -->
+    <!-- they are configured to identify.                         -->
+    <mbean code="org.jboss.remoting.network.NetworkRegistry"
+           name="jboss.remoting:service=NetworkRegistry"/>
+
+   <!-- The Connector is the core component of the remoting server service. -->
+   <!-- It binds the remoting invoker (transport protocol, callback configuration, -->
+   <!-- data marshalling, etc.) with the invocation handlers.  -->
+   <mbean code="org.jboss.remoting.transport.Connector"
+          name="jboss.remoting:service=Connector,transport=socket"
+          display-name="Socket transport Connector">
+
+       <!-- Can either just specify the InvokerLocator attribute and not the invoker element in the -->
+       <!-- Configuration attribute, or do the full invoker configuration in the in invoker element -->
+       <!-- of the Configuration attribute. -->
+
+       <!-- Remember that if you do use more than one param on the uri, will have to include as a CDATA, -->
+       <!-- otherwise, parser will complain. -->
+       <!-- <attribute name="InvokerLocator"><![CDATA[socket://${jboss.bind.address}:4446/?datatype=invocation]]></attribute> -->
+
+      <attribute name="Configuration">
+         <!-- Using the following <invoker> element instead of the InvokerLocator above because specific attributes needed. -->
+         <!-- If wanted to use any of the parameters below, can just add them as parameters to the url above if wanted use the InvokerLocator attribute. -->
+         <config>
+            <!-- Other than transport type and handler, none of these configurations are required (will just use defaults). -->
+            <invoker transport="socket">
+               <attribute name="dataType" isParam="true">invocation</attribute>
+               <attribute name="marshaller" isParam="true">org.jboss.invocation.unified.marshall.InvocationMarshaller</attribute>
+               <attribute name="unmarshaller" isParam="true">org.jboss.invocation.unified.marshall.InvocationUnMarshaller</attribute>
+               <!-- This will be port on which the marshall loader port runs on.  -->
+               <!-- <attribute name="loaderport" isParam="true">4447</attribute> -->
+               <!-- The following are specific to socket invoker -->
+               <!-- <attribute name="numAcceptThreads">1</attribute>-->
+               <!-- <attribute name="maxPoolSize">303</attribute>-->
+               <!-- <attribute name="clientMaxPoolSize" isParam="true">304</attribute>-->
+               <attribute name="socketTimeout" isParam="true">600000</attribute>
+               <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
+               <attribute name="serverBindPort">4446</attribute>
+               <!-- <attribute name="clientConnectAddress">216.23.33.2</attribute> -->
+               <!-- <attribute name="clientConnectPort">7777</attribute> -->
+               <attribute name="enableTcpNoDelay" isParam="true">true</attribute>
+               <!-- <attribute name="backlog">200</attribute>-->
+               <!-- The following is for callback configuration and is independant of invoker type -->
+               <!-- <attribute name="callbackMemCeiling">30</attribute>-->
+               <!-- indicates callback store by fully qualified class name -->
+               <!-- <attribute name="callbackStore">org.jboss.remoting.CallbackStore</attribute>-->
+               <!-- indicates callback store by object name -->
+               <!-- <attribute name="callbackStore">jboss.remoting:service=CallbackStore,type=Serializable</attribute> -->
+               <!-- config params for callback store.  if were declaring callback store via object name, -->
+               <!-- could have specified these config params there. -->
+               <!-- StoreFilePath indicates to which directory to write the callback objects. -->
+               <!-- The default value is the property value of 'jboss.server.data.dir' and if this is not set, -->
+               <!-- then will be 'data'. Will then append 'remoting' and the callback client's session id. -->
+               <!-- An example would be 'data\remoting\5c4o05l-9jijyx-e5b6xyph-1-e5b6xyph-2'. -->
+               <!-- <attribute name="StoreFilePath">callback</attribute>-->
+               <!-- StoreFileSuffix indicates the file suffix to use for the callback objects written to disk. -->
+               <!-- The default value for file suffix is 'ser'. -->
+               <!-- <attribute name="StoreFileSuffix">cst</attribute>-->
+            </invoker>
+
+            <!-- At least one handler is required by the connector.  If have more than one, must decalre -->
+            <!-- different subsystem values.  Otherwise, all invocations will be routed to the only one -->
+            <!-- that is declared. -->
+            <handlers>
+               <!-- can also specify handler by fully qualified classname -->
+               <handler subsystem="invoker">jboss:service=invoker,type=unified</handler>
+            </handlers>
+         </config>
+      </attribute>
+      <depends>jboss.remoting:service=NetworkRegistry</depends>
+   </mbean>
+
+
+   <!-- <mbean code="org.jboss.remoting.detection.jndi.JNDIDetector"-->
+   <!--      name="jboss.remoting:service=Detector,transport=jndi">-->
+   <!-- host to which the detector will connect to for the JNDI server. -->
+   <!-- <attribute name="Host">localhost</attribute>-->
+   <!-- port to which detector will connect to for the JNDI server. -->
+   <!-- <attribute name="Port">5555</attribute>-->
+   <!-- context factory string used when connecting to the JNDI server. -->
+   <!-- The default is org.jnp.interfaces.NamingContextFactory. -->
+   <!-- <attribute name="ContextFactory">org.acme.NamingContextFactory</attribute> -->
+   <!-- url package string to use when connecting to the JNDI server. -->
+   <!-- The default is org.jboss.naming:org.jnp.interfaces. -->
+   <!-- <attribute name="URLPackage">org.acme.naming</attribute> -->
+   <!-- Sets the number of detection iterations before manually pinging -->
+   <!-- remote server to make sure still alive. This is needed since remote server -->
+   <!-- could crash and yet still have an entry in the JNDI server, -->
+   <!-- thus making it appear that it is still there. The default value is 5. -->
+   <!-- <attribute name="CleanDetectionNumber">20</attribute>-->
+
+   <!-- Specifies the domains in which the detector will recognize -->
+   <!-- detections.  If servers are not configured to be in these -->
+   <!-- domains, they will not be added to NetworkRegistry. -->
+   <!--      <attribute name="Configuration">-->
+   <!--         <domains>-->
+   <!--            <domain>roxanne</domain>-->
+   <!--            <domain>sparky</domain>-->
+   <!--         </domains>-->
+   <!--      </attribute>-->
+   <!--   </mbean>-->
+
+
+   <!-- ==================================================================== -->
+   <!-- Monitoring and Management                                            -->
+   <!-- ==================================================================== -->
+
+   <!-- Uncomment to enable JMX monitoring of the bean cache
+   <mbean code="org.jboss.monitor.BeanCacheMonitor"
+          name="jboss.monitor:name=BeanCacheMonitor"/>
+   -->
+
+   <!-- Uncomment to enable JMX monitoring of the entity bean locking
+   <mbean code="org.jboss.monitor.EntityLockMonitor"
+          name="jboss.monitor:name=EntityLockMonitor"/>
+   -->
+
+   <!-- ==================================================================== -->
+   <!-- An MBean that is a registry for JDBC type-mapping metadata           -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.ejb.plugins.cmp.jdbc.metadata.MetaDataLibrary"
+      name="jboss.jdbc:service=metadata"/>
+
+   <!-- ==================================================================== -->
+   <!-- Deployment Scanning                                                  -->
+   <!-- ==================================================================== -->
+
+   <!-- An mbean for hot deployment/undeployment of archives.
+   -->
+   <mbean code="org.jboss.deployment.scanner.URLDeploymentScanner"
+      name="jboss.deployment:type=DeploymentScanner,flavor=URL">
+
+      <!-- Uncomment (and comment/remove version below) to enable usage of the
+        DeploymentCache
+      <depends optional-attribute-name="Deployer">jboss.deployment:type=DeploymentCache</depends>
+      -->
+      <depends optional-attribute-name="Deployer">jboss.system:service=MainDeployer</depends>
+
+      <!-- The URLComparator can be used to specify a deployment ordering
+           for deployments found in a scanned directory.  The class specified
+           must be an implementation of java.util.Comparator, it must be able
+           to compare two URL objects, and it must have a no-arg constructor.
+           Two deployment comparators are shipped with JBoss:
+             - org.jboss.deployment.DeploymentSorter
+               Sorts by file extension, as follows:
+                 "sar", "service.xml", "rar", "jar", "war", "wsr", "ear", "zip",
+                 "*"
+             - org.jboss.deployment.scanner.PrefixDeploymentSorter
+               If the name portion of the url begins with 1 or more digits, those
+               digits are converted to an int (ignoring leading zeroes), and
+               files are deployed in that order.  Files that do not start with
+               any digits will be deployed first, and they will be sorted by
+               extension as above with DeploymentSorter.
+      -->
+      <attribute name="URLComparator">org.jboss.deployment.DeploymentSorter</attribute>
+
+      <!--
+      <attribute name="URLComparator">org.jboss.deployment.scanner.PrefixDeploymentSorter</attribute>
+      -->
+
+      <!-- The FilterInstance specifies a URLLister.URLFilter for scanned
+           directories. This DeploymentFilter is initialized with the given
+           prefixes, suffixes and matches that define which URLs should be
+           ignored.
+      -->
+      <attribute name="FilterInstance"
+         attributeClass="org.jboss.deployment.scanner.DeploymentFilter"
+         serialDataType="javaBean">
+         <!-- Files starting with theses strings are ignored -->
+         <property name="prefixes">#,%,\,,.,_$</property>
+         <!-- Files ending with theses strings are ignored -->
+         <property name="suffixes">#,$,%,~,\,v,.BAK,.bak,.old,.orig,.tmp,.rej,.sh</property>
+         <!-- Files matching with theses strings are ignored -->
+         <property name="matches">.make.state,.nse_depinfo,CVS,CVS.admin,RCS,RCSLOG,SCCS,TAGS,core,tags</property>
+      </attribute>
+
+      <!-- Frequency in milliseconds to rescan the URLs for changes -->
+      <attribute name="ScanPeriod">5000</attribute>
+
+      <!-- A flag to disable the scans -->
+      <attribute name="ScanEnabled">true</attribute>
+
+      <!-- URLs are comma separated and resolve relative to the server home URL
+         unless the given path is absolute. If the URL ends in "/" it is
+         considered a collection and scanned, otherwise it is simply deployed;
+         this follows RFC2518 convention and allows discrimination between
+         collections and directories that are simply unpacked archives.
+
+         URLs may be local (file:) or remote (http:). Scanning is supported
+         for remote URLs but unpacked deployment units are not.
+
+         Example URLs:
+            deploy/
+                 scans ${jboss.server.url}/deploy/, which is local or remote
+                 depending on the URL used to boot the server
+            ${jboss.server.home}/deploy/
+                 scans ${jboss.server.home)/deploy, which is always local
+            file:/var/opt/myapp.ear
+                 deploy myapp.ear from a local location
+            file:/var/opt/apps/
+                 scans the specified directory
+            http://www.test.com/netboot/myapp.ear
+                 deploys myapp.ear from a remote location
+            http://www.test.com/netboot/apps/
+                 scans the specified WebDAV location
+       -->
+      <attribute name="URLs">
+         deploy/
+      </attribute>
+
+      <!-- Indicates if the scanner should recursively scan directories that
+      contain no "." in their names. This can be used to group applications
+      and services that must be deployed and that have the same
+      logical function in the same directory i.e.
+        deploy/JMX/
+        deploy/JMS/
+        ...
+      -->
+      <attribute name="RecursiveSearch">True</attribute>
+
+   </mbean>
+
+</server>

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulBean.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulBean.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.localfromremote;
+
+import javax.ejb.Stateful;
+import javax.ejb.Remote;
+import javax.naming.InitialContext;
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+ at Stateful
+ at Remote(StatefulRemote.class)
+public class StatefulBean implements StatefulRemote
+{
+   private static final Logger log = Logger.getLogger(StatefulRemote.class);
+   
+   public void localCall() throws Exception
+   {
+      InitialContext jndiContext = new InitialContext();
+      StatelessLocal stateless = (StatelessLocal)jndiContext.lookup("StatelessBean/local");
+      log.info("*** Remote called " + jndiContext.getEnvironment());
+      stateless.method();
+   }
+}

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulRemote.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulRemote.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulRemote.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.localfromremote;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface StatefulRemote
+{
+   void localCall() throws Exception;
+}

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatelessBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatelessBean.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatelessBean.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.localfromremote;
+
+import javax.ejb.Stateless;
+import javax.ejb.Local;
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+ at Stateless
+ at Local(StatelessLocal.class)
+public class StatelessBean implements StatelessLocal
+{
+   private static final Logger log = Logger.getLogger(StatelessBean.class);
+  
+   public void method() throws Exception
+   {
+      log.info("*** Local called");
+   }
+}

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatelessLocal.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatelessLocal.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatelessLocal.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.localfromremote;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface StatelessLocal
+{
+   void method() throws Exception;
+}

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/unit/LocalTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/unit/LocalTestCase.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/unit/LocalTestCase.java	2007-07-24 21:59:08 UTC (rev 64262)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.localfromremote.unit;
+
+import org.jboss.ejb3.test.localfromremote.StatefulRemote;
+import org.jboss.logging.Logger;
+import org.jboss.test.JBossTestCase;
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public class LocalTestCase extends JBossTestCase
+{
+   private static final Logger log = Logger.getLogger(LocalTestCase.class);
+
+   static boolean deployed = false;
+   static int test = 0;
+
+   public LocalTestCase(String name)
+   {
+      super(name);
+   }
+ 
+   public void testLocalFromRemote() throws Exception
+   {
+      StatefulRemote bean = (StatefulRemote) getInitialContext().lookup("StatefulBean/remote");
+      assertNotNull(bean);
+      
+      try
+      {
+         bean.localCall();
+         fail("should not be allowed to call local interface remotely");
+      }
+      catch (javax.ejb.EJBException e)
+      {}
+   }
+   
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(LocalTestCase.class, ""); 
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list