![]() ![]() ![]() |
|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
In this exercise you will create an RMI service that returns two objects to the client. As in SimpleBankingSyste
m
you need to change the constant HOST_NAME to match
your computer's name on the network.
You will also extend the
While you are making these changes, take a careful look at
The course material for this exercise is covered in Parameters in RMI. PrerequisitesSkeleton Code
Tasks
Add the
Create an implementation for the Compile all of the class files for the server and its remote objects.
Create the Start the RMI Server in its own DOS console. Start the RMI Client in its own DOS console. Where help exists, the task numbers above are linked to the step-by-step help page. Solution Source
TOPDemonstrationWhen the server is run in its DOS console, the output will be:
Then when the client is run in its DOS console, the output will be:
printing the message ("Hello!") you defined in your implementation object.
As your client runs both the server console and the client
console it prints the instantiation messages from
MessageObject: Class Number is #0 Object Number is #0 MessageObject: Class Number is #1 Object Number is #1 MessageObject: Class Number is #2 Object Number is #2 MessageObject: Class Number is #3 Object Number is #3 MessageObject: Class Number is #4 Object Number is #4 MessageObject: Class Number is #5 Object Number is #5 MessageObject: Class Number is #6 Object Number is #6 MessageObject: Class Number is #7 Object Number is #7 MessageObject: Class Number is #8 Object Number is #8 MessageObject: Class Number is #9 Object Number is #9 While the client console displays: MessageObject: Class Number is #0 Object Number is #0 MessageObject: Class Number is #0 Object Number is #1 MessageObject: Class Number is #0 Object Number is #2 MessageObject: Class Number is #0 Object Number is #3 MessageObject: Class Number is #0 Object Number is #4 MessageObject: Class Number is #0 Object Number is #5 MessageObject: Class Number is #0 Object Number is #6 MessageObject: Class Number is #0 Object Number is #7 MessageObject: Class Number is #0 Object Number is #8 MessageObject: Class Number is #0 Object Number is #9 Notice the difference in the class numbers.
While the Next MagerciseExercisesShort CourseFeedbackTOPCopyright 1996-2000 jGuru.com. All Rights Reserved.
_______ |