1 21 package com.essiembre.library.scheduler; 22 23 24 import java.util.Enumeration ; 25 import java.util.Hashtable ; 26 import java.util.Map ; 27 import java.util.TimerTask ; 28 import java.util.Vector ; 29 30 import javax.servlet.ServletConfig ; 31 32 import org.exolab.castor.mapping.MapItem; 33 34 35 43 public abstract class SchedulerTask 44 extends TimerTask { 45 46 47 private final Map initParameters = new Hashtable (); 48 49 50 private ServletConfig servletConfig; 51 52 55 public SchedulerTask() { 56 super(); 57 } 58 59 63 public ServletConfig getServletConfig() { 64 return servletConfig; 65 } 66 67 71 public void setServletConfig(ServletConfig servletConfig) { 72 this.servletConfig = servletConfig; 73 } 74 75 82 public String getInitParameter(String paramName) { 83 return (String ) initParameters.get(paramName); 84 } 85 86 91 public Enumeration getInitParameterNames() { 92 return ((Hashtable ) initParameters).keys(); 93 } 94 95 100 protected void setInitParameters(Vector initParameters) { 101 for (int i = 0; i < initParameters.size(); i++) { 102 MapItem mapItem = (MapItem) initParameters.get(i); 103 this.initParameters.put(mapItem.getKey(), mapItem.getValue()); 104 } 105 } 106 107 108 } | Popular Tags |