[jboss-dev-forums] [Design of JBoss/Tomcat Integration] - Re: JBAS-5673 - Metadata processing

scott.stark@jboss.org do-not-reply at jboss.com
Tue Aug 5 22:10:32 EDT 2008


"emuckenhuber" wrote : 
  | So i guess it should rather be something like:
  | 
  |   |    AnnotatedEJBReferenceMetaData newRef = createAnnotatedEJBRef(...);
  |   |    AnnotatedEJBReferenceMetaData existingRef = refs.get(newRef.getName());
  |   |    if(existingRef == null)
  |   |       refs.add(ref);
  |   |    else
  |   |       mergeInjectionTargets(existingRef, newRef)
  |   | 
  | Or should this be done in a different way ?
That sounds right, but you would need to validate that the injection target has the same type. This should not be allowed:


  | public class FooServlet
  | {
  |     @EJB(beanName="StatefulTestBean", beanInterface=StatefulIF.class)
  |     private StatefulIF statefulTestBean;
  | }
  | public class Foo2Servlet
  | {
  |     @EJB(beanName="StatefulTestBean", beanInterface=StatefulIF2.class)
  |     private StatefulIF2 statefulTestBean;
  | }
  | 
  | @Session
  | public class SomeEJb
  | {
  |     @EJB(beanName="StatefulTestBean", beanInterface=StatefulIF.class)
  |     private StatefulIF statefulTestBean;
  |     @EJB(beanName="StatefulTestBean", beanInterface=StatefulIF2.class)
  |     private StatefulIF2 statefulTestBean2;
  | }
  | 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168871#4168871

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168871



More information about the jboss-dev-forums mailing list