1 16 package scriptella.execution; 17 18 import scriptella.core.Session; 19 import scriptella.interactive.ProgressCallback; 20 import scriptella.spi.DriverContext; 21 import scriptella.spi.ParametersCallback; 22 23 import java.net.MalformedURLException ; 24 import java.net.URL ; 25 26 27 37 public class EtlContext implements ParametersCallback, DriverContext { 38 private ProgressCallback progressCallback; 39 private ParametersCallback properties; 40 private URL baseURL; 41 private ExecutionStatisticsBuilder statisticsBuilder = new ExecutionStatisticsBuilder(); 42 Session session; 44 public Object getParameter(final String name) { 45 return properties.getParameter(name); 46 } 47 48 public ProgressCallback getProgressCallback() { 49 return progressCallback; 50 } 51 52 void setProgressCallback(final ProgressCallback progressCallback) { 53 this.progressCallback = progressCallback; 54 } 55 56 60 void setProperties(ParametersCallback properties) { 61 this.properties = properties; 62 } 63 64 65 public URL getScriptFileURL() { 66 return baseURL; 67 } 68 69 void setBaseURL(final URL baseURL) { 70 this.baseURL = baseURL; 71 } 72 73 public URL resolve(final String uri) throws MalformedURLException { 74 return new URL (baseURL, uri); 75 } 76 77 78 public ExecutionStatisticsBuilder getStatisticsBuilder() { 79 return statisticsBuilder; 80 } 81 82 public Session getSession() { 83 return session; 84 } 85 86 } 87 | Popular Tags |