일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- jsr 296
- tomcat
- WebLogic
- 가우스
- 선택적조인
- MFC
- node.js
- JSON
- ibsheet
- PLSQL
- dock
- oracle
- 전자정부프레임워크
- Google Map
- swingx
- appspresso
- Ajax
- Struts
- phonegap
- PHP
- jQuery
- sencha touch
- iBATIS
- GPS
- Android
- Spring
- JDOM
- MySQL
- Eclipse
- rowspan
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...");
}
}