View Javadoc

1   package org.whatsitcalled.webflange;
2   
3   import org.whatsitcalled.spring.SpringContextUtil;
4   import org.whatsitcalled.webflange.engine.GrinderTestRunner;
5   import org.whatsitcalled.webflange.engine.TestScheduler;
6   import org.whatsitcalled.webflange.file.FileManager;
7   import org.whatsitcalled.webflange.model.ChartDAO;
8   import org.whatsitcalled.webflange.model.LoadTestDAO;
9   import org.whatsitcalled.webflange.model.LoadTestRunDAO;
10  import org.whatsitcalled.webflange.model.LoadTestSummaryDAO;
11  import org.whatsitcalled.webflange.model.ProjectDAO;
12  import org.whatsitcalled.webflange.model.ScriptDAO;
13  import org.whatsitcalled.webflange.service.ChartService;
14  import org.whatsitcalled.webflange.service.LoadTestService;
15  import org.whatsitcalled.webflange.service.ProjectService;
16  import org.whatsitcalled.webflange.service.ScriptService;
17  import org.whatsitcalled.webflange.service.TestService;
18  
19  public final class ResourceFactory {
20  	
21  	public static final TestScheduler getTestScheduler() {
22  		return (TestScheduler)SpringContextUtil.getApplicationContext().getBean("testScheduler");
23  	}
24  	
25  	public static final LoadTestDAO getLoadTestDAO() {
26  		return (LoadTestDAO) SpringContextUtil.getApplicationContext().getBean("loadTestDAO");
27  	}
28  	
29  	public static final ProjectDAO getProjectDAO() {
30  		return (ProjectDAO) SpringContextUtil.getApplicationContext().getBean("projectDAO");
31  	}
32  	
33  	//TODO remove all references to getScriptDAO and call getScriptService
34  	public static final ScriptDAO getScriptDAO() {
35  		return (ScriptDAO) SpringContextUtil.getApplicationContext().getBean("scriptDAO");
36  	}
37  	
38  	public static final FileManager getFileManager() {
39  		return (FileManager) SpringContextUtil.getApplicationContext().getBean("fileManager");
40  	}
41  	
42  	public static final LoadTestSummaryDAO getLoadTestSummaryDAO() {
43  		return (LoadTestSummaryDAO) SpringContextUtil.getApplicationContext().getBean("loadTestSummaryDAO");
44  	}
45  	
46  	public static final LoadTestRunDAO getLoadTestRunDAO() {
47  		return (LoadTestRunDAO) SpringContextUtil.getApplicationContext().getBean("loadTestRunDAO");
48  	}
49  
50  	public static final ChartDAO getChartDAO() {
51  		return (ChartDAO) SpringContextUtil.getApplicationContext().getBean("chartDAO");
52  	}
53  	
54  	public static final ChartService getChartService() {
55  		return (ChartService) SpringContextUtil.getApplicationContext().getBean("chartService");
56  	}
57  
58  	public static final ProjectService getProjectService() {
59  		return (ProjectService) SpringContextUtil.getApplicationContext().getBean("projectService");
60  	}
61  	
62  	public static final ScriptService getScriptService() {
63  		return (ScriptService) SpringContextUtil.getApplicationContext().getBean("scriptService");
64  		
65  	}
66  	
67  	public static final GrinderTestRunner getGrinderTestRunner() {
68  		return (GrinderTestRunner) SpringContextUtil.getApplicationContext().getBean("grinderTestRunner");
69  	}
70  	
71  	public static final LoadTestService getLoadTestService() {
72  		return (LoadTestService) SpringContextUtil.getApplicationContext().getBean("loadTestService");
73  	}
74  	
75  	public static final TestService getTestService() {
76  		return (TestService) SpringContextUtil.getApplicationContext().getBean("testService");
77  	}
78  }