JBoss Tools SVN: r26958 - branches/jbosstools-3.2.0.Beta2/build/aggregate/site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-11-25 18:23:26 -0500 (Thu, 25 Nov 2010)
New Revision: 26958
Modified:
branches/jbosstools-3.2.0.Beta2/build/aggregate/site/pom.xml
Log:
add helios to resolve missing savara deps
Modified: branches/jbosstools-3.2.0.Beta2/build/aggregate/site/pom.xml
===================================================================
--- branches/jbosstools-3.2.0.Beta2/build/aggregate/site/pom.xml 2010-11-25 19:12:33 UTC (rev 26957)
+++ branches/jbosstools-3.2.0.Beta2/build/aggregate/site/pom.xml 2010-11-25 23:23:26 UTC (rev 26958)
@@ -16,15 +16,15 @@
<properties>
<!-- add more inputRepo# here, then reference below; need variables so
that these can be referred to in Ant script later -->
- <!-- <inputRepo1>http://download.jboss.org/jbosstools/builds/staging/jbosstools-3.2.0.Beta...</inputRepo1>
- <inputRepo2>http://download.jboss.org/jbosstools/builds/staging/pi4soa-3.1.x</inputRepo2>
- <inputRepo3>http://download.jboss.org/jbosstools/builds/staging/jbosstools-teiid-desi...</inputRepo3>
- <inputRepo4>http://download.jboss.org/jbosstools/builds/staging/jbosstools-drools-5.2</inputRepo4>
- <inputRepo5>http://download.jboss.org/jbosstools/builds/staging/jbosstools-savara-1.1.x</inputRepo5>
- <inputRepo6>http://download.jboss.org/jbosstools/builds/staging/jbosstools-tests</inputRepo6>
- <inputRepo7>http://download.jboss.org/jbosstools/builds/staging/jbosstools-common</inputRepo7>
- <inputRepo8>http://download.jboss.org/jbosstools/builds/staging/jbosstools-jmx</inputRepo8>
- <inputRepos>1,2,3,4,5,6,7,8</inputRepos> -->
+ <!-- <inputRepo1>http://download.jboss.org/jbosstools/builds/staging/jbosstools-3.2.0.Beta...</inputRepo1>
+ <inputRepo2>http://download.jboss.org/jbosstools/builds/staging/pi4soa-3.1.x</inputRepo2>
+ <inputRepo3>http://download.jboss.org/jbosstools/builds/staging/jbosstools-teiid-desi...</inputRepo3>
+ <inputRepo4>http://download.jboss.org/jbosstools/builds/staging/jbosstools-drools-5.2</inputRepo4>
+ <inputRepo5>http://download.jboss.org/jbosstools/builds/staging/jbosstools-savara-1.1.x</inputRepo5>
+ <inputRepo6>http://download.jboss.org/jbosstools/builds/staging/jbosstools-tests</inputRepo6>
+ <inputRepo7>http://download.jboss.org/jbosstools/builds/staging/jbosstools-common</inputRepo7>
+ <inputRepo8>http://download.jboss.org/jbosstools/builds/staging/jbosstools-jmx</inputRepo8>
+ <inputRepos>1,2,3,4,5,6,7,8</inputRepos> -->
<!-- use a single composite site so adding more jobs' output is easier -->
<inputRepo1>http://download.jboss.org/jbosstools/builds/staging/_composite_/3.2.0.Beta2/</inputRepo1>
<inputRepos>1</inputRepos>
@@ -44,13 +44,11 @@
<quiet>true</quiet>
<tasks>
<property name="inputRepo1" value="${inputRepo1}" />
- <!-- <property name="inputRepo2" value="${inputRepo2}" />
- <property name="inputRepo3" value="${inputRepo3}" />
- <property name="inputRepo4" value="${inputRepo4}" />
- <property name="inputRepo5" value="${inputRepo5}" />
- <property name="inputRepo6" value="${inputRepo6}" />
- <property name="inputRepo7" value="${inputRepo7}" />
- <property name="inputRepo8" value="${inputRepo8}" /> -->
+ <!-- <property name="inputRepo2" value="${inputRepo2}" /> <property
+ name="inputRepo3" value="${inputRepo3}" /> <property name="inputRepo4" value="${inputRepo4}"
+ /> <property name="inputRepo5" value="${inputRepo5}" /> <property name="inputRepo6"
+ value="${inputRepo6}" /> <property name="inputRepo7" value="${inputRepo7}"
+ /> <property name="inputRepo8" value="${inputRepo8}" /> -->
<property name="inputRepos" value="${inputRepos}" />
<!-- called AFTER generating update site + zip to add in extra content -->
@@ -100,69 +98,31 @@
<enabled>true</enabled>
</snapshots>
</repository>
- <!-- <repository>
- <id>inputRepo1</id>
- <url>${inputRepo1}/all/repo/</url>
- <layout>p2</layout>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
+ <!-- <repository> <id>inputRepo1</id> <url>${inputRepo1}/all/repo/</url>
+ <layout>p2</layout> <snapshots> <enabled>true</enabled> </snapshots> </repository>
+ <repository> <id>inputRepo2</id> <url>${inputRepo2}/all/repo/</url> <layout>p2</layout>
+ <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository>
+ <id>inputRepo3</id> <url>${inputRepo3}/all/repo/</url> <layout>p2</layout>
+ <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository>
+ <id>inputRepo4</id> <url>${inputRepo4}/all/repo/</url> <layout>p2</layout>
+ <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository>
+ <id>inputRepo5</id> <url>${inputRepo5}/tools/</url> <layout>p2</layout> <snapshots>
+ <enabled>true</enabled> </snapshots> </repository> <repository> <id>inputRepo6</id>
+ <url>${inputRepo6}/tools/</url> <layout>p2</layout> <snapshots> <enabled>true</enabled>
+ </snapshots> </repository> <repository> <id>inputRepo7</id> <url>${inputRepo7}/tools/</url>
+ <layout>p2</layout> <snapshots> <enabled>true</enabled> </snapshots> </repository>
+ <repository> <id>inputRepo8</id> <url>${inputRepo8}/tools/</url> <layout>p2</layout>
+ <snapshots> <enabled>true</enabled> </snapshots> </repository> -->
<repository>
- <id>inputRepo2</id>
- <url>${inputRepo2}/all/repo/</url>
+ <id>helios</id>
+ <url>http://download.eclipse.org/releases/helios/</url>
<layout>p2</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
- </repository>
- <repository>
- <id>inputRepo3</id>
- <url>${inputRepo3}/all/repo/</url>
- <layout>p2</layout>
- <snapshots>
+ <releases>
<enabled>true</enabled>
- </snapshots>
+ </releases>
</repository>
- <repository>
- <id>inputRepo4</id>
- <url>${inputRepo4}/all/repo/</url>
- <layout>p2</layout>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>inputRepo5</id>
- <url>${inputRepo5}/tools/</url>
- <layout>p2</layout>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>inputRepo6</id>
- <url>${inputRepo6}/tools/</url>
- <layout>p2</layout>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>inputRepo7</id>
- <url>${inputRepo7}/tools/</url>
- <layout>p2</layout>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>inputRepo8</id>
- <url>${inputRepo8}/tools/</url>
- <layout>p2</layout>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository> -->
</repositories>
</project>
13 years, 5 months
JBoss Tools SVN: r26957 - in trunk/deltacloud: plugins/org.jboss.tools.deltacloud.ui/.settings and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-25 14:12:33 -0500 (Thu, 25 Nov 2010)
New Revision: 26957
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.docs/.settings/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/.settings/
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/.settings/
Log:
[JBIDE-7694] revamped synchronization in DeltaCloud
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.docs/.settings
___________________________________________________________________
Name: svn:ignore
+ org.jboss.ide.eclipse.as.core.prefs
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/.settings
___________________________________________________________________
Name: svn:ignore
+ org.jboss.ide.eclipse.as.core.prefs
Property changes on: trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/.settings
___________________________________________________________________
Name: svn:ignore
+ org.jboss.ide.eclipse.as.core.prefs
13 years, 5 months
JBoss Tools SVN: r26956 - trunk/common/plugins/org.jboss.tools.common/.settings.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-25 14:12:23 -0500 (Thu, 25 Nov 2010)
New Revision: 26956
Modified:
trunk/common/plugins/org.jboss.tools.common/.settings/
Log:
[JBIDE-7694] revamped synchronization in DeltaCloud
Property changes on: trunk/common/plugins/org.jboss.tools.common/.settings
___________________________________________________________________
Name: svn:ignore
+ org.jboss.ide.eclipse.as.core.prefs
13 years, 5 months
JBoss Tools SVN: r26955 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core: .settings and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-25 14:11:13 -0500 (Thu, 25 Nov 2010)
New Revision: 26955
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/.settings/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java
Log:
[JBIDE-7694] revamped synchronization in DeltaCloud
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/.settings
___________________________________________________________________
Name: svn:ignore
+ org.jboss.ide.eclipse.as.core.prefs
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-25 19:07:21 UTC (rev 26954)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-25 19:11:13 UTC (rev 26955)
@@ -1,3 +1,12 @@
+2010-11-25 André Dietisheim <adietish(a)redhat.com>
+
+ * src/org/jboss/tools/deltacloud/core/DeltaCloud.java:
+ * src/org/jboss/tools/deltacloud/core/DeltaCloudImagesRepository.java:
+ * src/org/jboss/tools/deltacloud/core/DeltaCloudInstancesRepository.java:
+ * src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java:
+ [JBIDE-7694] revamped synchronization in class DeltaCloud: extracted image- and instance-list to their own classes
+ (and could drop all synchronization in deltacloud)
+
2010-11-19 André Dietisheim <adietish(a)redhat.com>
* src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java:
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java 2010-11-25 19:07:21 UTC (rev 26954)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java 2010-11-25 19:11:13 UTC (rev 26955)
@@ -17,6 +17,12 @@
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
+/**
+ * @author André Dietisheim
+ *
+ * @param <E> Element to store
+ * @param <C> Criteria to match element against
+ */
public abstract class AbstractDeltaCloudObjectRepository<E, C> {
private List<E> objects = new ArrayList<E>();
13 years, 5 months
JBoss Tools SVN: r26954 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-25 14:07:21 -0500 (Thu, 25 Nov 2010)
New Revision: 26954
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ErrorUtils.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCategoryElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java
Log:
[JBIDE-7694] revamped synchronization in DeltaCloud
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-25 19:06:43 UTC (rev 26953)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-25 19:07:21 UTC (rev 26954)
@@ -1,3 +1,15 @@
+2010-11-25 André Dietisheim <adietish(a)redhat.com>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java (performTest):
+ fixed NPE
+
+2010-11-24 adietisheim <adietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/deltacloud/ui/views/InstanceView.java (.modifyText):
+ [JBIDE-7694] removed refresh(es) of tableViewer (setInput should be enough),
+ moved set of current cloud to central method with null-check,
+ removed clouds collection & replaced by fresh fetch in DeltaCloudManager
+
2010-11-23 André Dietisheim <adietish(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ErrorUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ErrorUtils.java 2010-11-25 19:06:43 UTC (rev 26953)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ErrorUtils.java 2010-11-25 19:07:21 UTC (rev 26954)
@@ -15,7 +15,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.DeltaCloudMultiException;
@@ -38,13 +37,13 @@
}
}
- private static IStatus openErrorDialog(final String title, final IStatus status, final Shell shell) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- ErrorDialog.openError(shell, title, status.getMessage(), status);
- }
- });
- return status;
+ private static void openErrorDialog(final String title, final IStatus status, final Shell shell) {
+// Display.getDefault().syncExec(new Runnable() {
+// public void run() {
+// ErrorDialog.openError(shell, title, status.getMessage(), status);
+// }
+// });
+ ErrorDialog.openError(shell, title, status.getMessage(), status);
}
public static IStatus createMultiStatus(DeltaCloudMultiException throwable) {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCategoryElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCategoryElement.java 2010-11-25 19:06:43 UTC (rev 26953)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCategoryElement.java 2010-11-25 19:07:21 UTC (rev 26954)
@@ -59,7 +59,7 @@
}
protected void refresh() {
- Display.getDefault().asyncExec(new Runnable() {
+ Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
IStructuredSelection oldSelection = (IStructuredSelection) viewer.getSelection();
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-11-25 19:06:43 UTC (rev 26953)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-11-25 19:07:21 UTC (rev 26954)
@@ -13,7 +13,6 @@
import java.util.ArrayList;
import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.widgets.Display;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
import org.jboss.tools.deltacloud.core.IImageFilter;
@@ -79,7 +78,7 @@
ErrorUtils.handleError(
"Error",
"Colud not get images from cloud " + cloud.getName(),
- e, Display.getDefault().getActiveShell());
+ e, getViewer().getControl().getShell());
}
}
return super.getChildren();
13 years, 5 months
JBoss Tools SVN: r26953 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-25 14:06:43 -0500 (Thu, 25 Nov 2010)
New Revision: 26953
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java
Log:
fixed NPE
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java 2010-11-25 19:04:55 UTC (rev 26952)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java 2010-11-25 19:06:43 UTC (rev 26953)
@@ -24,6 +24,7 @@
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudManager;
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientImpl.DeltaCloudServerType;
import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.ErrorUtils;
@@ -100,7 +101,7 @@
String url = mainPage.getModel().getUrl();
String username = mainPage.getModel().getUsername();
String password = mainPage.getModel().getPassword();
- String type = mainPage.getModel().getType().toString();
+ String type = getServerType();
try {
String oldName = cloud.getName();
cloud.editCloud(name, url, username, password, type);
@@ -113,6 +114,15 @@
return true;
}
+ private String getServerType() {
+ DeltaCloudServerType type = mainPage.getModel().getType();
+ if (type == null) {
+ return null;
+ }
+
+ return type.toString();
+ }
+
@Override
public boolean needsProgressMonitor() {
return true;
13 years, 5 months
JBoss Tools SVN: r26952 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-25 14:04:55 -0500 (Thu, 25 Nov 2010)
New Revision: 26952
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java
Log:
cleanup: removed logging (will now make it into ErrorUtils#handleError)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java 2010-11-25 19:04:09 UTC (rev 26951)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java 2010-11-25 19:04:55 UTC (rev 26952)
@@ -57,7 +57,6 @@
cloud.waitForState(id, expectedState, pm);
} catch (Exception e) {
final IStatus status = StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
- Activator.log(status);
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
13 years, 5 months
JBoss Tools SVN: r26951 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-25 14:04:09 -0500 (Thu, 25 Nov 2010)
New Revision: 26951
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformDestroyInstanceActionThread.java
Log:
removed duplicate code: destroyInstance is already handled by performInstanceAction
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformDestroyInstanceActionThread.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformDestroyInstanceActionThread.java 2010-11-25 19:00:25 UTC (rev 26950)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformDestroyInstanceActionThread.java 2010-11-25 19:04:09 UTC (rev 26951)
@@ -48,7 +48,7 @@
@Override
public void run() {
try {
- cloud.destroyInstance(instance.getId());
+ cloud.performInstanceAction(instance.getId(), DeltaCloudInstance.START);
} catch (DeltaCloudException e) {
ErrorUtils.handleError("Error",
MessageFormat.format("Could not destroy instance {0}", instance.getName()), e,
13 years, 5 months
JBoss Tools SVN: r26950 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-25 14:00:25 -0500 (Thu, 25 Nov 2010)
New Revision: 26950
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImagesRepository.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstancesRepository.java
Log:
[JBIDE-7694] revamped synchronization in DeltaCloud
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java 2010-11-25 19:00:25 UTC (rev 26950)
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core;
+
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+public abstract class AbstractDeltaCloudObjectRepository<E, C> {
+
+ private List<E> objects = new ArrayList<E>();
+ // TODO switch to readwrite lock to gain performance
+ private Lock lock = new ReentrantLock();
+ private Class<E> typeClass;
+
+ protected AbstractDeltaCloudObjectRepository(Class<E> typeClass) {
+ this.typeClass = typeClass;
+ }
+
+ public void add(E object) {
+ try {
+ lock();
+ objects.add(object);
+ } finally {
+ unlock();
+ }
+ }
+
+ public void add(Collection<E> objects) {
+ try {
+ lock();
+ for (E object : objects) {
+ objects.add(object);
+ }
+ } finally {
+ unlock();
+ }
+ }
+
+ public void clear() {
+ try {
+ lock();
+ objects.clear();
+ } finally {
+ unlock();
+ }
+ }
+
+ public E[] get() {
+ try {
+ lock();
+ @SuppressWarnings("unchecked")
+ E[] objectArray = (E[]) objects.toArray((E[]) Array.newInstance(typeClass, objects.size()));
+ return objectArray;
+ } finally {
+ unlock();
+ }
+ }
+
+ protected E getById(C criteria) {
+ try {
+ lock();
+ E matchingObject = null;
+ for (E object : objects) {
+ // TODO: use comparator
+ if (matches(criteria, object)) {
+ matchingObject = object;
+ break;
+ }
+ }
+ return matchingObject;
+ } finally {
+ unlock();
+ }
+ }
+
+ protected abstract boolean matches(C criteria, E object);
+
+ public void remove(DeltaCloudInstance instance) {
+ try {
+ lock();
+ objects.remove(instance);
+ } finally {
+ unlock();
+ }
+ }
+
+ protected void lock() {
+ lock.lock();
+ }
+
+ protected void unlock() {
+ lock.unlock();
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImagesRepository.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImagesRepository.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImagesRepository.java 2010-11-25 19:00:25 UTC (rev 26950)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.jboss.tools.deltacloud.core.client.Image;
+
+/**
+ * @author André Dietisheim
+ */
+public class DeltaCloudImagesRepository extends AbstractDeltaCloudObjectRepository<DeltaCloudImage, String> {
+
+ public DeltaCloudImagesRepository() {
+ super(DeltaCloudImage.class);
+ }
+
+ public DeltaCloudImage add(Image image, DeltaCloud cloud) {
+ DeltaCloudImage deltaCloudImage = new DeltaCloudImage(image, cloud);
+ add(deltaCloudImage);
+ return deltaCloudImage;
+ }
+
+ public Collection<DeltaCloudImage> add(Collection<Image> imagesToAdd, DeltaCloud cloud) {
+ List<DeltaCloudImage> deltaCloudImages = new ArrayList<DeltaCloudImage>();
+ for (Image image : imagesToAdd) {
+ DeltaCloudImage deltaCloudImage = add(image, cloud);
+ deltaCloudImages.add(deltaCloudImage);
+ }
+ return deltaCloudImages;
+ }
+
+ @Override
+ protected boolean matches(String id, DeltaCloudImage image) {
+ return image != null
+ && id.equals(image.getId());
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImagesRepository.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstancesRepository.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstancesRepository.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstancesRepository.java 2010-11-25 19:00:25 UTC (rev 26950)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.jboss.tools.deltacloud.core.client.Instance;
+
+/**
+ * @author André Dietisheim
+ */
+public class DeltaCloudInstancesRepository extends AbstractDeltaCloudObjectRepository<DeltaCloudInstance, String> {
+
+ /**
+ * Instantiates a new delta cloud instances.
+ */
+ public DeltaCloudInstancesRepository() {
+ super(DeltaCloudInstance.class);
+ }
+
+ /**
+ * Adds the.
+ *
+ * @param instance the instance
+ * @param cloud the cloud
+ * @return the delta cloud instance
+ */
+ public DeltaCloudInstance add(Instance instance, DeltaCloud cloud) {
+ DeltaCloudInstance deltaCloudInstance = new DeltaCloudInstance(cloud, instance);
+ add(deltaCloudInstance);
+ return deltaCloudInstance;
+ }
+
+ /**
+ * Adds the.
+ *
+ * @param instancesToAdd the instances to add
+ * @param cloud the cloud
+ * @return the collection
+ */
+ public Collection<DeltaCloudInstance> add(Collection<Instance> instancesToAdd, DeltaCloud cloud) {
+ List<DeltaCloudInstance> deltaCloudInstances = new ArrayList<DeltaCloudInstance>();
+ for (Instance instance : instancesToAdd) {
+ DeltaCloudInstance deltaCloudInstance = add(instance, cloud);
+ deltaCloudInstances.add(deltaCloudInstance);
+ }
+ return deltaCloudInstances;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.deltacloud.core.AbstractDeltaCloudObjectRepository#matches(java.lang.Object, java.lang.Object)
+ */
+ @Override
+ protected boolean matches(String id, DeltaCloudInstance instance) {
+ return instance != null
+ && id.equals(instance.getId());
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstancesRepository.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
13 years, 5 months
JBoss Tools SVN: r26949 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-25 13:59:33 -0500 (Thu, 25 Nov 2010)
New Revision: 26949
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
[JBIDE-7694] revamped synchronization in DeltaCloud
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-25 17:53:36 UTC (rev 26948)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-25 18:59:33 UTC (rev 26949)
@@ -36,6 +36,10 @@
import org.jboss.tools.deltacloud.core.client.InternalDeltaCloudClient;
import org.jboss.tools.deltacloud.core.client.Realm;
+/**
+ * @author Jeff Jonston
+ * @author André Dietisheim
+ */
public class DeltaCloud {
public final static String MOCK_TYPE = "MOCK"; //$NON-NLS-1$
@@ -47,15 +51,19 @@
private String type;
private String lastKeyname = "";
private String lastImageId = "";
+
private InternalDeltaCloudClient client;
- private ArrayList<DeltaCloudInstance> instances;
- private ArrayList<DeltaCloudImage> images;
+
+ private DeltaCloudImagesRepository images = new DeltaCloudImagesRepository();
+ private DeltaCloudInstancesRepository instances = new DeltaCloudInstancesRepository();
+
private IImageFilter imageFilter;
private IInstanceFilter instanceFilter;
+
private Map<String, Job> actionJobs;
- private Object imageLock = new Object();
- private Object instanceLock = new Object();
+
private Object actionLock = new Object();
+ // TODO: switch to readwrite lock
ListenerList instanceListeners = new ListenerList();
ListenerList imageListeners = new ListenerList();
@@ -68,7 +76,8 @@
this(name, url, username, passwd, null);
}
- public DeltaCloud(String name, String url, String username, String password, String type) throws DeltaCloudException {
+ public DeltaCloud(String name, String url, String username, String password, String type)
+ throws DeltaCloudException {
this(name, url, username, password, type, IImageFilter.ALL_STRING, IInstanceFilter.ALL_STRING);
}
@@ -101,7 +110,8 @@
loadChildren();
}
- private InternalDeltaCloudClient createClient(String name, String url, String username, String password) throws DeltaCloudException {
+ private InternalDeltaCloudClient createClient(String name, String url, String username, String password)
+ throws DeltaCloudException {
try {
if (password == null) {
password = getPasswordFromPreferences(name, username);
@@ -200,7 +210,7 @@
// save();
// TODO: remove notification with all instances, replace by
// notifying the changed instance
- notifyInstanceListListeners();
+ notifyInstanceListListeners(instances.get());
}
}
@@ -281,11 +291,12 @@
instanceListeners.remove(listener);
}
- public void notifyInstanceListListeners(DeltaCloudInstance[] array) {
+ private DeltaCloudInstance[] notifyInstanceListListeners(DeltaCloudInstance[] array) {
Object[] listeners = instanceListeners.getListeners();
for (int i = 0; i < listeners.length; ++i) {
((IInstanceListListener) listeners[i]).listChanged(this, array);
}
+ return array;
}
public void addImageListListener(IImageListListener listener) {
@@ -296,32 +307,20 @@
imageListeners.remove(listener);
}
- public DeltaCloudImage[] notifyImageListListeners() {
- DeltaCloudImage[] images = cloneImagesArray();
- notifyImageListListeners(images);
- return images;
+ private DeltaCloudInstance[] cloneInstancesArray() {
+ return instances.get();
}
- public DeltaCloudInstance[] notifyInstanceListListeners() {
- DeltaCloudInstance[] instances = cloneInstancesArray();
- notifyInstanceListListeners(instances);
- return instances;
- }
-
private DeltaCloudImage[] cloneImagesArray() {
- DeltaCloudImage[] imageArray = new DeltaCloudImage[images.size()];
- return images.toArray(imageArray);
+ return images.get();
}
- private DeltaCloudInstance[] cloneInstancesArray() {
- DeltaCloudInstance[] instanceArray = new DeltaCloudInstance[instances.size()];
- return instances.toArray(instanceArray);
- }
-
- public void notifyImageListListeners(DeltaCloudImage[] array) {
+ private DeltaCloudImage[] notifyImageListListeners(DeltaCloudImage[] array) {
Object[] listeners = imageListeners.getListeners();
- for (int i = 0; i < listeners.length; ++i)
+ for (int i = 0; i < listeners.length; ++i) {
((IImageListListener) listeners[i]).listChanged(this, array);
+ }
+ return array;
}
public Job getInstanceJob(String id) {
@@ -368,14 +367,16 @@
public DeltaCloudInstance waitForState(String instanceId, IInstanceStateMatcher stateMatcher, IProgressMonitor pm)
throws InterruptedException, DeltaCloudException {
- DeltaCloudInstance instance = getInstance(instanceId);
- while (!pm.isCanceled()) {
- if (stateMatcher.matchesState(instance, instance.getState())
- || instance.getState().equals(DeltaCloudInstance.TERMINATED)) {
- return instance;
+ DeltaCloudInstance instance = findInstanceById(instanceId);
+ if (instance != null) {
+ while (!pm.isCanceled()) {
+ if (stateMatcher.matchesState(instance, instance.getState())
+ || instance.getState().equals(DeltaCloudInstance.TERMINATED)) {
+ return instance;
+ }
+ Thread.sleep(400);
+ instance = refreshInstance(instance.getId());
}
- Thread.sleep(400);
- instance = refreshInstance(instance.getId());
}
return instance;
}
@@ -397,40 +398,43 @@
* @see #notifyInstanceListListeners(DeltaCloudInstance[])
*/
public DeltaCloudInstance[] loadInstances() throws DeltaCloudException {
- synchronized (instanceLock) {
+ try {
clearInstances();
- try {
- List<Instance> list = client.listInstances();
- for (Iterator<Instance> i = list.iterator(); i.hasNext();) {
- DeltaCloudInstance instance = new DeltaCloudInstance(this, i.next());
- instances.add(instance);
- }
- // TODO: remove notification with all instances, replace by
- // notifying the changed instance
- return notifyInstanceListListeners();
- } catch (DeltaCloudClientException e) {
- throw new DeltaCloudException(MessageFormat.format("Could not load instances of cloud {0}: {1}",
+ instances.add(client.listInstances(), this);
+ // TODO: remove notification with all instances, replace by
+ // notifying the changed instance
+ return notifyInstanceListListeners(instances.get());
+ } catch (DeltaCloudClientException e) {
+ throw new DeltaCloudException(MessageFormat.format("Could not load instances of cloud {0}: {1}",
getName(), e.getMessage()), e);
- }
}
}
private void clearInstances() {
- synchronized (instanceLock) {
- instances = new ArrayList<DeltaCloudInstance>();
- notifyInstanceListListeners();
- }
+ instances.clear();
+ notifyInstanceListListeners(instances.get());
}
+ private void clearImages() {
+ images.clear();
+ notifyImageListListeners(images.get());
+ }
+
public DeltaCloudInstance[] getInstances() throws DeltaCloudException {
- synchronized (instanceLock) {
- if (instances == null) {
- return loadInstances();
- }
- return cloneInstancesArray();
+ if (instances == null) {
+ instances = new DeltaCloudInstancesRepository();
+ return loadInstances();
}
+ return cloneInstancesArray();
}
+ public DeltaCloudImage[] getImages() throws DeltaCloudException {
+ if (images == null) {
+ return loadImages();
+ }
+ return cloneImagesArray();
+ }
+
public void createKey(String keyname, String keystoreLocation) throws DeltaCloudException {
try {
client.createKey(keyname, keystoreLocation);
@@ -447,52 +451,57 @@
}
}
+ /**
+ * Replaces the current instance with the given one. The instances are
+ * matched against identical id
+ *
+ * @param instance
+ * the instance that shall replace the current one
+ */
public void replaceInstance(DeltaCloudInstance instance) {
String instanceId = instance.getId();
if (instance != null) {
- boolean found = false;
- for (int i = 0; i < instances.size(); ++i) {
- DeltaCloudInstance inst = instances.get(i);
- if (inst.getId().equals(instanceId)) {
- found = true;
- instances.set(i, instance);
- }
- }
- if (!found) {
- instances.add(instance);
- }
+ DeltaCloudInstance instanceToReplace = findInstanceById(instanceId);
+ replaceInstance(instance, instanceToReplace);
// TODO: remove notification with all instances, replace by
// notifying the changed instance
- notifyInstanceListListeners();
+ notifyInstanceListListeners(instances.get());
}
}
+ private DeltaCloudInstance findInstanceById(String instanceId) {
+ return instances.getById(instanceId);
+ }
+
+ // TODO: remove duplicate code with #replaceInstance
public DeltaCloudInstance refreshInstance(String instanceId) throws DeltaCloudException {
- DeltaCloudInstance retVal = null;
+ DeltaCloudInstance deltaCloudInstance = null;
try {
Instance instance = client.listInstances(instanceId);
- retVal = new DeltaCloudInstance(this, instance);
- for (int i = 0; i < instances.size(); ++i) {
- DeltaCloudInstance inst = instances.get(i);
- if (inst.getId().equals(instanceId)) {
- // FIXME: remove BOGUS state when server fixes state
- // problems
- if (!(retVal.getState().equals(DeltaCloudInstance.BOGUS))
- && !(inst.getState().equals(retVal.getState()))) {
- instances.set(i, retVal);
- notifyInstanceListListeners();
- return retVal;
- }
- }
+ deltaCloudInstance = new DeltaCloudInstance(this, instance);
+ DeltaCloudInstance currentInstance = findInstanceById(instanceId);
+ // FIXME: remove BOGUS state when server fixes state
+ // problems
+ if (!(deltaCloudInstance.getState().equals(DeltaCloudInstance.BOGUS))
+ && !(currentInstance.getState().equals(deltaCloudInstance.getState()))) {
+ replaceInstance(deltaCloudInstance, currentInstance);
+ notifyInstanceListListeners(instances.get());
}
} catch (DeltaCloudClientException e) {
+ // TODO: is this correct?
+ e.printStackTrace();
// will get here when a pending instance is being checked
}
- return retVal;
+ return deltaCloudInstance;
}
+ private void replaceInstance(DeltaCloudInstance deltaCloudInstance, DeltaCloudInstance currentInstance) {
+ instances.remove(currentInstance);
+ instances.add(deltaCloudInstance);
+ }
+
public boolean performInstanceAction(String instanceId, String actionId) throws DeltaCloudException {
- return performInstanceAction(getInstance(instanceId), actionId);
+ return performInstanceAction(findInstanceById(instanceId), actionId);
}
protected boolean performInstanceAction(DeltaCloudInstance instance, String actionId) throws DeltaCloudException {
@@ -505,7 +514,7 @@
if (result) {
// TODO: remove notification with all instances, replace by
// notifying the changed instance
- notifyInstanceListListeners();
+ notifyInstanceListListeners(instances.get());
}
return result;
} catch (DeltaCloudClientException e) {
@@ -513,15 +522,6 @@
}
}
- private DeltaCloudInstance getInstance(String instanceId) {
- for (DeltaCloudInstance instance : instances) {
- if (instance.getId().equals(instanceId)) {
- return instance;
- }
- }
- return null;
- }
-
public DeltaCloudHardwareProfile[] getProfiles() throws DeltaCloudException {
ArrayList<DeltaCloudHardwareProfile> profiles = new ArrayList<DeltaCloudHardwareProfile>();
try {
@@ -541,8 +541,7 @@
public DeltaCloudImage loadImage(String imageId) throws DeltaCloudException {
try {
Image image = client.listImages(imageId);
- DeltaCloudImage deltaCloudImage = addImage(image);
- return deltaCloudImage;
+ return images.add(image, this);
} catch (DeltaCloudClientException e) {
throw new DeltaCloudException(e);
}
@@ -558,53 +557,28 @@
* @see #notifyImageListListeners(DeltaCloudImage[])
*/
public DeltaCloudImage[] loadImages() throws DeltaCloudException {
- synchronized (imageLock) {
- try {
- clearImages();
- List<Image> list = client.listImages();
- for (Iterator<Image> i = list.iterator(); i.hasNext();) {
- addImage(i.next());
- }
- return notifyImageListListeners();
- } catch (DeltaCloudClientException e) {
- throw new DeltaCloudException(MessageFormat.format("Could not load images of cloud {0}: {1}",
+ try {
+ clearImages();
+ images.add(client.listImages(), this);
+ return notifyImageListListeners(images.get());
+ } catch (DeltaCloudClientException e) {
+ throw new DeltaCloudException(MessageFormat.format("Could not load images of cloud {0}: {1}",
getName(), e.getMessage()), e);
- }
}
- }
- private void clearImages() {
- synchronized (imageLock) {
- images = new ArrayList<DeltaCloudImage>();
- notifyImageListListeners();
- }
}
- private DeltaCloudImage addImage(Image image) {
- DeltaCloudImage deltaCloudImage = new DeltaCloudImage(image, this);
- images.add(deltaCloudImage);
- return deltaCloudImage;
- }
-
- public DeltaCloudImage[] getImages() throws DeltaCloudException {
- synchronized (imageLock) {
- if (images == null) {
- return loadImages();
- }
- return cloneImagesArray();
- }
- }
-
public DeltaCloudImage getImage(String imageId) {
- DeltaCloudImage retVal = null;
+ DeltaCloudImage deltaCloudImage = null;
try {
Image image = client.listImages(imageId);
- retVal = new DeltaCloudImage(image, this);
+ deltaCloudImage = new DeltaCloudImage(image, this);
} catch (Exception e) {
+ // TODO: implement proper logging / error reporting / ignore
e.printStackTrace();
// do nothing and return null
}
- return retVal;
+ return deltaCloudImage;
}
public boolean testConnection() throws DeltaCloudException {
@@ -645,20 +619,15 @@
instance = client.createInstance(imageId, profileId, realmId, name, memory, storage);
}
if (instance != null) {
- DeltaCloudInstance newInstance = new DeltaCloudInstance(this, instance);
- newInstance.setGivenName(name);
getInstances(); // make sure instances are initialized
- instances.add(newInstance);
- notifyInstanceListListeners();
- return newInstance;
+ DeltaCloudInstance deltaCloudInstance = instances.add(instance, this);
+ deltaCloudInstance.setGivenName(name);
+ notifyInstanceListListeners(getInstances());
+ return deltaCloudInstance;
}
} catch (DeltaCloudClientException e) {
throw new DeltaCloudException(e);
}
return null;
}
-
- public void destroyInstance(String id) throws DeltaCloudException{
- throw new DeltaCloudException("Method destroyInstance(String id) has not implemented yet"); //$NON-NLS-1$
- }
}
13 years, 5 months