[jboss-cvs] JBossAS SVN: r73642 - in projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/handler: stateless and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri May 23 18:09:10 EDT 2008
Author: bstansberry at jboss.com
Date: 2008-05-23 18:09:10 -0400 (Fri, 23 May 2008)
New Revision: 73642
Modified:
projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/handler/stateful/StatefulClusteredInvocationHandler.java
projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/handler/stateless/StatelessClusteredInvocationHandler.java
Log:
[EJBTHREE-1375] Properly load balance SFSB creation
[EJBTHREE-1376] Don't unnecessarily pass clustering metadata back to server
Modified: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/handler/stateful/StatefulClusteredInvocationHandler.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/handler/stateful/StatefulClusteredInvocationHandler.java 2008-05-23 22:08:18 UTC (rev 73641)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/handler/stateful/StatefulClusteredInvocationHandler.java 2008-05-23 22:09:10 UTC (rev 73642)
@@ -59,23 +59,25 @@
private Object id;
protected FamilyWrapper family;
protected LoadBalancePolicy lbPolicy;
- AsynchProvider provider;
+ protected AsynchProvider provider;
protected String partitionName;
+ protected Object originTarget;
public StatefulClusteredInvocationHandler(Container container, Interceptor[] interceptors, FamilyWrapper family,
- LoadBalancePolicy lb, String partitionName, Object id, String businessInterfaceType)
+ LoadBalancePolicy lb, String partitionName, Object originTarget, Object id, String businessInterfaceType)
{
super(container, interceptors, businessInterfaceType);
this.family = family;
this.lbPolicy = lb;
this.partitionName = partitionName;
this.id = id;
+ this.originTarget = originTarget;
}
public StatefulClusteredInvocationHandler(AsynchProvider provider, String containerId, String containerGuid,
Interceptor[] interceptors, FamilyWrapper family, LoadBalancePolicy lb, String partitionName,
- Object id, String businessInterfaceType)
+ Object originTarget, Object id, String businessInterfaceType)
{
super(containerId, containerGuid, interceptors, businessInterfaceType);
this.provider = provider;
@@ -83,6 +85,7 @@
this.lbPolicy = lb;
this.partitionName = partitionName;
this.id = id;
+ this.originTarget = originTarget;
}
protected StatefulClusteredInvocationHandler()
@@ -108,10 +111,11 @@
sri.setArguments(args);
sri.setInstanceResolver(metadata);
sri.getMetaData().addMetaData(Dispatcher.DISPATCHER, Dispatcher.OID, containerId, PayloadKey.AS_IS);
- sri.getMetaData().addMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.CLUSTER_FAMILY_WRAPPER, family, PayloadKey.AS_IS);
- sri.getMetaData().addMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.LOADBALANCE_POLICY, lbPolicy, PayloadKey.AS_IS);
+ sri.getMetaData().addMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.CLUSTER_FAMILY_WRAPPER, family, PayloadKey.TRANSIENT);
+ sri.getMetaData().addMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.LOADBALANCE_POLICY, lbPolicy, PayloadKey.TRANSIENT);
+ sri.getMetaData().addMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.HA_TARGET, originTarget, PayloadKey.TRANSIENT);
+ sri.getMetaData().addMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.PARTITION_NAME, partitionName, PayloadKey.TRANSIENT);
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)
@@ -146,7 +150,8 @@
AsynchMixin mixin = new AsynchMixin();
Interceptor[] newInterceptors = ProxyUtils.addAsynchProxyInterceptor(mixin, interceptors);
StatefulClusteredInvocationHandler handler = new StatefulClusteredInvocationHandler(mixin, containerId,
- containerGuid, newInterceptors, family, lbPolicy, partitionName, this.id, this.getBusinessInterfaceType());
+ containerGuid, newInterceptors, family, lbPolicy, partitionName, this.originTarget, this.id,
+ this.getBusinessInterfaceType());
return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaces, handler);
}
Modified: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/handler/stateless/StatelessClusteredInvocationHandler.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/handler/stateless/StatelessClusteredInvocationHandler.java 2008-05-23 22:08:18 UTC (rev 73641)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/handler/stateless/StatelessClusteredInvocationHandler.java 2008-05-23 22:09:10 UTC (rev 73642)
@@ -34,7 +34,6 @@
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.asynchronous.AsynchronousInterceptor;
import org.jboss.ejb3.proxy.JBossProxy;
import org.jboss.ejb3.proxy.ProxyUtils;
@@ -56,27 +55,30 @@
protected FamilyWrapper family;
protected LoadBalancePolicy lbPolicy;
- AsynchProvider provider;
+ protected AsynchProvider provider;
protected String partitionName;
+ protected Object originTarget;
public StatelessClusteredInvocationHandler(Container container, Interceptor[] interceptors, FamilyWrapper family,
- LoadBalancePolicy lbPolicy, String partitionName, String businessInterfaceClassName)
+ LoadBalancePolicy lbPolicy, String partitionName, Object originTarget, String businessInterfaceClassName)
{
super(container, interceptors, businessInterfaceClassName);
this.family = family;
this.lbPolicy = lbPolicy;
this.partitionName = partitionName;
+ this.originTarget = originTarget;
}
public StatelessClusteredInvocationHandler(AsynchProvider provider, String containerId, String containerGuid,
Interceptor[] interceptors, FamilyWrapper family, LoadBalancePolicy lbPolicy, String partitionName,
- String businessInterfaceClassName)
+ Object originTarget, String businessInterfaceClassName)
{
super(containerId, containerGuid, interceptors, businessInterfaceClassName);
this.provider = provider;
this.family = family;
this.lbPolicy = lbPolicy;
this.partitionName = partitionName;
+ this.originTarget = originTarget;
}
public StatelessClusteredInvocationHandler()
@@ -102,10 +104,11 @@
sri.setArguments(args);
sri.setInstanceResolver(metadata);
sri.getMetaData().addMetaData(Dispatcher.DISPATCHER, Dispatcher.OID, containerId, PayloadKey.AS_IS);
- sri.getMetaData().addMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.CLUSTER_FAMILY_WRAPPER, family, PayloadKey.AS_IS);
- sri.getMetaData().addMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.LOADBALANCE_POLICY, lbPolicy, PayloadKey.AS_IS);
+ sri.getMetaData().addMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.CLUSTER_FAMILY_WRAPPER, family, PayloadKey.TRANSIENT);
+ sri.getMetaData().addMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.LOADBALANCE_POLICY, lbPolicy, PayloadKey.TRANSIENT);
+ sri.getMetaData().addMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.HA_TARGET, originTarget, PayloadKey.TRANSIENT);
+ sri.getMetaData().addMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.PARTITION_NAME, partitionName, PayloadKey.TRANSIENT);
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)
@@ -124,7 +127,7 @@
AsynchMixin mixin = new AsynchMixin();
Interceptor[] newInterceptors = ProxyUtils.addAsynchProxyInterceptor(mixin, interceptors);
StatelessClusteredInvocationHandler handler = new StatelessClusteredInvocationHandler(mixin, containerId,
- containerGuid, newInterceptors, family, lbPolicy, partitionName, this.getBusinessInterfaceType());
+ containerGuid, newInterceptors, family, lbPolicy, partitionName, this.originTarget, this.getBusinessInterfaceType());
return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaces, handler);
}
More information about the jboss-cvs-commits
mailing list