}
}
}
} catch (Exception e) {
throw new InvocationTargetException(e);
}
} else if (info instanceof WGAPluginResourceSyncInfo) {
try {
WGAPluginResourceSyncInfo wgaSyncInfo = (WGAPluginResourceSyncInfo) info;
if ((wgaSyncInfo.getKind() & SyncInfo.CONFLICTING) != SyncInfo.CONFLICTING) {
int change = SyncInfo.getChange(wgaSyncInfo.getKind());
if (change == SyncInfo.DELETION) {
WGARemoteServer remote = wgaSyncInfo.getServer();
remote.getServices().deactivatePlugin(remote.getSession(), ((WGAPluginResourceVariant)wgaSyncInfo.getRemote()).getPluginInfo());
committedResources.add(wgaSyncInfo.getLocal());
} else if (change == SyncInfo.ADDITION) {
WGARemoteServer local = wgaSyncInfo.getRuntime().createRemoteServer();
local.connectToServer();
DataSource plugin = local.getServices().downloadPlugin(local.getSession(), wgaSyncInfo.getLocalPluginInfo());
WGARemoteServer remote = wgaSyncInfo.getServer();
remote.getServices().installPlugins(remote.getSession(), Collections.singletonList(plugin));
remote.getServices().activatePlugin(remote.getSession(), wgaSyncInfo.getLocalPluginInfo());
committedResources.add(wgaSyncInfo.getLocal());
}
}
} catch (Exception e) {
throw new InvocationTargetException(e);
}
}
}
if (_configuration.getParticipant() instanceof SubscriberParticipant) {
Subscriber subscriber = ((SubscriberParticipant)_configuration.getParticipant()).getSubscriber();
try {
subscriber.refresh(committedResources.toArray(new IResource[0]), IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, -1));
} catch (TeamException e) {
throw new InvocationTargetException(e);
}
}
} finally {
monitor.done();
}