The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
how to let the remote server notify the local client to update it's view through RMI
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Originally posted by Andrew Monkhouse:
[BARTENDERS: Please let me know if this is getting too close to providing a real solution).
[ May 07, 2003: Message edited by: Andrew Monkhouse ]
Originally posted by Andrew Monkhouse:
Sun instructions: Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the (DB) interface
So you create your "Data" class which does the above, and only the above.
You then create a class (DataRMI) that provides these same methods in an RMI way.
On the client side, you create a class (ClientRMI) that will do a lookup for the functionality that DataRMI provides, and wrap it's methods for you.
Your Model can then call ClientRMI, or Data directly - both will provide exactly the same methods with exactly the same return types, and exactly the same exceptions.
So your model can call the find(String[] criteria) method no matter whether it is using RMI or direct connect - in both cases it will get back the int array. It can then do whatever processing it needs before sending the update to the view.
Then there is never a need for the server to try and push the data over to the client - it is always the client doing a pull of the data from the server.
Regards, Andrew
[ May 07, 2003: Message edited by: Andrew Monkhouse ]
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog