[282804] [plug-in registry] simplify registry model to separate logic from data
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java
index cd5033e..3950e4a 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 211127
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry;
 
@@ -16,11 +17,11 @@
 import org.eclipse.core.runtime.*;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.action.*;
-import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.*;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.pde.internal.runtime.*;
+import org.eclipse.pde.internal.runtime.registry.RegistryBrowserContentProvider.Folder;
 import org.eclipse.pde.internal.runtime.registry.model.*;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.BusyIndicator;
@@ -34,7 +35,6 @@
 import org.eclipse.ui.dialogs.PatternFilter;
 import org.eclipse.ui.part.DrillDownAdapter;
 import org.eclipse.ui.part.ViewPart;
-import org.osgi.framework.BundleException;
 
 public class RegistryBrowser extends ViewPart {
 
@@ -157,7 +157,8 @@
 	}
 
 	private void initializeModel() {
-		model = RegistryModelFactory.getRegistryModel("local"); //$NON-NLS-1$
+		model = RegistryModelFactory.getRegistryModel("local:///"); //$NON-NLS-1$
+
 		fTreeViewer.setInput(model);
 		listener = new RegistryBrowserModelChangeListener(RegistryBrowser.this);
 		model.addModelChangeListener(listener);
@@ -428,28 +429,20 @@
 
 		fStartAction = new Action(PDERuntimeMessages.RegistryView_startAction_label) {
 			public void run() {
-				try {
-					List bundles = getSelectedBundles();
-					for (Iterator it = bundles.iterator(); it.hasNext();) {
-						Bundle bundle = (Bundle) it.next();
-						bundle.start();
-					}
-				} catch (BundleException e) {
-					PDERuntimePlugin.log(e);
+				List bundles = getSelectedBundles();
+				for (Iterator it = bundles.iterator(); it.hasNext();) {
+					Bundle bundle = (Bundle) it.next();
+					model.start(bundle);
 				}
 			}
 		};
 
 		fStopAction = new Action(PDERuntimeMessages.RegistryView_stopAction_label) {
 			public void run() {
-				try {
-					List bundles = getSelectedBundles();
-					for (Iterator it = bundles.iterator(); it.hasNext();) {
-						Bundle bundle = (Bundle) it.next();
-						bundle.stop();
-					}
-				} catch (BundleException e) {
-					PDERuntimePlugin.log(e);
+				List bundles = getSelectedBundles();
+				for (Iterator it = bundles.iterator(); it.hasNext();) {
+					Bundle bundle = (Bundle) it.next();
+					model.stop(bundle);
 				}
 			}
 		};
@@ -459,7 +452,7 @@
 				List bundles = getSelectedBundles();
 				for (Iterator it = bundles.iterator(); it.hasNext();) {
 					Bundle bundle = (Bundle) it.next();
-					bundle.enable();
+					model.enable(bundle);
 				}
 			}
 		};
@@ -469,7 +462,7 @@
 				List bundles = getSelectedBundles();
 				for (Iterator it = bundles.iterator(); it.hasNext();) {
 					Bundle bundle = (Bundle) it.next();
-					bundle.disable();
+					model.disable(bundle);
 				}
 			}
 		};
@@ -479,16 +472,20 @@
 				List bundles = getSelectedBundles();
 				for (Iterator it = bundles.iterator(); it.hasNext();) {
 					Bundle bundle = (Bundle) it.next();
-					MultiStatus problems = bundle.diagnose();
+					String[] problems = model.diagnose(bundle);
+					MultiStatus multiStatus = new MultiStatus(PDERuntimePlugin.ID, IStatus.INFO, PDERuntimeMessages.RegistryView_found_problems, null);
+					for (int i = 0; i < problems.length; i++) {
+						IStatus status = new Status(IStatus.WARNING, PDERuntimePlugin.ID, problems[i]);
+						multiStatus.add(status);
+					}
 
-					Dialog dialog;
-					if ((problems != null) && (problems.getChildren().length > 0)) {
-						dialog = new DiagnosticsDialog(getSite().getShell(), PDERuntimeMessages.RegistryView_diag_dialog_title, null, problems, IStatus.WARNING);
+					DiagnosticsDialog dialog;
+					if ((multiStatus != null) && (multiStatus.getChildren().length > 0)) {
+						dialog = new DiagnosticsDialog(getSite().getShell(), PDERuntimeMessages.RegistryView_diag_dialog_title, null, multiStatus, IStatus.WARNING);
 						dialog.open();
 					} else {
 						MessageDialog.openInformation(getSite().getShell(), PDERuntimeMessages.RegistryView_diag_dialog_title, PDERuntimeMessages.RegistryView_no_unresolved_constraints);
 					}
-
 				}
 			}
 		};
@@ -717,6 +714,10 @@
 		}
 	}
 
