Alexandre
Alexandre

Reputation: 5135

Make EJB 3.1 bindings default to interface and not class name

@Singleton
public class DummySentenceManager implements SentenceManager {

binds to

[java:global/appname/mypkg.DummySentenceManager, java:global/appname/mypkg.DummySentenceManager!mypkg.SentenceManager]

I would like it to bind to:

[java:global/appname/mypkg.SentenceManager]

without resorting to:

@Singleton(name="mypkg.SentenceManager")
public class DummySentenceManager implements SentenceManager {

Thanks!

Upvotes: 0

Views: 196

Answers (1)

Brett Kail
Brett Kail

Reputation: 33946

Why would you like it to bind like that? The EJB must be unique within the module name anyway, so there's no reason to qualify the name with a package. Also, the whole point of java:global bindings is that they aren't customizable in this way: they follow a strict and predictable pattern.

(For what it's worth, . is not a valid name for an ejb-name when specified in XML, per the XSD. I wouldn't be surprised if you hit problems in EJB implementations due to this.)

Upvotes: 1

Related Questions