Permalink
Browse files

Move Bundle and Console server editor parts to Eclipse Libra.

The Bundle Information, Bundle Dependency Graph and Server Console
server editor parts are moved to Eclipse Libra in a separate commit in
the Libra Git repository. This commit adapts the Virgo IDE to this
change. 

1. All moved Java classes are deleted from Virgo IDE. 
2. The plugin.xml in the UI plug-in now refers to the editor parts from
the Libra plugins. 
3. Bundle model classes now implement the respective interfaces from the
Libra bundle model. This is needed for better level of abstraction
between the editor and the data provider, so the editors can be adopted
for more servers. 
4. The editor parts now tries to adapt the IServer object to
IOSGiFrameworkAdmin and IOSGiFrameworkConsole interfaces for making the
communication with the server-side. The easiest way to make the Virgo
Server adaptable to these interfaces is to implement them in the
ServerBehavior object.
  • Loading branch information...
1 parent d6ba8a0 commit 665cf74f67221d612e05e7e6d389a9175d4c8c75 @kaloyan-raev committed Oct 8, 2011
Showing with 127 additions and 4,035 deletions.
  1. +3 −1 org.eclipse.virgo.ide.runtime.core/META-INF/MANIFEST.MF
  2. +18 −12 org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/management/remote/Bundle.java
  3. +6 −2 org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/management/remote/PackageExport.java
  4. +5 −2 org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/management/remote/PackageImport.java
  5. +26 −9 org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/management/remote/ServiceReference.java
  6. +5 −3 org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/core/IServerVersionHandler.java
  7. +5 −3 ...lipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/internal/core/Server10Handler.java
  8. +42 −4 ...lipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/internal/core/ServerBehaviour.java
  9. +7 −5 ...ime.core/src/org/eclipse/virgo/ide/runtime/internal/core/command/JmxBundleAdminServerCommand.java
  10. +7 −6 org.eclipse.virgo.ide.runtime.ui/META-INF/MANIFEST.MF
  11. +3 −3 org.eclipse.virgo.ide.runtime.ui/plugin.xml
  12. +0 −188 ....virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/AbstractBundleEditorPage.java
  13. +0 −68 org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/SearchControl.java
  14. +0 −78 ...eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/SearchTextHistory.java
  15. +0 −50 ...irgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/console/ConsoleSectionPart.java
  16. +0 −235 ...ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/console/ServerConsoleEditorPage.java
  17. +0 −482 ...i/src/org/eclipse/virgo/ide/runtime/internal/ui/dependencies/BundleDependencyContentProvider.java
  18. +0 −88 ....ui/src/org/eclipse/virgo/ide/runtime/internal/ui/dependencies/BundleDependencyContentResult.java
  19. +0 −445 ...ime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/dependencies/BundleDependencyEditorPage.java
  20. +0 −160 ....ui/src/org/eclipse/virgo/ide/runtime/internal/ui/dependencies/BundleDependencyLabelProvider.java
  21. +0 −240 ...i/src/org/eclipse/virgo/ide/runtime/internal/ui/dependencies/BundleDependencyLayoutAlgorithm.java
  22. +0 −129 ...rg/eclipse/virgo/ide/runtime/internal/ui/dependencies/FocusedBundleDependencyLayoutAlgorithm.java
  23. +0 −65 ...se.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/model/BundleDependency.java
  24. +0 −64 ...ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/model/ManagementConnectorClient.java
  25. +0 −58 ...o.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/model/PackageBundleDependency.java
  26. +0 −58 ...time.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/model/ServiceReferenceBundleDependency.java
  27. +0 −730 ...ntime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/overview/BundleInformationDetailsPart.java
  28. +0 −107 ...untime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/overview/BundleInformationEditorPage.java
  29. +0 −260 ...i/src/org/eclipse/virgo/ide/runtime/internal/ui/overview/BundleInformationMasterDetailsBlock.java
  30. +0 −480 ...untime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/overview/BundleInformationMasterPart.java
