Resolves checkstyle issues for semaphore servant serverless service-layer service-locator (#1079)
* Reduces checkstyle errors in semaphore * Reduces checkstyle errors in servant * Reduces checkstyle errors in serverless * Reduces checkstyle errors in service-layer * Reduces checkstyle errors in service-locator
This commit is contained in:
committed by
Ilkka Seppälä
parent
37599eb48f
commit
390795154f
@ -24,24 +24,22 @@
|
||||
package com.iluwatar.servicelocator;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Service Locator pattern is a design pattern used in software development to encapsulate the
|
||||
* processes involved in obtaining a service with a strong abstraction layer. This pattern uses a
|
||||
* central registry known as the "service locator", which on request returns the information
|
||||
* necessary to perform a certain task.
|
||||
* <p>
|
||||
* In this example we use the Service locator pattern to lookup JNDI-services and cache them for
|
||||
*
|
||||
* <p>In this example we use the Service locator pattern to lookup JNDI-services and cache them for
|
||||
* subsequent requests.
|
||||
* <p>
|
||||
*
|
||||
* <br>
|
||||
*
|
||||
* @author saifasif
|
||||
*
|
||||
*/
|
||||
public class App {
|
||||
|
||||
/**
|
||||
* Program entry point
|
||||
*
|
||||
* Program entry point.
|
||||
*
|
||||
* @param args command line args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
@ -25,10 +25,10 @@ package com.iluwatar.servicelocator;
|
||||
|
||||
/**
|
||||
* This is going to be the parent service interface which we will use to create our services. All
|
||||
* services will have a <ul><li>service name</li> <li>unique id</li> <li>execution work flow</li></ul>
|
||||
*
|
||||
* @author saifasif
|
||||
* services will have a <ul><li>service name</li> <li>unique id</li> <li>execution work
|
||||
* flow</li></ul>
|
||||
*
|
||||
* @author saifasif
|
||||
*/
|
||||
public interface Service {
|
||||
|
||||
|
@ -23,11 +23,10 @@
|
||||
|
||||
package com.iluwatar.servicelocator;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The service cache implementation which will cache services that are being created. On first hit,
|
||||
@ -59,14 +58,14 @@ public class ServiceCache {
|
||||
if (serviceJndiName.equals(serviceName)) {
|
||||
cachedService = serviceCache.get(serviceJndiName);
|
||||
LOGGER.info("(cache call) Fetched service {}({}) from cache... !",
|
||||
cachedService.getName(), cachedService.getId());
|
||||
cachedService.getName(), cachedService.getId());
|
||||
}
|
||||
}
|
||||
return cachedService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the service into the cache map
|
||||
* Adds the service into the cache map.
|
||||
*
|
||||
* @param newService a {@link Service}
|
||||
*/
|
||||
|
@ -41,7 +41,7 @@ public class ServiceImpl implements Service {
|
||||
private final int id;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor.
|
||||
*/
|
||||
public ServiceImpl(String serviceName) {
|
||||
// set the service name
|
||||
|
Reference in New Issue
Block a user