File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes remote exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "remote exception" Watch "remote exception" New topic
Author

remote exception

Beny Na
Ranch Hand

Joined: May 26, 2004
Posts: 159
hi ,
my assg is about urlxxx

my DBMain interface from Sun does not declare RemoteException,
how to design the class diagram that could be easy for use in client code?
how polymorph can be use within this assignment?

i created remote adapter for network(only one data class), but still can't find the solution for local(since data.java implements DBMain and DBMain does not throws RemoteException), i would appreciate if there is a solution to my problem.



thanks
Beny Na
Ranch Hand

Joined: May 26, 2004
Posts: 159
i just try this solution, but not sure if it will work correctly.
<< XXX >> --> interface


1.Data implements <<DBMain>>

2.RemoteAdapter implements <<DBMain>>,<<DBMainRemote>> , where DBMainRemote contain all methods in DBMain interface that throws RemoteException
Code in RemoteAdapter :
public class RemoteAdapter implements DBMainRemote {
DBMain adaptee;
public RemoteAdapter(DBMain adaptee){
this.adaptee = adaptee;
}

// all methods in DBMain called XXX
....
return adapte.XXX;
....
}



and in client code , roughly like :

DBMain db;

if local then
db = new Data();
else // network
db = new RemoteAdapter();


please coreect me, not very sure this will work and i think it still messy, but i can't found any other solution


thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: remote exception
 
Similar Threads
DBMain method need throw RemoteException?
Remote interface for Data class with RMI
RMI method invocation return value
NX:Contractor About RemoteException
RecordNotFoundException and DuplicateKeyException