@@ -48,7 +48,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.tptp.platform.execution;bundle-version="[4.4.0,5.0.0)";resolution:=optional,
org.eclipse.tptp.platform.profile.server.core;resolution:=optional,
org.eclipse.tptp.platform.integration.pde;resolution:=optional
-Import-Package: org.apache.commons.logging;version="[1.1.1,2.0.0)"
+Import-Package: org.apache.commons.logging;version="[1.1.1,2.0.0)",
+ org.eclipse.libra.framework.editor.core;version="[0.1.0,2.0.0)",
+ org.eclipse.libra.framework.editor.core.model;version="[0.1.0,2.0.0)
Export-Package: org.eclipse.virgo.ide.bundlerepository.domain,
org.eclipse.virgo.ide.management.remote,
org.eclipse.virgo.ide.runtime.core,
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2009 SpringSource, a divison of VMware, Inc.
+ * Copyright (c) 2009, 2011 SpringSource, a divison of VMware, Inc. 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:
* SpringSource, a division of VMware, Inc. - initial API and implementation
+ * SAP AG - moving to Eclipse Libra project and enhancements
*******************************************************************************/
package org.eclipse.virgo.ide.management.remote;
@@ -16,21 +17,26 @@
import java.util.Map;
import java.util.Set;
+import org.eclipse.libra.framework.editor.core.model.IBundle;
+import org.eclipse.libra.framework.editor.core.model.IPackageExport;
+import org.eclipse.libra.framework.editor.core.model.IPackageImport;
+import org.eclipse.libra.framework.editor.core.model.IServiceReference;
import org.springframework.util.ObjectUtils;
/**
* @author Christian Dupuis
+ * @author Kaloyan Raev
*/
-public class Bundle implements Serializable {
+public class Bundle implements IBundle, Serializable {
private static final long serialVersionUID = 228698327431610457L;
- private final Set<PackageExport> exports = new HashSet<PackageExport>();
+ private final Set<IPackageExport> exports = new HashSet<IPackageExport>();
private final String id;
- private final Set<PackageImport> imports = new HashSet<PackageImport>();
+ private final Set<IPackageImport> imports = new HashSet<IPackageImport>();
private final String state;
@@ -42,9 +48,9 @@
private final Map<String, String> headers = new HashMap<String, String>();
- private final Set<ServiceReference> registeredServices = new HashSet<ServiceReference>();
+ private final Set<IServiceReference> registeredServices = new HashSet<IServiceReference>();
- private final Set<ServiceReference> servicesInUse = new HashSet<ServiceReference>();
+ private final Set<IServiceReference> servicesInUse = new HashSet<IServiceReference>();
public Bundle(String id, String symbolicName, String version, String state, String location) {
this.symbolicName = symbolicName;
@@ -58,15 +64,15 @@ public Bundle(String id, String symbolicName, String version, String state, Stri
return headers;
}
- public Set<PackageExport> getPackageExports() {
+ public Set<IPackageExport> getPackageExports() {
return exports;
}
public String getId() {
return id;
}
- public Set<PackageImport> getPackageImports() {
+ public Set<IPackageImport> getPackageImports() {
return imports;
}
@@ -90,11 +96,11 @@ public void addPackageImport(PackageImport pi) {
this.imports.add(pi);
}
- public void addRegisteredService(ServiceReference pi) {
+ public void addRegisteredService(IServiceReference pi) {
this.registeredServices.add(pi);
}
- public void addUsingService(ServiceReference pi) {
+ public void addUsingService(IServiceReference pi) {
this.servicesInUse.add(pi);
}
@@ -106,11 +112,11 @@ public String getLocation() {
return location;
}
- public Set<ServiceReference> getRegisteredServices() {
+ public Set<IServiceReference> getRegisteredServices() {
return registeredServices;
}
- public Set<ServiceReference> getServicesInUse() {
+ public Set<IServiceReference> getServicesInUse() {
return servicesInUse;
}
@@ -1,21 +1,25 @@
/*******************************************************************************
- * Copyright (c) 2009 SpringSource, a divison of VMware, Inc.
+ * Copyright (c) 2009, 2011 SpringSource, a divison of VMware, Inc. 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:
* SpringSource, a division of VMware, Inc. - initial API and implementation
+ * SAP AG - moving to Eclipse Libra project and enhancements
*******************************************************************************/
package org.eclipse.virgo.ide.management.remote;
import java.io.Serializable;
+import org.eclipse.libra.framework.editor.core.model.IPackageExport;
+
/**
* @author Christian Dupuis
+ * @author Kaloyan Raev
*/
-public class PackageExport implements Serializable {
+public class PackageExport implements IPackageExport, Serializable {
private static final long serialVersionUID = -4798012781542524159L;
@@ -1,23 +1,26 @@
/*******************************************************************************
- * Copyright (c) 2009 SpringSource, a divison of VMware, Inc.
+ * Copyright (c) 2009, 2011 SpringSource, a divison of VMware, Inc. 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:
* SpringSource, a division of VMware, Inc. - initial API and implementation
+ * SAP AG - moving to Eclipse Libra project and enhancements
*******************************************************************************/
package org.eclipse.virgo.ide.management.remote;
import java.io.Serializable;
+import org.eclipse.libra.framework.editor.core.model.IPackageImport;
import org.springframework.util.ObjectUtils;
/**
* @author Christian Dupuis
+ * @author Kaloyan Raev
*/
-public class PackageImport implements Serializable {
+public class PackageImport implements IPackageImport, Serializable {
private static final long serialVersionUID = 8376491037926415151L;
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2009 SpringSource, a divison of VMware, Inc.
+ * Copyright (c) 2009, 2011 SpringSource, a divison of VMware, Inc. 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:
* SpringSource, a division of VMware, Inc. - initial API and implementation
+ * SAP AG - moving to Eclipse Libra project and enhancements
*******************************************************************************/
package org.eclipse.virgo.ide.management.remote;
@@ -16,27 +17,35 @@
import java.util.Map;
import java.util.Set;
+import org.eclipse.libra.framework.editor.core.model.IServiceReference;
import org.springframework.util.ObjectUtils;
/**
* @author Christian Dupuis
+ * @author Kaloyan Raev
*/
-public class ServiceReference implements Serializable {
-
+public class ServiceReference implements IServiceReference, Serializable {
+
+ /*
+ * Although this enum is now defined in the IServiceReference interface, we
+ * still need to keep it in this class definition for backward compatibility
+ * with earlier version of this class. Otherwise, UnmarshalException will be
+ * thrown.
+ */
public enum Type {
IN_USE, REGISTERED
}
private static final long serialVersionUID = -4896924600246187914L;
-
+
private final Long bundleId;
private final String[] clazzes;
private final Map<String, String> properties = new HashMap<String, String>();
private final Set<Long> usingBundles = new HashSet<Long>();
-
+
private final Type type;
public ServiceReference(Type type, Long bundleId, String[] clazzes) {
@@ -52,7 +61,7 @@ public ServiceReference(Type type, Long bundleId, String[] clazzes) {
public String[] getClazzes() {
return clazzes;
}
-
+
public Set<Long> getUsingBundleIds() {
return usingBundles;
}
@@ -69,10 +78,18 @@ public Long getBundleId() {
return bundleId;
}
- public Type getType() {
- return type;
+ /*
+ * Convert ServiceReference.Type returned by the JMX MBean into
+ * IServiceReference.Type used by the bundle editor.
+ */
+ public IServiceReference.Type getType() {
+ if (type == Type.REGISTERED) {
+ return IServiceReference.Type.REGISTERED;
+ } else {
+ return IServiceReference.Type.IN_USE;
+ }
}
-
+
@Override
public int hashCode() {
int hashCode = 17;
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2009 SpringSource, a divison of VMware, Inc.
+ * Copyright (c) 2009, 2011 SpringSource, a divison of VMware, Inc. 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:
* SpringSource, a division of VMware, Inc. - initial API and implementation
+ * SAP AG - moving to Eclipse Libra project and enhancements
*******************************************************************************/
package org.eclipse.virgo.ide.runtime.core;
@@ -17,7 +18,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.virgo.ide.management.remote.Bundle;
+import org.eclipse.libra.framework.editor.core.model.IBundle;
import org.eclipse.virgo.ide.runtime.internal.core.DeploymentIdentity;
import org.eclipse.virgo.ide.runtime.internal.core.command.IServerCommand;
import org.eclipse.wst.server.core.IModule;
@@ -28,6 +29,7 @@
/**
* Interface that encapsulates different dm server settings that are depending on the version.
* @author Christian Dupuis
+ * @author Kaloyan Raev
* @since 1.0.0
*/
public interface IServerVersionHandler {
@@ -151,7 +153,7 @@
/**
* Returns the server bundle admin command.
*/
- IServerCommand<Map<Long, Bundle>> getServerBundleAdminCommand(IServerBehaviour serverBehaviour);
+ IServerCommand<Map<Long, IBundle>> getServerBundleAdminCommand(IServerBehaviour serverBehaviour);
/**
* Returns the server bundle execute command.
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2009 SpringSource, a divison of VMware, Inc.
+ * Copyright (c) 2009, 2011 SpringSource, a divison of VMware, Inc. 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:
* SpringSource, a division of VMware, Inc. - initial API and implementation
+ * SAP AG - moving to Eclipse Libra project and enhancements
*******************************************************************************/
package org.eclipse.virgo.ide.runtime.internal.core;
@@ -23,7 +24,7 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.virgo.ide.management.remote.Bundle;
+import org.eclipse.libra.framework.editor.core.model.IBundle;
import org.eclipse.virgo.ide.runtime.core.IServerBehaviour;
import org.eclipse.virgo.ide.runtime.core.IServerVersionHandler;
import org.eclipse.virgo.ide.runtime.core.ServerCorePlugin;
@@ -48,6 +49,7 @@
/**
* {@link IServerVersionHandler} for version 1.0 of the dm Server.
* @author Christian Dupuis
+ * @author Kaloyan Raev
* @since 1.0.0
*/
public class Server10Handler implements IServerVersionHandler {
@@ -251,7 +253,7 @@ public String getShutdownMBeanName() {
/**
* {@inheritDoc}
*/
- public IServerCommand<Map<Long, Bundle>> getServerBundleAdminCommand(IServerBehaviour serverBehaviour) {
+ public IServerCommand<Map<Long, IBundle>> getServerBundleAdminCommand(IServerBehaviour serverBehaviour) {
return new JmxBundleAdminServerCommand(serverBehaviour);
}
Oops, something went wrong.

0 comments on commit 665cf74

Please sign in to comment.