| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 |
Tags
- sencha touch
- 가우스
- JSON
- iBATIS
- appspresso
- node.js
- PHP
- swingx
- WebLogic
- dock
- Ajax
- 전자정부프레임워크
- Google Map
- jsr 296
- GPS
- MFC
- Eclipse
- phonegap
- 선택적조인
- Spring
- JDOM
- rowspan
- Android
- Struts
- ibsheet
- oracle
- jQuery
- PLSQL
- MySQL
- tomcat
Archives
- Today
- Total
Where The Streets Have No Name
google guava를 이용한 Service 작성 본문
package kr.co.ntcsoft.guava.service.demo;
public class Daemon2 {
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
MyGuavaService2 service = new MyGuavaService2();
service.startAndWait();
}
}
package kr.co.ntcsoft.guava.service.demo;
import com.google.common.util.concurrent.AbstractExecutionThreadService;
public class MyGuavaService2 extends AbstractExecutionThreadService {
@Override
protected void run() throws Exception {
while (isRunning() && !Thread.currentThread().isInterrupted()) {
String[] cmd = {"C:\\Windows\\System32\\cscript.exe", "C:\\wamp\\www\\doc_convert\\xls2image.vbs", "C:\\wamp\\www\\doc_convert\\aa.xlsx" };
Process p = Runtime.getRuntime().exec(cmd);
p.waitFor();
System.out.println("run...");
Thread.sleep(5 * 1000);
}
}
@Override
protected void startUp() throws Exception {
super.startUp();
System.out.println("startUp...");
}
}