System.out.println("Synchronizing cluster group " + group.getName());
try {
ServiceReference[] serviceReferences = bundleContext.getAllServiceReferences("org.apache.karaf.cellar.core.Synchronizer", null);
if (serviceReferences != null && serviceReferences.length > 0) {
for (ServiceReference ref : serviceReferences) {
Synchronizer synchronizer = (Synchronizer) bundleContext.getService(ref);
if (synchronizer.isSyncEnabled(group)) {
System.out.print(" sync " + synchronizer.getClass() + " ...");
synchronizer.pull(group);
synchronizer.push(group);
System.out.println("OK");
}
bundleContext.ungetService(ref);
}
}