CodeGym /Courses /Java Collections /Tasks | Level 2 | Lesson 10

Tasks | Level 2 | Lesson 10

Java Collections
Level 2 , Lesson 10
Available

"Hi, Amigo! I have a task, but I'm not going to give it to you."

"Okay, I'm kidding. Go do your task in IntelliJ IDEA."

14
Task
Java Collections, level 2, lesson 10
Locked
Toward an RMI server
Implement the run() method on CLIENT_THREAD. It will simulate a client that will connect to a server. 1) Get the service named UNIC_BINDING_NAME from the registry. 2) Call the returned service's method. Pass any non-empty argument. 3) Display the result of calling the method.
14
Task
Java Collections, level 2, lesson 10
Locked
RMI (part 2)
Implement the run() method on SERVER_THREAD. It will simulate the server: 1) Initialize the registry field. It will accept and process requests on port 2099. 2) Create two objects: a Cat and a Dog.
14
Task
Java Collections, level 2, lesson 10
Locked
Service locator
Read about the Service Locator pattern. Implement the getService(String jndiName) method in ServiceLocator. It will implement logic for working with the context and cache. 1) Return the required service from the cache. 2) If the cache doesn't have the required service.
Comments (5)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
cute potato Level 46, Poland, Poland
17 February 2023
Why when I googling about ServiceLocator there is an information that ServiceLocator is an Anti-Pattern and better avoid it?
Andrei Level 41
24 June 2021
The service locator is actually a nice exercise, after you read the posts Gaby and BJB recommended below. Although the one from Gaby was sufficient for me because it was well worded and the example was clear.
MaGaby2280 Level 41, Guatemala City, Guatemala
25 May 2021
This is a very good tutorial for the Service Locator Pattern: https://www.tutorialspoint.com/design_pattern/service_locator_pattern.htm You should also read this article before these exercises... really wish I had, now everything makes sense https://codegym.cc/groups/posts/211-rmi-in-practice
BlueJavaBanana Level 37
24 January 2021
Helpful link for last task: https://www.baeldung.com/java-service-locator-pattern
Ovo Leslie Level 26, Lagos, Nigeria
16 May 2020
The example in the lesson about configuring the client side didn't help in the first task at all