Subversion Repositories XServices

Rev

Rev 198 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 198 Rev 199
Line 21... Line 21...
21
import java.util.Enumeration;
21
import java.util.Enumeration;
22
import java.util.List;
22
import java.util.List;
23
import java.util.concurrent.ExecutorService;
23
import java.util.concurrent.ExecutorService;
24
import javax.servlet.ServletException;
24
import javax.servlet.ServletException;
25
import javax.servlet.http.HttpServlet;
25
import javax.servlet.http.HttpServlet;
-
 
26
 
-
 
27
import lombok.extern.slf4j.Slf4j;
26
import net.brutex.xservices.types.scm.ObjectFactory;
28
import net.brutex.xservices.types.scm.ObjectFactory;
27
import org.apache.logging.log4j.LogManager;
-
 
28
import org.apache.logging.log4j.Logger;
-
 
-
 
29
 
Line 29... Line 30...
29
 
30
 
30
/**
31
/**
31
 * @author Brian Rosenberger, bru(at)brutex.de
32
 * @author Brian Rosenberger, bru(at)brutex.de
32
 *
33
 *
Line 33... Line 34...
33
 */
34
 */
34
 
35
 
35
 
36
@Slf4j
36
public class CacheServlet extends HttpServlet
-
 
37
{
37
public class CacheServlet extends HttpServlet
38
	private static final Logger logger = LogManager.getLogger();
38
{
39
  List<File> configfiles = new ArrayList<File>();
39
  List<File> configfiles = new ArrayList<File>();
Line 40... Line 40...
40
  int cacheinterval;
40
  int cacheinterval;
Line 52... Line 52...
52
    while (attributes.hasMoreElements()) {
52
    while (attributes.hasMoreElements()) {
53
      String name = (String)attributes.nextElement();
53
      String name = (String)attributes.nextElement();
54
      if (name.startsWith("cvs-config-")) {
54
      if (name.startsWith("cvs-config-")) {
55
        String configfile = getServletContext()
55
        String configfile = getServletContext()
56
          .getInitParameter(name);
56
          .getInitParameter(name);
57
        this.logger.info("CVS configuration file: " + configfile);
57
        log.info("CVS configuration file: {}", configfile);
58
        this.configfiles.add(new File(configfile));
58
        this.configfiles.add(new File(configfile));
59
      }
59
      }
60
    }
60
    }
61
    this.cacheinterval = 15;
61
    this.cacheinterval = 15;
62
    try {
62
    try {
63
      this.cacheinterval = Integer.parseInt(getServletContext()
63
      this.cacheinterval = Integer.parseInt(getServletContext()
64
        .getInitParameter("cvs-cache-interval"));
64
        .getInitParameter("cvs-cache-interval"));
65
    } catch (NumberFormatException e) {
65
    } catch (NumberFormatException e) {
66
      this.logger.debug("Could not read parameter 'cvs-cache-interval' from web.xml. Using default value '" + this.cacheinterval + "' minutes");
66
      log.debug("Could not read parameter 'cvs-cache-interval' from web.xml. Using default value '{}' minutes",  this.cacheinterval );
67
    }
67
    }
68
    this.logger.info("CacheServlet set to " + this.cacheinterval + " minutes interval.");
68
    log.info("CacheServlet set to '{}' minutes interval.", this.cacheinterval);
69
  }
69
  }
70
}
70
}