1 |
|
package eu.etaxonomy.cdm.api.application;
|
2 |
|
|
3 |
|
import java.util.List;
|
4 |
|
|
5 |
|
import org.apache.log4j.Logger;
|
6 |
|
import org.springframework.context.ApplicationListener;
|
7 |
|
import org.springframework.core.io.ClassPathResource;
|
8 |
|
import org.springframework.core.io.Resource;
|
9 |
|
|
10 |
|
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
|
11 |
|
import eu.etaxonomy.cdm.database.DbSchemaValidation;
|
12 |
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
13 |
|
|
14 |
|
public class CdmIoApplicationController extends CdmApplicationController {
|
15 |
|
@SuppressWarnings("unused")
|
16 |
|
private static final Logger logger = Logger.getLogger(CdmIoApplicationController.class);
|
17 |
|
|
18 |
|
|
19 |
|
public static final String DEFAULT_APPLICATION_CONTEXT_RESOURCE = "/eu/etaxonomy/cdm/defaultIoApplicationContext.xml";
|
20 |
|
|
21 |
|
protected CdmIoApplicationController(Resource applicationContextResource, ICdmDataSource dataSource, DbSchemaValidation dbSchemaValidation,
|
22 |
|
boolean omitTermLoading, IProgressMonitor progressMonitor) {
|
23 |
|
super(applicationContextResource, dataSource, dbSchemaValidation,
|
24 |
|
omitTermLoading, progressMonitor, null);
|
25 |
|
|
26 |
|
}
|
27 |
|
|
28 |
|
|
29 |
|
public static CdmIoApplicationController NewInstance() {
|
30 |
|
return CdmIoApplicationController.NewInstance(getDefaultDatasource(), defaultDbSchemaValidation, false);
|
31 |
|
}
|
32 |
|
|
33 |
|
public static CdmIoApplicationController NewInstance(DbSchemaValidation dbSchemaValidation) {
|
34 |
|
return CdmIoApplicationController.NewInstance(getDefaultDatasource(), dbSchemaValidation, false);
|
35 |
|
}
|
36 |
|
/**
|
37 |
|
* Constructor, opens an spring ApplicationContext by using the according data source and the
|
38 |
|
* default database schema validation type
|
39 |
|
* @param dataSource
|
40 |
|
*/
|
41 |
|
public static CdmIoApplicationController NewInstance(ICdmDataSource dataSource) {
|
42 |
|
return (CdmIoApplicationController) CdmIoApplicationController.NewInstance(getClasspathResource(), dataSource, defaultDbSchemaValidation, false);
|
43 |
|
}
|
44 |
|
|
45 |
|
|
46 |
|
public static CdmIoApplicationController NewInstance(ICdmDataSource dataSource, DbSchemaValidation dbSchemaValidation) {
|
47 |
|
return (CdmIoApplicationController) CdmIoApplicationController.NewInstance(getClasspathResource(), dataSource, dbSchemaValidation, false);
|
48 |
|
}
|
49 |
|
|
50 |
|
public static CdmIoApplicationController NewInstance(ICdmDataSource dataSource, DbSchemaValidation dbSchemaValidation, boolean omitTermLoading) {
|
51 |
|
return (CdmIoApplicationController) CdmIoApplicationController.NewInstance(getClasspathResource(), dataSource, dbSchemaValidation, omitTermLoading);
|
52 |
|
}
|
53 |
|
|
54 |
|
/**
|
55 |
|
* @return
|
56 |
|
*/
|
57 |
|
protected static ClassPathResource getClasspathResource() {
|
58 |
|
return new ClassPathResource(DEFAULT_APPLICATION_CONTEXT_RESOURCE);
|
59 |
|
}
|
60 |
|
|
61 |
|
}
|
bugfix for IOApplicatonControler static methods