java - Specialize EJB in JBoss -
i asked while ago within jboss 4.2.3 (javaee 5) context , got answer try spring configuration, i'd rather not add framework when isn't necessary.
now javaee 6 , 7 out have feeling there's simpler solution problem. wasn't lucky searching yet if can me on right track, i'd appreciate help.
here's problem:
suppose have ejb interface iejb
, library provides implentation ejba
of interface. there several other libraries provide further ejbs , couple of contain @ejb iejb ref
, i.e. need reference en ejb exposes interface iejb
.
now, there need completely replace ejba
alternate implementation ejbb
, i.e. ejba
should never using in entire application.
there few options can't use or require rather large changes:
- "don't deploy library containing
ejba
": not possible, since there other ejbs needed - "extract
ejba
lib": require rather large changes in our libraries , applications use them - "implement
ejba
non-ejb, subclass when needed , make subclass ejb": same reasons above apply, require rather large changes - "delete
ejba
": there other applications need use it, it's 1 application should use replacement instead.
so there few ways think of:
- tell server not deploy
ejba
implementation ofiejb
ejbb
, dependency injection fine - tell dependency injection use
ejbb
when instance ofiejb
required (something cdi's@specializes
ejbs - possible in javaee 7?)
any ideas on this? possible (i have feeling yes) , if so, how?
note on environment: we're running on jboss 7.2.0, if possible using wildfly, might option (although we'd prefer not forced update already).
a couple of ideas:
- delete ejba if mustn't used anyway
- remove ejb annotations
- use @inject inject local ejbs (recommended anyway). think cdi lets specify default implementation, afaik.
Comments
Post a Comment