"Hej, Amigo! Jeg har en opgave, men jeg har ikke tænkt mig at give den til dig."
"Okay, jeg laver sjov. Gør din opgave i IntelliJ IDEA."
14
Opgave
Java Collections, niveau, lektie
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
Opgave
Java Collections, niveau, lektie
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
Opgave
Java Collections, niveau, lektie
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.