Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 java rmi

views
     
TSboonhoi
post Mar 8 2006, 10:50 AM, updated 19y ago

New Member
*
Newbie
2 posts

Joined: Mar 2006
Need help in the java rmi callback function.
Currently i am writing a java code for online student record system on top of RMI. This system need to store a list of student identity number in a text file in order to retrieve the student records. Multiple clients are allow to view and edit the information at the same time.
There will have a list to display student identity number obtained from the server. The user selects/clicks one of these and causes the data for that student to be displayed. You can display the student profiles any way you like. You will probably need a TextField component in order to display the student profiles. You will also need a TextArea to allow the user to add comment to the profiles. If one client updates the profile, the other clients' screens need to be updated at once.
This required the call back function and synchronization.
I totally don't have any idea of doing it. Hope somemore can guide me and help me to solve the problem. Thanks

fly
post Mar 8 2006, 11:33 AM

¯\(°_o)/¯
Group Icon
VIP
1,119 posts

Joined: Jan 2003
I'm assuming that you're already familiar with building an RMI server and client (along with the interfaces, stubs, skeletons, etc.). If not, get familiarized with RMI first: http://java.sun.com/j2se/1.4.2/docs/guide/rmi/index.html

With callback functions, all you need to do is to also turn your RMI client (i.e the GUI) into an RMI server as well (i.e create a new interface that the server will use to invoke the function on your client.

In your case, a student profile update will do the following things:
1. Client invokes remote method to update student profile on Server.
2. Server updates student profile in storage.
3. Server invokes remote method on client(s) to update student profile that is shown on screen.
4. Client redraws GUI and updates on-screen student profile.

TSboonhoi
post Mar 13 2006, 03:27 PM

New Member
*
Newbie
2 posts

Joined: Mar 2006
i am trying to write the code, but i face some problem. All the data is display at server side instead of at client side. why?
i check all my coding, nothing wrong with my coding.



 

Change to:
| Lo-Fi Version
0.0130sec    0.43    5 queries    GZIP Disabled
Time is now: 29th March 2024 - 11:43 PM