14
タスク
Java Collections, レベル 2, レッスン 10
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
タスク
Java Collections, レベル 2, レッスン 10
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
タスク
Java Collections, レベル 2, レッスン 10
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.