else
{
String policyClass = clustered.loadBalancePolicy();
try
{
RemoteProxyFactoryRegistry registry = container.getDeployment().getRemoteProxyFactoryRegistry();
Class<LoadBalancePolicy> policy = registry.getLoadBalancePolicy(policyClass);
policyClass = policy.getName();
}
catch (LoadBalancePolicyNotRegisteredException e){}
lbPolicy = (LoadBalancePolicy)Thread.currentThread().getContextClassLoader().loadClass(policyClass)
.newInstance();
}
wrapper = new FamilyWrapper(proxyFamilyName, hatarget.getReplicants());
drm.registerListener(proxyFamilyName, this);
super.start();
// Set up the proxy to ourself. Needs to be clustered so it can load
// balance requests (EJBTHREE-1375). We use the home load balance policy.
LoadBalancePolicy factoryLBP = null;
if (clustered.homeLoadBalancePolicy() == null || clustered.homeLoadBalancePolicy().equals(ClusteredDefaults.LOAD_BALANCE_POLICY_DEFAULT))
{
factoryLBP = new RoundRobin();
}
else
{
String policyClass = clustered.homeLoadBalancePolicy();
try
{
RemoteProxyFactoryRegistry registry = container.getDeployment().getRemoteProxyFactoryRegistry();
Class<LoadBalancePolicy> policy = registry.getLoadBalancePolicy(policyClass);
policyClass = policy.getName();
}
catch (LoadBalancePolicyNotRegisteredException e){}
factoryLBP = (LoadBalancePolicy)Thread.currentThread().getContextClassLoader().loadClass(policyClass)