001
014
015 package com.liferay.portal.kernel.deploy.auto;
016
017
021 public class AutoDeployScanner extends Thread {
022
023 public AutoDeployScanner(
024 ThreadGroup threadGroup, String name, AutoDeployDir autoDeployDir) {
025
026 super(threadGroup, name);
027
028 _autoDeployDir = autoDeployDir;
029
030 setContextClassLoader(getClass().getClassLoader());
031 setDaemon(true);
032 setPriority(MIN_PRIORITY);
033 }
034
035 public void run() {
036 try {
037 sleep(1000 * 10);
038 }
039 catch (InterruptedException ie) {
040 }
041
042 while (_started) {
043 try {
044 sleep(_autoDeployDir.getInterval());
045 }
046 catch (InterruptedException ie) {
047 }
048
049 _autoDeployDir.scanDirectory();
050 }
051 }
052
053 public void pause() {
054 _started = false;
055 }
056
057 private AutoDeployDir _autoDeployDir;
058 private boolean _started = true;
059
060 }