* Adds the required services into the catalog.
*/
public void load() {
ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
IServiceFactory serviceFactory = CatalogPlugin.getDefault().getServiceFactory();
synchronized (connectionParams) {
for( Map.Entry<ID, Map<String, Serializable>> entry : connectionParams.entrySet() ) {
Map<String, Serializable> params = entry.getValue();
boolean couldResolve = resolveURLs(params);
if (!couldResolve) {
// if couldn't resolve log the warning and continue. There is no way we can load
// the resource
ProjectPlugin
.log(
"Warning: couldn't find the layer's resources in the catalog and can't construct it because the current map" //$NON-NLS-1$
+ " does not have a Resource:" + layer.getID(), //$NON-NLS-1$
new Exception("Failure loading layer")); //$NON-NLS-1$
continue;
}
List<IService> createdServices = serviceFactory.createService(params);
updateLayerID(createdServices);
if (serviceExistsInCatalog(createdServices, catalog)) {
continue;
} else {
addServicesToCatalog(createdServices, catalog);