{
// Obtain RemoteBinding URL
List<RemoteBindingMetaData> bindings = smd.getRemoteBindings();
// Get Client Bind URL
RemoteBindingMetaData remoteBinding = null;
String url = null;
try
{
// If bindings are specified
if (bindings != null)
{
remoteBinding = bindings.get(0);
url = remoteBinding.getClientBindUrl();
}
}
// The bindings were empty
catch (IndexOutOfBoundsException ioobe)
{
// Create a new empty remote binding and add to the metadata
remoteBinding = new RemoteBindingMetaData();
smd.getRemoteBindings().add(remoteBinding);
}
// If no explicit Client Bind URL is specified
if (url == null || url.trim().equals(""))
{
// Use the binding on the EJB3 Remoting Connector
url = ProxyRemotingUtils.getDefaultClientBinding();
remoteBinding.setClientBindUrl(url);
}
// Create and register a remote proxy factory
String remoteProxyFactoryKey = this.getProxyFactoryRegistryKey(smd, false);
SessionProxyFactory factory = this.createRemoteProxyFactory(remoteProxyFactoryKey, containerName,
containerGuid, smd, cl, url, advisor);