* @return the desired source
*/
@SuppressWarnings("unchecked")
protected static <U> AbstractDataSource<U> getSource(final IKey key) {
AbstractDataSource<U> result = null;
final IDataSourceProducer producer = DataSourceProducerProvider.getProducer(key
.getSourceProduction());
try {
if (producer == null) {
throw new KeyCompatibilityException(key, producer);
}
result = (AbstractDataSource<U>) producer.createDataSource(key);
}
catch (final Exception e) {
Logger.getLogger(Mediator.LOGGER_ACCESS).log(
Level.SEVERE,
"Failed to create source for key: "