Class pollution and the EJB spec

Heiko W.Rupp hrupp at redhat.com
Fri May 7 11:22:43 UTC 2010


Hi,

I see the following the following pattern being used more and more in our code

@Stateless 
public class MyBean implements MyBeanLocal {
...
}


@Local 
public interface MyBeanLocal implements MyBeanRemote
{
   public void foo();
...
}

@Remote
@Webservice
@SomethingElse
public interface MyBeanRemote 
{
    @WebMethod public void foo();
...
}

I am currently seeing the following  issues with that: on jdk15, @Webservice, @SomethingElse need to be on the classpath of clients using MyBeanLocal for compilation.
Actually (but I have not found an example forbidding it), I am not sure if the pattern above is portable, as the spec does not talk about
the semantics of such inheritance of @WebService and @WebMethod (as opoosed to the inheritance of @TransactionAttribute)

So I think it would be better in the future not to use this above pattern - the IDE actually allows to easily pull up a method form 
a session bean class into both interfaces if needed.
  Heiko


-- 
Reg. Adresse: Red Hat GmbH, Otto-Hahn-Strasse 20, 85609 Dornach bei München
Handelsregister: Amtsgericht München HRB 153243
Geschaeftsführer: Brendan Lane, Charlie Peters, Michael Cunningham, Charles Cachera



More information about the rhq-devel mailing list