// JBCTS-718
// If jndi-name is defined, use the value specified
String jndiName = enterpriseBean.getJndiName();
if (jndiName != null && !jndiName.trim().equals(""))
{
RemoteBindingImpl remoteBindingAnnotation = new RemoteBindingImpl();
remoteBindingAnnotation.setJndiBinding(jndiName);
addClassAnnotation(container, RemoteBinding.class, remoteBindingAnnotation);
log.debug("Adding " + RemoteBinding.class.getName() + " to " + container.toString() + ": "
+ remoteBindingAnnotation.toString());
return;
}
List<RemoteBindingMetaData> bindingsList = enterpriseBean.getRemoteBindings();
if (bindingsList == null || bindingsList.size() == 0)
{
addSimpleJndiAnnotations(container, enterpriseBean);
return;
}
AnnotationRepository annotations = container.getAnnotations();
annotations.disableAnnotation(RemoteBinding.class.getName());
List<RemoteBindingImpl> bindingAnnotationsList = new ArrayList<RemoteBindingImpl>();
for(RemoteBindingMetaData binding : bindingsList)
{
RemoteBindingImpl bindingAnnotation = new RemoteBindingImpl();
if (binding.getJndiName() != null)
bindingAnnotation.setJndiBinding(binding.getJndiName());
if (binding.getClientBindUrl() != null)
bindingAnnotation.setBindUrl(binding.getClientBindUrl());
if (binding.getInterceptorStack() != null)
bindingAnnotation.setStack(binding.getInterceptorStack());
if (binding.getProxyFactory() != null)
bindingAnnotation.setFactory(binding.getProxyFactory());
bindingAnnotationsList.add(bindingAnnotation);
}