File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes @Remote Annotation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "@Remote Annotation" Watch "@Remote Annotation" New topic
Author

@Remote Annotation

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9383
    
    2

Guys,

Do we still need to extend javax.rmi.remote for a Remote business interface? It is enough if we just have the @Remote Annotation. Am I right guys?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

In this case, extending the Remote interface is optional, that's the whole beauty of using this annotation


[My Blog]
All roads lead to JavaRanch
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9383
    
    2

Originally posted by Christophe Verre:
In this case, extending the Remote interface is optional, that's the whole beauty of using this annotation


But in case, if I use Annotations, will I still be able to handle my RemoteException?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

The methods of the business interface may only throw the java.rmi.RemoteException if the interface extends java.rmi.Remote. So if you are using the annotation, you don't need to set your methods to "throw RemoteException". On the client side, you don't need to care about RemoteExceptions, because these are system exceptions, which will be wrapped in an EJBException.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9383
    
    2

Thanks Christophe!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: @Remote Annotation