1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
package net.admin4j.dao; |
15 | |
|
16 | |
import net.admin4j.config.Admin4JConfiguration; |
17 | |
import net.admin4j.config.Admin4JConfiguration.StorageFormat; |
18 | |
import net.admin4j.dao.xml.ExceptionInfoDAOXml; |
19 | |
import net.admin4j.dao.xml.TaskTimerDAOXml; |
20 | |
import net.admin4j.util.Admin4jRuntimeException; |
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | 3 | public class DAOFactory { |
28 | |
|
29 | |
public static ExceptionInfoDAO getExceptionInfoDAO() { |
30 | 6 | if (StorageFormat.XML.equals(Admin4JConfiguration.getExceptionInformationStorageFormat())) { |
31 | 3 | return new ExceptionInfoDAOXml(); |
32 | |
} |
33 | 3 | throw new Admin4jRuntimeException("Invalid Exception Storage Format") |
34 | |
.addContextValue("Format", Admin4JConfiguration.getExceptionInformationStorageFormat()); |
35 | |
} |
36 | |
|
37 | |
public static TaskTimerDAO getTaskTimerDAO() { |
38 | 9 | if (StorageFormat.XML.equals(Admin4JConfiguration.getPerformanceInformationStorageFormat())) { |
39 | 6 | return new TaskTimerDAOXml(); |
40 | |
} |
41 | 3 | throw new Admin4jRuntimeException("Invalid Performance Timing Storage Format") |
42 | |
.addContextValue("Format", Admin4JConfiguration.getPerformanceInformationStorageFormat()); |
43 | |
} |
44 | |
|
45 | |
} |