From 4f9b1c717c7c6974be0166e01bd08476db29330f Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Fri, 30 Aug 2024 11:55:01 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20iup=20=EB=AA=A8=EB=93=88=EC=99=B8?= =?UTF-8?q?=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/example/api/ClientController.java | 110 ------- .../modules/example/api/ServerController.java | 63 ---- .../modules/example/thread/Calculator.java | 14 - .../example/thread/MultiThreadSample.java | 288 ------------------ .../thread/ResultByRunnableExample.java | 73 ----- .../example/thread/TaskCallableExample.java | 35 --- .../modules/example/thread/TaskDtoSample.java | 11 - .../thread/TaskRunnableReturnSample.java | 43 --- .../example/thread/TaskRunnableSample.java | 33 -- 9 files changed, 670 deletions(-) delete mode 100644 src/main/java/cokr/xit/ens/modules/example/api/ClientController.java delete mode 100644 src/main/java/cokr/xit/ens/modules/example/api/ServerController.java delete mode 100644 src/main/java/cokr/xit/ens/modules/example/thread/Calculator.java delete mode 100644 src/main/java/cokr/xit/ens/modules/example/thread/MultiThreadSample.java delete mode 100644 src/main/java/cokr/xit/ens/modules/example/thread/ResultByRunnableExample.java delete mode 100644 src/main/java/cokr/xit/ens/modules/example/thread/TaskCallableExample.java delete mode 100644 src/main/java/cokr/xit/ens/modules/example/thread/TaskDtoSample.java delete mode 100644 src/main/java/cokr/xit/ens/modules/example/thread/TaskRunnableReturnSample.java delete mode 100644 src/main/java/cokr/xit/ens/modules/example/thread/TaskRunnableSample.java diff --git a/src/main/java/cokr/xit/ens/modules/example/api/ClientController.java b/src/main/java/cokr/xit/ens/modules/example/api/ClientController.java deleted file mode 100644 index b09bc84..0000000 --- a/src/main/java/cokr/xit/ens/modules/example/api/ClientController.java +++ /dev/null @@ -1,110 +0,0 @@ -package cokr.xit.ens.modules.example.api; - -import cokr.xit.ens.core.exception.EnsException; -import cokr.xit.ens.core.exception.code.EnsErrCd; -import cokr.xit.ens.core.utils.CmmnUtil; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -@Slf4j -@RestController -public class ClientController { - - @Value("${contract.kakao.pay.mydoc.access-token}") - private String ACCESS_TOKEN; - private String HOST = "http://localhost:18090" ; - - @PostMapping("/example/client/ok") - private ResponseEntity ok(@RequestBody Map reqDTO ) throws Exception { - if(reqDTO ==null) - reqDTO = createParam(); - - log.info(String.format("called %s.%s", getClass().getName(), new Object() {}.getClass().getEnclosingMethod().getName())); - log.info(String.format("request parameters... %s", CmmnUtil.toJsonString(reqDTO))); - - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON_UTF8); - ResponseEntity resp = this.sendData(HttpMethod.POST, "/example/server/ok", CmmnUtil.toJsonString(reqDTO), headers); - - String body = resp.getBody(); - log.info(String.format("body:::%s", body)); - return resp; - } - @PostMapping("/example/client/err400") - private ResponseEntity err400(@RequestBody Map reqDTO ) throws Exception { - - log.info(String.format("called %s.%s", getClass().getName(), new Object() {}.getClass().getEnclosingMethod().getName())); - log.info(String.format("request parameters... \n%s", CmmnUtil.toJsonString(reqDTO))); - - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON_UTF8); - ResponseEntity resp = this.sendData(HttpMethod.POST, "/example/server/err400", CmmnUtil.toJsonString(reqDTO), headers); - - return resp; - - } - @PostMapping("/example/client/err500") - private ResponseEntity err500(@RequestBody Map reqDTO ) throws Exception { - - log.info(String.format("called %s.%s", getClass().getName(), new Object() {}.getClass().getEnclosingMethod().getName())); - log.info(String.format("request parameters... %s", CmmnUtil.toJsonString(reqDTO))); - - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON_UTF8); - ResponseEntity resp = this.sendData(HttpMethod.POST, "/example/server/err500", CmmnUtil.toJsonString(reqDTO), headers); - - return resp; - - } - - private Map createParam() { - - Map data = new HashMap<>(); - data.put("param1", 123); - data.put("param2", "abc"); - data.put("param3", 10L); - - return data; - } - - /** - * 데이터 전송 - * @param method - * @param uri - * @param param - * @param headers - * @return - * @throws Exception - */ - @SuppressWarnings({ "unchecked" }) - protected ResponseEntity sendData(HttpMethod method, String uri, String param, HttpHeaders headers) throws Exception{ - if((this.ACCESS_TOKEN == null || this.ACCESS_TOKEN.length() < 5) && !uri.endsWith("ping")) //ping 확인 서비스를 제외한 서비스에 대해 엑세스토큰이 없을 경우.. - throw new IOException("AccessToken is null!"); - - - if(headers==null) - headers = new HttpHeaders(); - headers.set("Authorization", String.format("Bearer %s", this.ACCESS_TOKEN)); //access token 설정 - - - Map resp = CmmnUtil.callApi(method, this.HOST+uri, param, headers); - - - - if(!"OK".equals(resp.get("resCd"))) - throw new EnsException(EnsErrCd.valueOf((String) resp.get("resCd")), String.format("API 호출 실패. %s", resp.get("resMsg"))); - - return (ResponseEntity) resp.get("responseEntity"); - } -} diff --git a/src/main/java/cokr/xit/ens/modules/example/api/ServerController.java b/src/main/java/cokr/xit/ens/modules/example/api/ServerController.java deleted file mode 100644 index 6775e63..0000000 --- a/src/main/java/cokr/xit/ens/modules/example/api/ServerController.java +++ /dev/null @@ -1,63 +0,0 @@ -package cokr.xit.ens.modules.example.api; - -import cokr.xit.ens.core.utils.CmmnUtil; -import lombok.extern.slf4j.Slf4j; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -import java.util.HashMap; -import java.util.Map; - -@Slf4j -@RestController -public class ServerController { - - - @PostMapping("/example/server/ok") - private ResponseEntity> ok(@RequestBody Map reqDTO ) { - - log.info(String.format("called %s.%s", getClass().getName(), new Object() {}.getClass().getEnclosingMethod().getName())); - log.info(String.format("request parameters... %s", CmmnUtil.toJsonString(reqDTO))); - - ResponseEntity> resp = new ResponseEntity>(this.createBody(), HttpStatus.OK); - - return resp; - } - @PostMapping("/example/server/err400") - private ResponseEntity> err400(@RequestBody Map reqDTO ) { - - log.info(String.format("called %s.%s", getClass().getName(), new Object() {}.getClass().getEnclosingMethod().getName())); - log.info(String.format("request parameters... \n%s", CmmnUtil.toJsonString(reqDTO))); - - ResponseEntity> resp = new ResponseEntity>(this.createBody(), HttpStatus.BAD_REQUEST); - - return resp; - - } - @PostMapping("/example/server/err500") - private ResponseEntity> err500(@RequestBody Map reqDTO ) { - - log.info(String.format("called %s.%s", getClass().getName(), new Object() {}.getClass().getEnclosingMethod().getName())); - log.info(String.format("request parameters... %s", CmmnUtil.toJsonString(reqDTO))); - - ResponseEntity> resp = new ResponseEntity>(this.createBody(), HttpStatus.INTERNAL_SERVER_ERROR); - - return resp; - - } - - private Map createBody() { - Map data = new HashMap<>(); - data.put("param1", 123); - data.put("param2", "abc"); - data.put("param3", 10L); - - - Map resultMap = new HashMap(); - resultMap.put("data", data); - return resultMap; - } -} diff --git a/src/main/java/cokr/xit/ens/modules/example/thread/Calculator.java b/src/main/java/cokr/xit/ens/modules/example/thread/Calculator.java deleted file mode 100644 index f68bf28..0000000 --- a/src/main/java/cokr/xit/ens/modules/example/thread/Calculator.java +++ /dev/null @@ -1,14 +0,0 @@ -package cokr.xit.ens.modules.example.thread; - - -public class Calculator{ - private int index; - - public Calculator(int index) { - this.index = index; - } - - public synchronized int getNextIndex() { - return ++index; - } -} diff --git a/src/main/java/cokr/xit/ens/modules/example/thread/MultiThreadSample.java b/src/main/java/cokr/xit/ens/modules/example/thread/MultiThreadSample.java deleted file mode 100644 index 457271c..0000000 --- a/src/main/java/cokr/xit/ens/modules/example/thread/MultiThreadSample.java +++ /dev/null @@ -1,288 +0,0 @@ -package cokr.xit.ens.modules.example.thread; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.Callable; -import java.util.concurrent.CompletionService; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorCompletionService; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class MultiThreadSample { - - /** - *
메소드 설명: Multi Thread 예제
- * @throws InterruptedException - * @throws ExecutionException void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2021. 8. 30. - */ - public static void example() throws InterruptedException, ExecutionException { - - long startTme = System.currentTimeMillis(); - - Calculator calculrator = new Calculator(0); - HashSet set1 = new HashSet(); - HashSet set2 = new HashSet(); - - Callable callable1 = () -> { - for(int i=0; i<50; i++) { - set1.add(calculrator.getNextIndex()); - log.info(String.format("callable1 => %05d", i)); -// Thread.sleep(500); - } - return null; - }; - Callable callable2 = () -> { - for(int i=0; i<100; i++) { - set2.add(calculrator.getNextIndex()); - log.info(String.format("callable2 => %05d", i)); - Thread.sleep(300); - } - return null; - }; - - - ExecutorService executorService = Executors.newFixedThreadPool(3); - Future future1 = executorService.submit(callable1); - Future future2 = executorService.submit(callable2); - future1.get(); - future2.get(); - - - if(future1.isDone() && future2.isDone()) { - System.out.println(set1.size()); - System.out.println(set2.size()); - } - - executorService.shutdown(); //executor 종료 - log.info(String.format("Executor Shutdown => %s", executorService.isShutdown())); - - long endTme = System.currentTimeMillis(); - log.info(String.format("수행시간::: %s seconds...", (endTme-startTme)/1000) ); - } - - - - - - - - - /** - *
메소드 설명: Multi Thread 결과 리턴 예제
-	 * 	-.runable로 작성한 Task를 호출하여 공유객체에 결과를 return 받는다.
-	 * 
- * @throws InterruptedException - * @throws ExecutionException void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2021. 8. 30. - */ - @SuppressWarnings("unchecked") - public static void runnableExample() throws InterruptedException, ExecutionException { - - long startTme = System.currentTimeMillis(); - - - List result = new ArrayList(); - for(int i=0; i<102; i++) { - TaskDtoSample dto = new TaskDtoSample(); - dto.setId(i); - result.add(dto); - } - - //thread 갯수 설정 - int unitSize = Runtime.getRuntime().availableProcessors(); - int cntDiv = result.size()/unitSize; - int cntMod = result.size()%unitSize; - int cntThread = cntDiv+(cntMod>0?1:0); - ExecutorService executorService = Executors.newFixedThreadPool(cntThread); - - //Task 단위별 실행 - List listFuture = new ArrayList<>(); //future 목록 - for(int i=0; i taskList = null; - if(i==cntThread-1) - taskList = result.subList(i*unitSize, cntMod>0?result.size():(i+1)*unitSize); - else - taskList = result.subList(i*unitSize, (i+1)*unitSize); - - Runnable task = new TaskRunnableReturnSample(taskList, "task"+i); - listFuture.add(executorService.submit(task, result)); //task 작업 실행 - } - - //task block 처리 - Iterator it = listFuture.iterator(); - while(it.hasNext()) { - Future> future = it.next(); - List list = future.get(); - - System.out.println(String.format("결과건수=%s", list.size())); - System.out.println(String.format("결과=%s", list.toString())); - -// long endTme = System.currentTimeMillis(); -// log.info(String.format("수행시간::: %s seconds...", (endTme-startTme)/1000) ); - } - - -// for(TaskReturnDtoSample row : result) -// log.info(String.format("수행결과::: %s ", row.getResult())); - - - -// boolean isShutdown = executorService.isShutdown(); -// List listRunnable = executorService.shutdownNow() ; -// executorService.shutdown(); -// isShutdown = executorService.isShutdown(); -// boolean isTerminated = executorService.isTerminated(); -// boolean isIdle = executorService.awaitTermination(30, TimeUnit.SECONDS); - - executorService.shutdown(); //executor 종료 - log.info(String.format("Executor Shutdown => %s", executorService.isShutdown())); - - long endTme = System.currentTimeMillis(); - log.info(String.format("수행시간::: %s seconds...", (endTme-startTme)/1000) ); - } - - - - /** - *
메소드 설명: Multi Thread 예제
-	 * 	-.callable로 작성한 Task를 호출하여 Task 처리단위별 결과를 return 받는다.
-	 * 
- * @throws InterruptedException - * @throws ExecutionException void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2021. 8. 30. - */ - public static void callableExample() throws InterruptedException, ExecutionException { - - long startTme = System.currentTimeMillis(); - - - List result = new ArrayList(); - for(int i=0; i<102; i++) { - TaskDtoSample dto = new TaskDtoSample(); - dto.setId(i); - result.add(dto); - } - - //thread 갯수 설정 -// int unitSize = Runtime.getRuntime().availableProcessors(); - int unitSize = 10; - int cntDiv = result.size()/unitSize; - int cntMod = result.size()%unitSize; - int cntThread = cntDiv+(cntMod>0?1:0); - ExecutorService executorService = Executors.newFixedThreadPool(cntThread); - List listFuture = new ArrayList<>(); //future 목록 - - //Task 단위별 실행 - for(int i=0; i taskList = null; - if(i==cntThread-1) - taskList = result.subList(i*unitSize, cntMod>0?result.size():(i+1)*unitSize); - else - taskList = result.subList(i*unitSize, (i+1)*unitSize); - - Callable> task = new TaskCallableExample(taskList); - listFuture.add(executorService.submit(task)); //task 작업 실행 - } - - //task block 처리 - Iterator it = listFuture.iterator(); - while(it.hasNext()) { - Future> future = it.next(); - List list = future.get(); - System.out.println(String.format("결과건수=%s", list.size())); - System.out.println(String.format("결과=%s", list.toString())); - } - - executorService.shutdown(); //executor 종료 - log.info(String.format("Executor Shutdown => %s", executorService.isShutdown())); - - long endTme = System.currentTimeMillis(); - log.info(String.format("수행시간::: %s seconds...", (endTme-startTme)/1000) ); - } - - /** - *
메소드 설명: Multi Thread 예제
-	 * 	-.CompletionService로 Task를 호출 한다.
-	 * 
- * @throws InterruptedException - * @throws ExecutionException void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2021. 8. 30. - */ - public static void completionServiceExample() throws InterruptedException, ExecutionException { - - long startTme = System.currentTimeMillis(); - - - List result = new ArrayList(); - for(int i=0; i<102; i++) { - TaskDtoSample dto = new TaskDtoSample(); - dto.setId(i); - result.add(dto); - } - - //thread 갯수 설정 -// int unitSize = Runtime.getRuntime().availableProcessors(); - int unitSize = 10; - int cntDiv = result.size()/unitSize; - int cntMod = result.size()%unitSize; - int cntThread = cntDiv+(cntMod>0?1:0); - ExecutorService executorService = Executors.newFixedThreadPool(cntThread); - CompletionService completionService = new ExecutorCompletionService(executorService); - List listFuture = new ArrayList<>(); //future 목록 - - //Task 단위별 실행 - for(int i=0; i taskList = null; - if(i==cntThread-1) - taskList = result.subList(i*unitSize, cntMod>0?result.size():(i+1)*unitSize); - else - taskList = result.subList(i*unitSize, (i+1)*unitSize); - - Callable> task = new TaskCallableExample(taskList); - listFuture.add(completionService.submit(task)); //task 작업 실행 - } - - //task block 처리-Case1. 순차 처리 -// Iterator it = listFuture.iterator(); -// while(it.hasNext()) { -// Future> future = it.next(); -// List list = future.get(); -// System.out.println(String.format("결과건수=%s", list.size())); -// System.out.println(String.format("결과=%s", list.toString())); -// } - //task block 처리-Case2. 비순차 처리 - int complete = 0; - while (true) { - if(complete == cntThread) - break; -// Future future = completionService.poll(); -// Future future = completionService.poll(30, TimeUnit.SECONDS); - Future future = completionService.take(); - if(future.isDone()) - complete++; - List list = (List) future.get(); - System.out.println(String.format("결과건수=%s", list.size())); - System.out.println(String.format("결과=%s", list.toString())); - } - - executorService.shutdown(); //executor 종료 - log.info(String.format("Executor Shutdown => %s", executorService.isShutdown())); - - - long endTme = System.currentTimeMillis(); - log.info(String.format("수행시간::: %s seconds...", (endTme-startTme)/1000) ); - } -} - diff --git a/src/main/java/cokr/xit/ens/modules/example/thread/ResultByRunnableExample.java b/src/main/java/cokr/xit/ens/modules/example/thread/ResultByRunnableExample.java deleted file mode 100644 index 9367a9d..0000000 --- a/src/main/java/cokr/xit/ens/modules/example/thread/ResultByRunnableExample.java +++ /dev/null @@ -1,73 +0,0 @@ -package cokr.xit.ens.modules.example.thread; - -import java.util.concurrent.ExecutorService; - -import java.util.concurrent.Executors; - -import java.util.concurrent.Future; - - - -public class ResultByRunnableExample { - - public static void main(String[] args) { - - ExecutorService executorService = Executors.newFixedThreadPool( Runtime.getRuntime().availableProcessors() ); - System.out.println("[작업 처리 요청]"); - - class Task implements Runnable { - Result result; - Task(Result result) { - this.result = result; - } - @Override - public void run() { - int sum = 0; - for(int i=1; i<=10; i++) { - sum += i; - } - result.addValue(sum); - } - - } - - - Result result = new Result(); - Runnable task1 = new Task(result); - Runnable task2 = new Task(result); - Future future1 = executorService.submit(task1, result); - Future future2 = executorService.submit(task2, result); - - - try { - result = future1.get(); - result = future2.get(); - System.out.println("[처리 결과] " + result.accumValue); - System.out.println("[작업 처리 완료]"); - } catch (Exception e) { - e.printStackTrace(); - System.out.println("[실행 예외 발생함] " + e.getMessage()); - } - - - executorService.shutdown(); - - } - -} - - - -class Result { - - int accumValue; - - synchronized void addValue(int value) { - - accumValue += value; - -} - - - -} \ No newline at end of file diff --git a/src/main/java/cokr/xit/ens/modules/example/thread/TaskCallableExample.java b/src/main/java/cokr/xit/ens/modules/example/thread/TaskCallableExample.java deleted file mode 100644 index c7845cb..0000000 --- a/src/main/java/cokr/xit/ens/modules/example/thread/TaskCallableExample.java +++ /dev/null @@ -1,35 +0,0 @@ -package cokr.xit.ens.modules.example.thread; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Callable; - -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class TaskCallableExample implements Callable> { - - private List trgetList; - - TaskCallableExample(List trgetList){ - this.trgetList = trgetList; - } - - @Override - public List call() throws Exception { - List rsList = new ArrayList(); - for(TaskDtoSample row : trgetList) { -// if(row.getId()>99&&row.getId()<102) -// throw new RuntimeException("Exception"); - row.setResult(String.format("getId => %05d. current thread name is\"%s\". ", row.getId(), Thread.currentThread().getName())); - rsList.add(row); - log.info(String.format("getId => %05d. current thread name is \"%s\". ", row.getId(), Thread.currentThread().getName())); - Thread.sleep(500); - } - - log.info(String.format("%s ID is \"%s\"", Thread.currentThread().getName(), Thread.currentThread().getId())); - - return rsList; - } - -} diff --git a/src/main/java/cokr/xit/ens/modules/example/thread/TaskDtoSample.java b/src/main/java/cokr/xit/ens/modules/example/thread/TaskDtoSample.java deleted file mode 100644 index f33f11f..0000000 --- a/src/main/java/cokr/xit/ens/modules/example/thread/TaskDtoSample.java +++ /dev/null @@ -1,11 +0,0 @@ -package cokr.xit.ens.modules.example.thread; - -import lombok.Data; - -@Data -public class TaskDtoSample { - - private int id; - - private String result; -} diff --git a/src/main/java/cokr/xit/ens/modules/example/thread/TaskRunnableReturnSample.java b/src/main/java/cokr/xit/ens/modules/example/thread/TaskRunnableReturnSample.java deleted file mode 100644 index 002856a..0000000 --- a/src/main/java/cokr/xit/ens/modules/example/thread/TaskRunnableReturnSample.java +++ /dev/null @@ -1,43 +0,0 @@ -package cokr.xit.ens.modules.example.thread; - -import java.util.List; - -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class TaskRunnableReturnSample implements Runnable{ - - List trgetList; - List result; - String taskNm; - - TaskRunnableReturnSample(List result, String taskNm){ - this.result = result; - this.taskNm = taskNm; - } - @Override - public void run() { - int scnd = 1000; -// int scnd = 500; -// if(taskNm.endsWith("2")) -// scnd = 100; - for(TaskDtoSample row : result) { - try { -// if(row.getId()>99&&row.getId()<102) -// throw new RuntimeException("Exception"); - row.setResult(String.format("%s => %05d", taskNm, row.getId())); - log.info(String.format("%s => %05d", taskNm, row.getId())); - } catch (Exception e) { - log.error(String.format("task id is %s trget Id \"%s\". error 발생:::%s", taskNm, row.getId(), e.getMessage())); - } - - try { - Thread.sleep(scnd); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - } - - }; -} diff --git a/src/main/java/cokr/xit/ens/modules/example/thread/TaskRunnableSample.java b/src/main/java/cokr/xit/ens/modules/example/thread/TaskRunnableSample.java deleted file mode 100644 index 3d69c8a..0000000 --- a/src/main/java/cokr/xit/ens/modules/example/thread/TaskRunnableSample.java +++ /dev/null @@ -1,33 +0,0 @@ -package cokr.xit.ens.modules.example.thread; - -import java.util.List; - -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class TaskRunnableSample implements Runnable{ - - List result; - String taskNm; - - TaskRunnableSample(List result, String taskNm){ - this.result = result; - this.taskNm = taskNm; - } - @Override - public void run() { - int scnd = 500; - if(taskNm.endsWith("2")) - scnd = 100; - for(int i=0; i<50; i++) { - result.add(String.format("%s => %05d", taskNm, i)); - log.info(String.format("%s => %05d", taskNm, i)); - try { - Thread.sleep(scnd); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - }; - -}