use of org.apache.stanbol.entityhub.web.ModelWriter in project stanbol by apache.
the class ModelWriterTracker method modifiedService.
@Override
public final void modifiedService(ServiceReference reference, Object service) {
super.modifiedService(reference, service);
if (service != null) {
Set<MediaType> mediaTypes = parseMediaTypes(((ModelWriter) service).supportedMediaTypes());
Class<? extends Representation> nativeType = ((ModelWriter) service).getNativeType();
if (!mediaTypes.isEmpty()) {
lock.writeLock().lock();
try {
for (MediaType mediaType : mediaTypes) {
updateModelWriter(nativeType, mediaType, reference);
}
} finally {
lock.writeLock().unlock();
}
}
}
}
Aggregations