[jboss-dev] On demand JCA and JTA for the web-profile
Adrian Brock
abrock at redhat.com
Tue May 5 08:30:55 EDT 2009
On Tue, 2009-05-05 at 14:03 +0200, Carlo de Wolf wrote:
> Adrian Brock wrote:
> >
> > <bean ...>
> > <annoation>@org.jboss.naming.JNDI(binding="/foo/bar",
> > remotable="true", remoteInterfaces={...})</annotation>
> >
> Hehe, remotable is also an aspect. :-)
> For example I could remote it via Remoting2, Remoting3, Agnostic, RMI, etc.
> The binding name in the end determines the remoting protocol.
> More importantly it also determines local v.s. remote semantics of a
> call. e.g. pass by ref or pass by value.
> > The implementation detail is binding some lifecycle handler
> > to the @JNDI annotation. What it does can change as required
> > (including nothing if that's what you want :-)
> >
> So you don't want to suddenly change the call semantic.
>
> That's why I would rather see it stacked, in the likes of:
> @JNDI(binding="/foo/bar", interfaces={...})
> @JNDIFacade(binding="/foo/bar2", factory=Remoting2Factory.class,
> interfaces={...}, delegateBinding="/foo/bar")
>
> (needs work to make it more friendly)
>
> or in EJB3 style:
> @JNDI("bean/endpoint")
> @Local(MyInterface.class)
> @LocalBinding(jndiBinding="bean/local")
> @Remote(MyRemoteInterface.class)
> @RemoteBinding(factory="SomeFactory", jndiBinding="bean/remote")
Yes, a different annotation is probably preferable.
But JNDI needs to know whether to bind directly or bind the "proxy"
so it will have to look for the annotation anyway and integrate
with the actual remoting mechanism.
> So while true that it doesn't an interface, in practice I don't
> recommend a no-interface approach.
Nor do I, but the feature is there if you need it and it works
for you.
--
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Adrian Brock
Chief Scientist
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
More information about the jboss-development
mailing list