ItEr20S04ArquitecturaServidorItEr19S04: Erasing not used methods from Registry. They will be added as needed.

This commit is contained in:
Óscar González Fernández 2009-08-07 18:09:31 +02:00
parent db7a75fbb0
commit 5ee30eb5eb

View file

@ -1,72 +1,32 @@
package org.navalplanner.business.common;
import org.navalplanner.business.advance.daos.IAdvanceAssigmentDAO;
import org.navalplanner.business.advance.daos.IAdvanceMeasurementDAO;
import org.navalplanner.business.advance.daos.IAdvanceTypeDAO;
import org.navalplanner.business.workreports.daos.IWorkReportDAO;
import org.navalplanner.business.workreports.daos.IWorkReportLineDAO;
import org.navalplanner.business.workreports.daos.IWorkReportTypeDAO;
import org.springframework.beans.factory.annotation.Autowired;
/**
* A registry, AKA service locator, for objects in which dependency injection
* (DI) is not directly supported by Spring (e.g. entities) must use this class
* to access DAOs. For the rest of classes (e.g. services, tests, etc.), Spring
* DI is a more convenient option.
* DI is a more convenient option. The DAOs or services are added to the
* registry as needed.
* @author Óscar González Fernández <ogonzalez@igalia.com>
*/
public class Registry {
private static final Registry singleton = new Registry();
@Autowired
private IWorkReportDAO workReport;
@Autowired
private IWorkReportTypeDAO workReportType;
@Autowired
private IWorkReportLineDAO workReportLine;
@Autowired
private IAdvanceAssigmentDAO advanceAssigmentDao;
@Autowired
private IAdvanceTypeDAO advanceTypeDao;
@Autowired
private IAdvanceMeasurementDAO advanceMeasurementDao;
private Registry() {
}
public static Registry getInstance() {
return singleton;
}
public static IWorkReportDAO getWorkReportDao() {
return getInstance().workReport;
}
public static IWorkReportTypeDAO getWorkReportTypeDao() {
return getInstance().workReportType;
}
public static IWorkReportLineDAO getWorkReportLineDao() {
return getInstance().workReportLine;
}
public static IAdvanceMeasurementDAO getAdvanceMeasurementDao() {
return getInstance().advanceMeasurementDao;
}
public static IAdvanceTypeDAO getAdvanceTypeDao() {
return getInstance().advanceTypeDao;
}
public static IAdvanceAssigmentDAO getAdvanceAssigmentDao() {
return getInstance().advanceAssigmentDao;
}
}