[refactor] Remove unnecessary declarations in service-locator pattern.

This commit is contained in:
ruslanpa
2015-02-10 10:02:44 +02:00
parent 4b432a79d9
commit 14058082bb
6 changed files with 119 additions and 120 deletions
@@ -1,20 +1,20 @@
package com.iluwatar;
/**
* Service locator pattern, used to lookup jndi services
* and cache them for subsequent requests.
* @author saifasif
* Service locator pattern, used to lookup jndi services
* and cache them for subsequent requests.
*
* @author saifasif
*/
public class App {
public static void main(String[] args) {
Service service = ServiceLocator.getService("jndi/serviceA");
service.execute();
service = ServiceLocator.getService("jndi/serviceB");
service.execute();
service = ServiceLocator.getService("jndi/serviceA");
service.execute();
service = ServiceLocator.getService("jndi/serviceA");
service.execute();
}
public static void main(String[] args) {
Service service = ServiceLocator.getService("jndi/serviceA");
service.execute();
service = ServiceLocator.getService("jndi/serviceB");
service.execute();
service = ServiceLocator.getService("jndi/serviceA");
service.execute();
service = ServiceLocator.getService("jndi/serviceA");
service.execute();
}
}