[jboss-user] [EJB/JBoss] - Re: Business Interface Pattern + Generics == EJB Spec Violat
jaikiran
do-not-reply at jboss.com
Sat Jul 4 10:44:42 EDT 2009
Consider this:
public interface AddressBeanBusinessInterface <E extends Exception>
| {
| ...
| public void delete( final Long key ) throws E, UnknownIdDeviation;
|
| public interface AddressBeanRemote extends EJBObject, AddressBeanBusinessInterface<RemoteException>
| {
| // empty - see the business interface for the remote EJB methods
| ...
and
public interface AnotherInterface extends AddressBeanBusinessInterface<NullPointerException>
| {
| // empty - see the business interface for the remote EJB methods
|
So there 2 interfaces which extend the AddressBeanBusinessInterface. One expects to throw a NullPointerException and the other a RemoteException. So what should the compiler "replace" the E in AddressBeanBusinessInterface? It doesn't. All it does is marks the method to throw an Exception (as marked by E extends Exception):
public interface AddressBeanBusinessInterface <E extends Exception>
| {
| ...
| public void delete( final Long key ) throws Exception, UnknownIdDeviation;
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241797#4241797
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241797
More information about the jboss-user
mailing list