final DeviceRepositoryConfiguration configuration) {
final DeviceRepositoryAccessor result;
if (repository instanceof LocalXMLRepository) {
if (configuration == null) {
result = new JiBXDeviceRepositoryAccessor(
repository, location);
} else {
final XMLDeviceRepositoryConfiguration xmlConfiguration =
((XMLDeviceRepositoryConfiguration) configuration);
result = new JiBXDeviceRepositoryAccessor(repository, location,
xmlConfiguration.getSchemaValidation());
}
} else if (repository instanceof LocalJDBCRepository) {
// todo: update caching in the JDBDeviceRepositoryAccessor
// we could create a JDBCConnectionReleasingDeviceRepositoryAccessor