[jboss-dev-forums] [Design of EJB 3.0] - Re: Specifying Default Client Binding
ALRubinger
do-not-reply at jboss.com
Fri Sep 8 18:53:36 EDT 2006
Perhaps this isn't a bug, but IMHO makes developing very difficult.
>From ProxyDeployer.initializeRemoteBindingMetadata():
if (binding == null)
| {
| ...
| }
| else
| {
| RemoteBinding[] list = {binding};
| remoteBindings = new RemoteBindingsImpl(list);
| advisor.getAnnotations().addClassAnnotation(RemoteBindings.class, remoteBindings);
| }
Saying - if you've specified @RemoteBinding, use the bind parameters it contains. One of these is clientBindUrl, which gets a default value of socket://0.0.0.0:3873 unless explicitly overridden in the annotation.
What if you've specified in the Service Bindings manager that your EJBs should be contacted via an alternate port? The only way to contact on the new port is to specify the client bind URL in the annotation? I'd like to be able to deploy my EJBs into any configured server instance without telling it where it should be listening; that's already been accomplished for all my other components in the Service Bind Manager.
Unfortunately as it stands it's impossible to determine whether the @RemoteBinding.clientBindUrl value was set through the default, or specified by the user. I'd recommend having the default value of @RemoteBinding.clientBindUrl be null, and changing the code in ProxyDeployer to the following:
else
| {
| // If the @RemoteBinding.clientBindUrl was specified
| // by the developer, use it, otherwise use the default
| RemoteBinding[] list = {new RemoteBindingImpl(
| binding.jndiBinding(),
| binding.interceptorStack(),
| (binding.clientBindUrl() == null) ? this.defaultClientBinding : binding.clientBindUrl(),
| binding.factory())};
| remoteBindings = new RemoteBindingsImpl(list);
| advisor.getAnnotations().addClassAnnotation(RemoteBindings.class, remoteBindings);
| }
Thoughts?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970474#3970474
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970474
More information about the jboss-dev-forums
mailing list