Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
Kaloyan Raev committed Oct 8, 2011
1 parent d6ba8a0 commit 665cf74
Show file tree
Hide file tree
Showing 30 changed files with 127 additions and 4,035 deletions.
4 changes: 3 additions & 1 deletion org.eclipse.virgo.ide.runtime.core/META-INF/MANIFEST.MF
Expand Up @@ -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,
Expand Down
@@ -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;

Expand All @@ -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;

Expand All @@ -42,9 +48,9 @@ public class Bundle implements Serializable {

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;
Expand All @@ -58,15 +64,15 @@ public Map<String, String> getHeaders() {
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;
}

Expand All @@ -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);
}

Expand All @@ -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;
}

Expand Down
@@ -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;

Expand Down
@@ -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;

Expand Down
@@ -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;

Expand All @@ -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) {
Expand All @@ -52,7 +61,7 @@ public Map<String, String> getProperties() {
public String[] getClazzes() {
return clazzes;
}

public Set<Long> getUsingBundleIds() {
return usingBundles;
}
Expand All @@ -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;
Expand Down
@@ -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;

Expand All @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -151,7 +153,7 @@ IServerCommand<DeploymentIdentity> getServerDeployCommand(IServerBehaviour serve
/**
* 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.
Expand Down
@@ -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;

Expand All @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -251,7 +253,7 @@ public IServerCommand<DeploymentIdentity> getServerDeployCommand(IServerBehaviou
/**
* {@inheritDoc}
*/
public IServerCommand<Map<Long, Bundle>> getServerBundleAdminCommand(IServerBehaviour serverBehaviour) {
public IServerCommand<Map<Long, IBundle>> getServerBundleAdminCommand(IServerBehaviour serverBehaviour) {
return new JmxBundleAdminServerCommand(serverBehaviour);
}

Expand Down

0 comments on commit 665cf74

Please sign in to comment.