+	RegistryModel getModel() {
+		return model;
+	}
+
 	public Object getAdapter(Class clazz) {
 		if (ILabelProvider.class.equals(clazz)) {
 			return fLabelProvider;
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserContentProvider.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserContentProvider.java
index 8b1004d..93703d9 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserContentProvider.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserContentProvider.java
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Wolfgang Schell <ws@jetztgrad.net> - bug 259348
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry;
 
@@ -22,6 +23,84 @@
 
 	private RegistryBrowser fRegistryBrowser;
 
+	public class Folder {
+
+		public static final int F_EXTENSIONS = 1;
+		public static final int F_EXTENSION_POINTS = 2;
+		public static final int F_IMPORTS = 3;
+		public static final int F_LIBRARIES = 4;
+		public static final int F_REGISTERED_SERVICES = 5;
+		public static final int F_SERVICES_IN_USE = 6;
+		public static final int F_PROPERTIES = 7;
+		public static final int F_USING_BUNDLES = 8;
+		public static final int F_FRAGMENTS = 9;
+		public static final int F_IMPORTED_PACKAGES = 10;
+		public static final int F_EXPORTED_PACKAGES = 11;
+
+		private int id;
+		private Object parent;
+
+		public Folder(int id, Object parent) {
+			this.id = id;
+			this.parent = parent;
+		}
+
+		public int getId() {
+			return id;
+		}
+
+		public Object getParent() {
+			return parent;
+		}
+
+		public ModelObject[] getChildren() {
+			Bundle bundle;
+
+			switch (id) {
+				case F_EXTENSION_POINTS :
+					bundle = ((Bundle) parent);
+					return fRegistryBrowser.getModel().getExtensionPoints(bundle);
+				case F_EXTENSIONS :
+					bundle = ((Bundle) parent);
+					return fRegistryBrowser.getModel().getExtensions(bundle);
+				case F_IMPORTS :
+					return ((Bundle) parent).getImports();
+				case F_LIBRARIES :
+					return ((Bundle) parent).getLibraries();
+				case F_REGISTERED_SERVICES :
+					bundle = ((Bundle) parent);
+					return fRegistryBrowser.getModel().getRegisteredServices(bundle);
+				case F_SERVICES_IN_USE :
+					bundle = ((Bundle) parent);
+					return fRegistryBrowser.getModel().getServicesInUse(bundle);
+				case F_PROPERTIES :
+					return ((ServiceRegistration) parent).getProperties();
+				case F_USING_BUNDLES :
+					return fRegistryBrowser.getModel().getUsingBundles((ServiceRegistration) parent);
+				case F_FRAGMENTS :
+					return fRegistryBrowser.getModel().getFragments((Bundle) parent);
+				case F_IMPORTED_PACKAGES :
+					return ((Bundle) parent).getImportedPackages();
+				case F_EXPORTED_PACKAGES :
+					return ((Bundle) parent).getExportedPackages();
+			}
+
+			return null;
+		}
+
+		public int hashCode() {
+			final int prime = 31;
+			int result = 1;
+			result = prime * result + id;
+			result = prime * result + ((parent == null) ? 0 : parent.hashCode());
+			return result;
+		}
+
+		public boolean equals(Object obj) {
+			return ((obj instanceof Folder) && (((Folder) obj).id == id) && (((Folder) obj).parent.equals(parent)));
+		}
+	}
+
 	public RegistryBrowserContentProvider(RegistryBrowser registryBrowser) {
 		fRegistryBrowser = registryBrowser;
 	}
@@ -76,15 +155,15 @@
 				folders.add(new Folder(Folder.F_EXPORTED_PACKAGES, bundle));
 			if (bundle.getLibraries().length > 0)
 				folders.add(new Folder(Folder.F_LIBRARIES, bundle));
-			if (bundle.getExtensionPoints().length > 0)
+			if (fRegistryBrowser.getModel().getExtensionPoints(bundle).length > 0)
 				folders.add(new Folder(Folder.F_EXTENSION_POINTS, bundle));
-			if (bundle.getExtensions().length > 0)
+			if (fRegistryBrowser.getModel().getExtensions(bundle).length > 0)
 				folders.add(new Folder(Folder.F_EXTENSIONS, bundle));
-			if (bundle.getRegisteredServices().length > 0)
+			if (fRegistryBrowser.getModel().getRegisteredServices(bundle).length > 0)
 				folders.add(new Folder(Folder.F_REGISTERED_SERVICES, bundle));
-			if (bundle.getServicesInUse().length > 0)
+			if (fRegistryBrowser.getModel().getServicesInUse(bundle).length > 0)
 				folders.add(new Folder(Folder.F_SERVICES_IN_USE, bundle));
-			if (bundle.getFragments().length > 0)
+			if (fRegistryBrowser.getModel().getFragments(bundle).length > 0)
 				folders.add(new Folder(Folder.F_FRAGMENTS, bundle));
 
 			return folders.toArray();
@@ -119,7 +198,8 @@
 		}
 
 		if (element instanceof ServiceName) {
-			return ((ServiceName) element).getChildren();
+			String[] classes = ((ServiceName) element).getClasses();
+			return fRegistryBrowser.getModel().getServices(classes);
 		}
 
 		if (element instanceof ServiceRegistration) {
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserLabelProvider.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserLabelProvider.java
index 5516caf..bb94418 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserLabelProvider.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserLabelProvider.java
@@ -7,16 +7,16 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry;
 
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-
 import java.util.Arrays;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.*;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.pde.internal.runtime.*;
+import org.eclipse.pde.internal.runtime.registry.RegistryBrowserContentProvider.Folder;
 import org.eclipse.pde.internal.runtime.registry.model.*;
 import org.eclipse.swt.graphics.Image;
 import org.osgi.framework.Constants;
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserModelChangeListener.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserModelChangeListener.java
index 214c96c..f30fdfd 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserModelChangeListener.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserModelChangeListener.java
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *    Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry;
 
@@ -53,14 +54,14 @@
 				return object;
 			} else if (object instanceof ExtensionPoint) {
 				ExtensionPoint ext = (ExtensionPoint) object;
-				return ext.getContributor();
+				return fRegistryBrowser.getModel().getBundle(ext.getContributorId());
 			} else if (object instanceof Extension) {
 				Extension ext = (Extension) object;
-				return ext.getContributor();
+				return fRegistryBrowser.getModel().getBundle(ext.getContributorId());
 			} else if (object instanceof ServiceRegistration) {
 				ServiceRegistration reg = (ServiceRegistration) object;
 
-				Bundle[] bundles = reg.getUsingBundles();
+				Bundle[] bundles = fRegistryBrowser.getModel().getUsingBundles(reg);
 				if (bundles.length == 0) {
 					return reg.getBundle();
 				}
@@ -76,14 +77,15 @@
 				return object;
 			} else if (object instanceof Extension) {
 				Extension ext = (Extension) object;
-				return ext.getExtensionPoint();
+				return fRegistryBrowser.getModel().getExtensionPoint(ext.getExtensionPointUniqueIdentifier());
 			}
 		} else if (fRegistryBrowser.getGroupBy() == RegistryBrowser.SERVICES) {
 			if (object instanceof ServiceRegistration) {
 				ServiceRegistration service = (ServiceRegistration) object;
 				return service.getName();
 			} else if (object instanceof Bundle) {
-				Object[] services = ((Bundle) object).getServicesInUse();
+				Bundle bundle = ((Bundle) object);
+				Object[] services = fRegistryBrowser.getModel().getServicesInUse(bundle);
 				for (int i = 0; i < services.length; i++) {
 					ServiceRegistration service = ((ServiceRegistration) services[i]);
 					services[i] = service.getName();
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Attribute.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Attribute.java
index cc153d1..80cd06d 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Attribute.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Attribute.java
@@ -7,10 +7,13 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
 public class Attribute extends ModelObject {
+
+	private static final long serialVersionUID = 1L;
 	public static final String F_LOCATION = "Location"; //$NON-NLS-1$
 
 	public static final String F_BUNDLE = "Bundle"; //$NON-NLS-1$
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/BackendChangeListener.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/BackendChangeListener.java
index 91fcb86..1344b6e 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/BackendChangeListener.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/BackendChangeListener.java
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Bundle.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Bundle.java
index e409b2b..8248502 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Bundle.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Bundle.java
@@ -7,15 +7,13 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
-import java.util.*;
-import org.eclipse.core.runtime.MultiStatus;
-import org.osgi.framework.BundleException;
-
 public class Bundle extends ModelObject {
 
+	private static final long serialVersionUID = 1L;
 	public static final int ACTIVE = org.osgi.framework.Bundle.ACTIVE;
 	public static final int UNINSTALLED = org.osgi.framework.Bundle.UNINSTALLED;
 	public static final int INSTALLED = org.osgi.framework.Bundle.INSTALLED;
@@ -120,96 +118,6 @@
 		return id;
 	}
 
-	public void start() throws BundleException {
-		if (model == null)
-			return;
-		model.backend.start(id);
-	}
-
-	public void stop() throws BundleException {
-		if (model == null)
-			return;
-		model.backend.stop(id);
-	}
-
-	public void enable() {
-		if (model == null)
-			return;
-		model.backend.setEnabled(id, true);
-	}
-
-	public void disable() {
-		if (model == null)
-			return;
-		model.backend.setEnabled(id, false);
-	}
-
-	public MultiStatus diagnose() {
-		if (model == null)
-			return null;
-		return model.backend.diagnose(id);
-	}
-
-	public ExtensionPoint[] getExtensionPoints() {
-		if (model == null)
-			return new ExtensionPoint[0];
-		ExtensionPoint[] extPoints = model.getExtensionPoints();
-		List result = new ArrayList();
-
-		for (int i = 0; i < extPoints.length; i++) {
-			if (extPoints[i].getContributorId().longValue() == id)
-				result.add(extPoints[i]);
-		}
-		return (ExtensionPoint[]) result.toArray(new ExtensionPoint[result.size()]);
-	}
-
-	public Extension[] getExtensions() {
-		if (model == null)
-			return new Extension[0];
-		ExtensionPoint[] extPoints = model.getExtensionPoints();
-		List result = new ArrayList();
-
-		for (int i = 0; i < extPoints.length; i++) {
-			for (Iterator it = extPoints[i].getExtensions().iterator(); it.hasNext();) {
-				Extension a = (Extension) it.next();
-				if (a.getContributorId().longValue() == id)
-					result.add(a);
-			}
-
-		}
-		return (Extension[]) result.toArray(new Extension[result.size()]);
-	}
-
-	public ServiceRegistration[] getRegisteredServices() {
-		if (model == null)
-			return new ServiceRegistration[0];
-		ServiceRegistration[] services = model.getServices();
-		List result = new ArrayList();
-
-		for (int i = 0; i < services.length; i++) {
-			if (symbolicName.equals(services[i].getBundle()))
-				result.add(services[i]);
-		}
-		return (ServiceRegistration[]) result.toArray(new ServiceRegistration[result.size()]);
-	}
-
-	public ServiceRegistration[] getServicesInUse() {
-		if (model == null)
-			return new ServiceRegistration[0];
-		ServiceRegistration[] services = model.getServices();
-		List result = new ArrayList();
-
-		for (int i = 0; i < services.length; i++) {
-			long[] usingBundles = services[i].getUsingBundleIds();
-			if (usingBundles != null) {
-				for (int j = 0; j < usingBundles.length; j++)
-					if (id == usingBundles[j])
-						result.add(services[i]);
-			}
-		}
-		return (ServiceRegistration[]) result.toArray(new ServiceRegistration[result.size()]);
-	}
-
 	public boolean equals(Object obj) {
 		return (obj instanceof Bundle) && (id == ((Bundle) obj).id);
 	}
@@ -218,12 +126,6 @@
 		return (int) id;
 	}
 
-	public Bundle[] getFragments() {
-		if (model == null)
-			return new Bundle[0];
-		return model.getFragments(this);
-	}
-
 	public void setImportedPackages(BundlePrerequisite[] importedPackages) {
 		this.importedPackages = importedPackages;
 	}
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/BundleLibrary.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/BundleLibrary.java
index ee7d719..2413d80 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/BundleLibrary.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/BundleLibrary.java
@@ -7,11 +7,13 @@
  * 
  *  Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
 public class BundleLibrary extends ModelObject {
 
+	private static final long serialVersionUID = 1L;
 	private String library;
 
 	public String getLibrary() {
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/BundlePrerequisite.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/BundlePrerequisite.java
index 9bc623f..2ffc8c2 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/BundlePrerequisite.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/BundlePrerequisite.java
@@ -7,11 +7,14 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
 public class BundlePrerequisite extends ModelObject {
 
+	private static final long serialVersionUID = 1L;
+
 	private boolean isExported;
 	private String name;
 	private String version;
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ConfigurationElement.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ConfigurationElement.java
index aa416eb..e080c8e 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ConfigurationElement.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ConfigurationElement.java
@@ -7,11 +7,14 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
 public class ConfigurationElement extends Attribute {
 
+	private static final long serialVersionUID = 1L;
+
 	private Attribute[] elements = new Attribute[0];
 
 	public void setElements(Attribute[] elements) {
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Extension.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Extension.java
index fd01c7c..bf9fd95 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Extension.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Extension.java
@@ -7,11 +7,13 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
 public class Extension extends ModelObject {
 
+	private static final long serialVersionUID = 1L;
 	private String namespaceIdentifier;
 	private String label;
 	private String extensionPointUniqueIdentifier;
@@ -104,19 +106,4 @@
 		result = prime * result + ((namespaceIdentifier == null) ? 0 : namespaceIdentifier.hashCode());
 		return result;
 	}
-
-	public ExtensionPoint getExtensionPoint() {
-		if (model == null)
-			return null;
-		return model.getExtensionPoint(extensionPointUniqueIdentifier);
-	}
-
-	/**
-	 * @return contributor or <code>null</code> if contributor not present
-	 */
-	public Bundle getContributor() {
-		if (model == null || contributor == null)
-			return null;
-		return model.getBundle(contributor);
-	}
 }
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ExtensionPoint.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ExtensionPoint.java
index 3a8ecaf..846d5ad 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ExtensionPoint.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ExtensionPoint.java
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
@@ -15,6 +16,8 @@
 
 public class ExtensionPoint extends ModelObject {
 
+	private static final long serialVersionUID = 1L;
+
 	private String label;
 	private String uniqueIdentifier;
 	private String namespaceIdentifier;
@@ -64,15 +67,6 @@
 		return contributor;
 	}
 
-	/**
-	 * @return contributor or <code>null</code> if contributor not present
-	 */
-	public Bundle getContributor() {
-		if (model == null || contributor == null)
-			return null;
-		return model.getBundle(contributor);
-	}
-
 	public int hashCode() {
 		final int prime = 31;
 		int result = 1;
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Folder.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Folder.java
deleted file mode 100644
index db8bd37..0000000
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Folder.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry.model;
-
-public class Folder {
-
-	public static final int F_EXTENSIONS = 1;
-	public static final int F_EXTENSION_POINTS = 2;
-	public static final int F_IMPORTS = 3;
-	public static final int F_LIBRARIES = 4;
-	public static final int F_REGISTERED_SERVICES = 5;
-	public static final int F_SERVICES_IN_USE = 6;
-	public static final int F_PROPERTIES = 7;
-	public static final int F_USING_BUNDLES = 8;
-	public static final int F_FRAGMENTS = 9;
-	public static final int F_IMPORTED_PACKAGES = 10;
-	public static final int F_EXPORTED_PACKAGES = 11;
-
-	private int id;
-	private Object parent;
-
-	public Folder(int id, Object parent) {
-		this.id = id;
-		this.parent = parent;
-	}
-
-	public int getId() {
-		return id;
-	}
-
-	public Object getParent() {
-		return parent;
-	}
-
-	public ModelObject[] getChildren() {
-		switch (id) {
-			case F_EXTENSION_POINTS :
-				return ((Bundle) parent).getExtensionPoints();
-			case F_EXTENSIONS :
-				return ((Bundle) parent).getExtensions();
-			case F_IMPORTS :
-				return ((Bundle) parent).getImports();
-			case F_LIBRARIES :
-				return ((Bundle) parent).getLibraries();
-			case F_REGISTERED_SERVICES :
-				return ((Bundle) parent).getRegisteredServices();
-			case F_SERVICES_IN_USE :
-				return ((Bundle) parent).getServicesInUse();
-			case F_PROPERTIES :
-				return ((ServiceRegistration) parent).getProperties();
-			case F_USING_BUNDLES :
-				return ((ServiceRegistration) parent).getUsingBundles();
-			case F_FRAGMENTS :
-				return ((Bundle) parent).getFragments();
-			case F_IMPORTED_PACKAGES :
-				return ((Bundle) parent).getImportedPackages();
-			case F_EXPORTED_PACKAGES :
-				return ((Bundle) parent).getExportedPackages();
-		}
-
-		return null;
-	}
-
-	public int hashCode() {
-		final int prime = 31;
-		int result = 1;
-		result = prime * result + id;
-		result = prime * result + ((parent == null) ? 0 : parent.hashCode());
-		return result;
-	}
-
-	public boolean equals(Object obj) {
-		return ((obj instanceof Folder) && (((Folder) obj).id == id) && (((Folder) obj).parent.equals(parent)));
-	}
-}
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/LocalRegistryBackend.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/LocalRegistryBackend.java
index eb2078d..a177424 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/LocalRegistryBackend.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/LocalRegistryBackend.java
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Wolfgang Schell <ws@jetztgrad.net> - bug 259348
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
@@ -17,7 +18,8 @@
 import org.eclipse.core.runtime.*;
 import org.eclipse.osgi.service.resolver.*;
 import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.internal.runtime.*;
+import org.eclipse.pde.internal.runtime.MessageHelper;
+import org.eclipse.pde.internal.runtime.PDERuntimePlugin;
 import org.osgi.framework.*;
 import org.osgi.service.packageadmin.PackageAdmin;
 
@@ -32,13 +34,15 @@
 	/* (non-Javadoc)
 	 * @see org.eclipse.pde.internal.runtime.registry.model.local.RegistryBackend#connect()
 	 */
-	public void connect(IProgressMonitor monitor) {
+	public boolean connect(IProgressMonitor monitor) {
 		if (monitor.isCanceled())
-			return;
+			return false;
 
 		PDERuntimePlugin.getDefault().getBundleContext().addBundleListener(this);
 		Platform.getExtensionRegistry().addListener(this);
 		PDERuntimePlugin.getDefault().getBundleContext().addServiceListener(this);
+
+		return true;
 	}
 
 	/* (non-Javadoc)
@@ -62,21 +66,31 @@
 	/* (non-Javadoc)
 	 * @see org.eclipse.pde.internal.runtime.registry.model.local.RegistryBackend#start(org.osgi.framework.Bundle)
 	 */
-	public void start(long id) throws BundleException {
-		PDERuntimePlugin.getDefault().getBundleContext().getBundle(id).start();
+	public void start(long id) {
+		try {
+			PDERuntimePlugin.getDefault().getBundleContext().getBundle(id).start();
+		} catch (BundleException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
 	}
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.pde.internal.runtime.registry.model.local.RegistryBackend#stop(org.osgi.framework.Bundle)
 	 */
-	public void stop(long id) throws BundleException {
-		PDERuntimePlugin.getDefault().getBundleContext().getBundle(id).stop();
+	public void stop(long id) {
+		try {
+			PDERuntimePlugin.getDefault().getBundleContext().getBundle(id).stop();
+		} catch (BundleException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
 	}
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.pde.internal.runtime.registry.model.local.RegistryBackend#diagnose(org.osgi.framework.Bundle)
 	 */
-	public MultiStatus diagnose(long id) {
+	public String[] diagnose(long id) {
 		PlatformAdmin plaformAdmin = PDERuntimePlugin.getDefault().getPlatformAdmin();
 		State state = plaformAdmin.getState(false);
 
@@ -86,19 +100,16 @@
 		VersionConstraint[] unsatisfied = platformAdmin.getStateHelper().getUnsatisfiedConstraints(desc);
 		ResolverError[] resolverErrors = platformAdmin.getState(false).getResolverErrors(desc);
 
-		MultiStatus problems = new MultiStatus(PDERuntimePlugin.ID, IStatus.INFO, PDERuntimeMessages.RegistryView_found_problems, null);
+		String[] problems = new String[unsatisfied.length + resolverErrors.length];
+
 		for (int i = 0; i < resolverErrors.length; i++) {
-			if ((resolverErrors[i].getType() & (ResolverError.MISSING_FRAGMENT_HOST | ResolverError.MISSING_GENERIC_CAPABILITY | ResolverError.MISSING_IMPORT_PACKAGE | ResolverError.MISSING_REQUIRE_BUNDLE)) != 0)
-				continue;
-			IStatus status = new Status(IStatus.WARNING, PDERuntimePlugin.ID, resolverErrors[i].toString());
-			problems.add(status);
+			problems[i] = resolverErrors[i].toString();
 		}
-
-		for (int i = 0; i < unsatisfied.length; i++) {
-			IStatus status = new Status(IStatus.WARNING, PDERuntimePlugin.ID, MessageHelper.getResolutionFailureMessage(unsatisfied[i]));
-			problems.add(status);
+		int j = 0;
+		for (int i = resolverErrors.length; i < unsatisfied.length + resolverErrors.length; i++) {
+			problems[i] = MessageHelper.getResolutionFailureMessage(unsatisfied[j]);
+			j++;
 		}
-
 		return problems;
 	}
 
@@ -299,6 +310,9 @@
 			return null;
 		}
 
+		if (bundleEntry == null)
+			return null;
+
 		try {
 			bundleEntry = FileLocator.resolve(bundleEntry);
 		} catch (IOException e) { // do nothing
@@ -492,4 +506,9 @@
 		PackageAdmin packageAdmin = PDERuntimePlugin.getDefault().getPackageAdmin();
 		packageAdmin.refreshPackages(new org.osgi.framework.Bundle[] {b});
 	}
+
+	public void setBackendChangeListener(BackendChangeListener listener) {
+		// TODO Auto-generated method stub
+
+	}
 }
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ModelChangeDelta.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ModelChangeDelta.java
index 2156b91..1a140eb 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ModelChangeDelta.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ModelChangeDelta.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
@@ -25,9 +26,14 @@
 	public static final int RESOLVED = 7;
 	public static final int UNRESOLVED = 8;
 
+	// TODO SWITCH from HEAVY ModelChangeDelta carrying whole object, to LIGHT delta - name, type (Bundle/Service/Ext/ExtPt), id
 	private ModelObject fObject;
 	private int fFlag;
 
+	public ModelChangeDelta() {
+		// empty
+	}
+
 	public ModelChangeDelta(ModelObject object, int flag) {
 		fObject = object;
 		fFlag = flag;
@@ -40,4 +46,12 @@
 	public int getFlag() {
 		return fFlag;
 	}
+
+	public void setModelObject(ModelObject fObject) {
+		this.fObject = fObject;
+	}
+
+	public void setFlag(int flag) {
+		this.fFlag = flag;
+	}
 }
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ModelObject.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ModelObject.java
index 22c0ad2..e54d9ef 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ModelObject.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ModelObject.java
@@ -7,14 +7,14 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
-public abstract class ModelObject {
+import java.io.Serializable;
 
-	protected RegistryModel model;
+public abstract class ModelObject implements Serializable {
 
-	public void setModel(RegistryModel model) {
-		this.model = model;
-	}
+	private static final long serialVersionUID = 1L;
+
 }
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Property.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Property.java
index d0d999c..1527f1e 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Property.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/Property.java
@@ -8,12 +8,13 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Wolfgang Schell <ws@jetztgrad.net> - bug 260055
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
-import org.osgi.framework.Constants;
-
 public class Property extends ModelObject implements Comparable {
+
+	private static final long serialVersionUID = 1L;
 	public static final String PREFIX_SERVICE = "service."; //$NON-NLS-1$
 	public static final String PREFIX_COMPONENT = "component."; //$NON-NLS-1$
 
@@ -91,11 +92,11 @@
 		String name0 = getName();
 		String name1 = other.getName();
 
-		if (Constants.OBJECTCLASS.equals(name0)) {
+		if ("objectClass".equals(name0)) { //$NON-NLS-1$
 			return -1;
 		}
 
-		if (Constants.OBJECTCLASS.equals(name1)) {
+		if ("objectClass".equals(name1)) { //$NON-NLS-1$
 			return 1;
 		}
 
@@ -130,5 +131,5 @@
 		// simply compare strings
 		return name0.compareTo(name1);
 	}
-
+	
 }
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/RegistryBackend.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/RegistryBackend.java
index 552da20..2c225d9 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/RegistryBackend.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/RegistryBackend.java
@@ -7,26 +7,25 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
 import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.MultiStatus;
-import org.osgi.framework.BundleException;
 
 public interface RegistryBackend {
 
-	public void connect(IProgressMonitor monitor);
+	public boolean connect(IProgressMonitor monitor);
 
 	public void disconnect();
 
 	public void setEnabled(long id, boolean enabled);
 
-	public void start(long id) throws BundleException;
+	public void start(long id);
 
-	public void stop(long id) throws BundleException;
+	public void stop(long id);
 
-	public MultiStatus diagnose(long id);
+	public String[] diagnose(long id);
 
 	public void initializeBundles(IProgressMonitor monitor);
 
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/RegistryModel.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/RegistryModel.java
index 75688dd..f68568b 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/RegistryModel.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/RegistryModel.java
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
@@ -22,7 +23,6 @@
 
 	private BackendChangeListener backendListener = new BackendChangeListener() {
 		public void addBundle(Bundle adapter) {
-			adapter.setModel(RegistryModel.this);
 			ModelChangeDelta delta = new ModelChangeDelta(adapter, ModelChangeDelta.ADDED);
 
 			bundles.put(new Long(adapter.getId()), adapter);
@@ -58,11 +58,9 @@
 			}
 
 			fireModelChangeEvent(new ModelChangeDelta[] {delta});
-			adapter.setModel(null);
 		}
 
 		public void updateBundle(Bundle adapter, int updated) {
-			adapter.setModel(RegistryModel.this);
 			ModelChangeDelta delta = new ModelChangeDelta(adapter, updated);
 
 			bundles.put(new Long(adapter.getId()), adapter); // replace old with new one
@@ -78,14 +76,12 @@
 			ModelChangeDelta serviceNameDelta = null;
 			if (!serviceNames.contains(adapter.getName())) {
 				ServiceName name = adapter.getName();
-				name.setModel(RegistryModel.this);
 
 				serviceNames.add(name);
 
 				serviceNameDelta = new ModelChangeDelta(name, ModelChangeDelta.ADDED);
 			}
 
-			adapter.setModel(RegistryModel.this);
 			services.put(new Long(adapter.getId()), adapter);
 
 			ModelChangeDelta delta = new ModelChangeDelta(adapter, ModelChangeDelta.ADDED);
@@ -110,16 +106,12 @@
 
 			if (serviceNameDelta != null) {
 				fireModelChangeEvent(new ModelChangeDelta[] {serviceNameDelta, delta});
-				adapter.getName().setModel(null);
-				adapter.setModel(null);
 			} else {
 				fireModelChangeEvent(new ModelChangeDelta[] {delta});
-				adapter.setModel(null);
 			}
 		}
 
 		public void updateService(ServiceRegistration adapter) {
-			adapter.setModel(RegistryModel.this);
 			services.put(new Long(adapter.getId()), adapter);
 
 			ModelChangeDelta delta = new ModelChangeDelta(adapter, ModelChangeDelta.UPDATED);
@@ -129,7 +121,6 @@
 
 		public void addExtensions(Extension[] extensionAdapters) {
 			for (int i = 0; i < extensionAdapters.length; i++) {
-				extensionAdapters[i].setModel(RegistryModel.this);
 				String id = extensionAdapters[i].getExtensionPointUniqueIdentifier();
 				ExtensionPoint extPoint = (ExtensionPoint) extensionPoints.get(id);
 				extPoint.getExtensions().add(extensionAdapters[i]);
@@ -154,15 +145,10 @@
 				delta[i] = new ModelChangeDelta(extensionAdapters[i], ModelChangeDelta.REMOVED);
 			}
 			fireModelChangeEvent(delta);
-
-			for (int i = 0; i < extensionAdapters.length; i++) {
-				extensionAdapters[i].setModel(null);
-			}
 		}
 
 		public void addExtensionPoints(ExtensionPoint[] extensionPointAdapters) {
 			for (int i = 0; i < extensionPointAdapters.length; i++) {
-				extensionPointAdapters[i].setModel(RegistryModel.this);
 				extensionPoints.put(extensionPointAdapters[i].getUniqueIdentifier(), extensionPointAdapters[i]);
 			}
 
@@ -183,10 +169,6 @@
 				delta[i] = new ModelChangeDelta(extensionPointAdapters[i], ModelChangeDelta.REMOVED);
 			}
 			fireModelChangeEvent(delta);
-
-			for (int i = 0; i < extensionPointAdapters.length; i++) {
-				extensionPointAdapters[i].setModel(null);
-			}
 		}
 	};
 
@@ -210,6 +192,10 @@
 		backend.setRegistryListener(backendListener);
 	}
 
+	public BackendChangeListener getBackendChangeListener() {
+		return this.backendListener;
+	}
+
 	protected void addFragment(Bundle fragment) {
 		Set hostFragments = (Set) fragments.get(fragment.getFragmentHost());
 		if (hostFragments == null) {
@@ -233,12 +219,15 @@
 		hostFragments.remove(fragment);
 	}
 
-	public void connect(IProgressMonitor monitor, boolean forceInit) {
-		backend.connect(monitor);
+	public boolean connect(IProgressMonitor monitor, boolean forceInit) {
+		if (!backend.connect(monitor))
+			return false;
 
 		if (forceInit) {
 			initialize(monitor);
 		}
+
+		return true;
 	}
 
 	public void initialize(IProgressMonitor monitor) {
@@ -293,7 +282,7 @@
 	 *  
 	 * @param objects
 	 */
-	protected void fireModelChangeEvent(ModelChangeDelta[] delta) {
+	synchronized protected void fireModelChangeEvent(ModelChangeDelta[] delta) {
 		for (Iterator i = listeners.iterator(); i.hasNext();) {
 			ModelChangeListener listener = (ModelChangeListener) i.next();
 			listener.modelChanged(delta);
@@ -383,12 +372,93 @@
 		return false;
 	}
 
-	/*	void setEnabled(Bundle bundle, boolean enabled);
+	public ExtensionPoint[] getExtensionPoints(Bundle adapter) {
+		ExtensionPoint[] extPoints = getExtensionPoints();
+		List result = new ArrayList();
 
-		void start(Bundle bundle) throws BundleException; // XXX Create custom Exception
+		for (int i = 0; i < extPoints.length; i++) {
+			if (extPoints[i].getContributorId().longValue() == adapter.getId())
+				result.add(extPoints[i]);
+		}
+		return (ExtensionPoint[]) result.toArray(new ExtensionPoint[result.size()]);
+	}
 
-		void stop(Bundle bundle) throws BundleException;
+	public Extension[] getExtensions(Bundle adapter) {
+		ExtensionPoint[] extPoints = getExtensionPoints();
+		List result = new ArrayList();
 
-		MultiStatus diagnose(Bundle bundle);*/
+		for (int i = 0; i < extPoints.length; i++) {
+			for (Iterator it = extPoints[i].getExtensions().iterator(); it.hasNext();) {
+				Extension a = (Extension) it.next();
+				if (a.getContributorId().longValue() == adapter.getId())
+					result.add(a);
+			}
 
+		}
+		return (Extension[]) result.toArray(new Extension[result.size()]);
+	}
+
+	public ServiceRegistration[] getRegisteredServices(Bundle adapter) {
+		ServiceRegistration[] services = getServices();
+		List result = new ArrayList();
+
+		String symbolicName = adapter.getSymbolicName();
+
+		for (int i = 0; i < services.length; i++) {
+			if (symbolicName.equals(services[i].getBundle()))
+				result.add(services[i]);
+		}
+		return (ServiceRegistration[]) result.toArray(new ServiceRegistration[result.size()]);
+	}
+
+	public ServiceRegistration[] getServicesInUse(Bundle adapter) {
+		ServiceRegistration[] services = getServices();
+		List result = new ArrayList();
+
+		long id = adapter.getId();
+
+		for (int i = 0; i < services.length; i++) {
+			long[] usingBundles = services[i].getUsingBundleIds();
+			if (usingBundles != null) {
+				for (int j = 0; j < usingBundles.length; j++)
+					if (id == usingBundles[j])
+						result.add(services[i]);
+			}
+		}
+		return (ServiceRegistration[]) result.toArray(new ServiceRegistration[result.size()]);
+	}
+
+	public void start(Bundle adapter) {
+		backend.start(adapter.getId());
+	}
+
+	public void stop(Bundle adapter) {
+		backend.stop(adapter.getId());
+	}
+
+	public void enable(Bundle adapter) {
+		backend.setEnabled(adapter.getId(), true);
+	}
+
+	public void disable(Bundle adapter) {
+		backend.setEnabled(adapter.getId(), false);
+	}
+
+	public String[] diagnose(Bundle adapter) {
+		return backend.diagnose(adapter.getId());
+	}
+
+	public Bundle[] getUsingBundles(ServiceRegistration reg) {
+		long[] usingBundles = reg.getUsingBundleIds();
+		if (usingBundles.length == 0)
+			return new Bundle[0];
+
+		Set bundles = new HashSet();
+		for (int i = 0; i < usingBundles.length; i++) {
+			Bundle bundle = getBundle(new Long(usingBundles[i]));
+			if (bundle != null)
+				bundles.add(bundle);
+		}
+		return (Bundle[]) bundles.toArray(new Bundle[bundles.size()]);
+	}
 }
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ServiceName.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ServiceName.java
index 098adda..99de270 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ServiceName.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ServiceName.java
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Wolfgang Schell <ws@jetztgrad.net> - bug 260055
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
@@ -15,6 +16,8 @@
 
 public class ServiceName extends ModelObject implements Comparable {
 
+	private static final long serialVersionUID = 1L;
+
 	private String[] classes;
 
 	public ServiceName(String[] classes) {
@@ -25,10 +28,6 @@
 		return classes;
 	}
 
-	public ModelObject[] getChildren() {
-		return model.getServices(classes);
-	}
-
 	private static int hashCode(Object[] array) {
 		int prime = 31;
 		if (array == null)
diff --git a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ServiceRegistration.java b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ServiceRegistration.java
index ef2c1dc..bc64991 100644
--- a/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ServiceRegistration.java
+++ b/osgimonitoring/plugins/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ServiceRegistration.java
@@ -8,14 +8,14 @@
  *  Contributors:
  *     IBM Corporation - initial API and implementation
  *     Wolfgang Schell <ws@jetztgrad.net> - bug 259348, 260055
+ *     Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804
  *******************************************************************************/
 package org.eclipse.pde.internal.runtime.registry.model;
 
-import java.util.HashSet;
-import java.util.Set;
-
 public class ServiceRegistration extends ModelObject implements Comparable {
 
+	private static final long serialVersionUID = 1L;
+
 	private long id;
 	private String bundle;
 	private long[] usingBundles = new long[0];
@@ -67,19 +67,6 @@
 		return usingBundles;
 	}
 
-	public Bundle[] getUsingBundles() {
-		if (usingBundles.length == 0)
-			return new Bundle[0];
-
-		Set bundles = new HashSet();
-		for (int i = 0; i < usingBundles.length; i++) {
-			Bundle bundle = model.getBundle(new Long(usingBundles[i]));
-			if (bundle != null)
-				bundles.add(bundle);
-		}
-		return (Bundle[]) bundles.toArray(new Bundle[bundles.size()]);
-	}
-
 	public Property[] getProperties() {
 		return properties;
 	}