use of org.polymap.core.catalog.IMetadata in project polymap4-core by Polymap4.
the class MetadataContentProvider method updateMetadata.
/**
* @param elm
* @param currentChildCount
*/
protected void updateMetadata(IMetadata elm, int currentChildCount) {
updateChildrenLoading(elm);
UIJob job = new UIJob("Resolve service") {
@Override
protected void runWithException(IProgressMonitor monitor) throws Exception {
IMetadata metadata = (IMetadata) elm;
if (resolver.canResolve(metadata)) {
try {
IServiceInfo service = (IServiceInfo) resolver.resolve(metadata, monitor);
// skip service as it has not more info than metadata record
IResourceInfo[] children = Iterables.toArray(service.getResources(monitor), IResourceInfo.class);
updateChildren(elm, children, currentChildCount);
} catch (Exception e) {
// FIXME handle exceptions
log.warn("", e);
throw new RuntimeException(e);
}
} else {
updateChildren(elm, new Object[] { "Unable to resolve the service." }, currentChildCount);
}
}
};
job.scheduleWithUIUpdate();
}
Aggregations