1
14
15 package com.liferay.portal.kernel.deploy.auto;
16
17
23 public class AutoDeployScanner extends Thread {
24
25 public AutoDeployScanner(
26 ThreadGroup threadGroup, String name, AutoDeployDir autoDeployDir) {
27
28 super(threadGroup, name);
29
30 _autoDeployDir = autoDeployDir;
31
32 setContextClassLoader(getClass().getClassLoader());
33 setDaemon(true);
34 setPriority(MIN_PRIORITY);
35 }
36
37 public void run() {
38 try {
39 sleep(1000 * 10);
40 }
41 catch (InterruptedException ie) {
42 }
43
44 while (_started) {
45 try {
46 sleep(_autoDeployDir.getInterval());
47 }
48 catch (InterruptedException ie) {
49 }
50
51 _autoDeployDir.scanDirectory();
52 }
53 }
54
55 public void pause() {
56 _started = false;
57 }
58
59 private AutoDeployDir _autoDeployDir;
60 private boolean _started = true;
61
62 }