// bind to jndi
String jndiName = jndiNameResolver.resolveJNDIName(sessionBean, businessRemote);
Binding binding = new Binding(jndiName, proxy, "EJB3.x Remote Business Interface");
bindings.add(binding);
}
catch (ClassNotFoundException cnfe)
{
throw new RuntimeException("Could not load business remote interface " + businessRemote, cnfe);
}
}
// time to create a proxy
List<RemoteBindingMetaData> remoteBindings = sessionBean.getRemoteBindings();
if (remoteBindings == null || remoteBindings.isEmpty())
{
InvocationHandler invocationHandler = new SingletonBeanRemoteInvocationHandler(containerRegistryKey, containerGUID,
defaultInvokerLocatorURL, clientInterceptors);
String defaultRemoteJNDIName = jndiNameResolver.resolveRemoteBusinessDefaultJNDIName(sessionBean);
Object proxy = proxyFactory.createProxy(allRemoteinterfaces.toArray(new Class<?>[allRemoteinterfaces.size()]),
invocationHandler);
Binding binding = new Binding(defaultRemoteJNDIName, proxy, "EJB3.x Default Remote Business Interface");
bindings.add(binding);
}
else
{
for (RemoteBindingMetaData remoteBinding : remoteBindings)
{
String jndiName = remoteBinding.getJndiName();
// if not explicitly specified, then use the default jndi name
if (jndiName == null)
{
jndiName = jndiNameResolver.resolveRemoteBusinessDefaultJNDIName(sessionBean);
}
String invokerLocatorURL = getClientBindURL(remoteBinding);
InvocationHandler invocationHandler = new SingletonBeanRemoteInvocationHandler(containerRegistryKey, containerGUID,
invokerLocatorURL, clientInterceptors);
Object proxy = proxyFactory.createProxy(allRemoteinterfaces
.toArray(new Class<?>[allRemoteinterfaces.size()]), invocationHandler);
Binding binding = new Binding(jndiName, proxy, "EJB3.x Default Remote Business Interface");
bindings.add(binding);
}
}
return bindings;