|| report.getDimensionType() != DimensionType.SCALAR) {
// Resume the DAO if they were suspended.
// Also, it makes the DAO factory initialize them and store them in the cache if
// this was not done already, lessening the work done on the EDT.
AbstractDAOFactory factory = DAOFactoryManager
.registerFactory(factoryClassName);
switch (dimensionType) {
case SCALAR:
readDao = ((ASensorDAO<?>) factory.createNumberDAO(sensorKRead));
writeDao = ((ASensorDAO<?>) factory.createNumberDAO(sensorKWrite));
break;
case SPECTRUM:
readDao = ((ASensorDAO<?>) factory
.createNumberDataArrayDAO(sensorKRead));
writeDao = ((ASensorDAO<?>) factory
.createNumberDataArrayDAO(sensorKWrite));
break;
case IMAGE:
readDao = ((ASensorDAO<?>) factory.createNumberImageDAO(sensorKRead));
writeDao = ((ASensorDAO<?>) factory.createNumberImageDAO(sensorKWrite));
break;
default:
// Normally impossible.
throw new RuntimeException("Unknown dimension type.");
}
stateDao = ((SensorStateDAO) factory.createStringDAO(sensorStateKey));
readDao.setAutoRefresh(true);
writeDao.setAutoRefresh(true);
stateDao.setAutoRefresh(true);