Author: adietish
Date: 2010-12-14 10:45:07 -0500 (Tue, 14 Dec 2010)
New Revision: 27450
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractInstanceJob.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractCloudElementJob.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractCloudJob.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/InstanceStateJob.java
Log:
[JBIDe-7889] added family to the various job constructors
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractCloudElementJob.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractCloudElementJob.java 2010-12-14
15:25:42 UTC (rev 27449)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractCloudElementJob.java 2010-12-14
15:45:07 UTC (rev 27450)
@@ -25,9 +25,12 @@
private CLOUDELEMENT cloudElement;
public AbstractCloudElementJob(String name, DeltaCloud cloud, CLOUDELEMENT cloudElement)
{
- super(name, cloud);
+ this(name, cloud, cloudElement, null);
+ }
+
+ public AbstractCloudElementJob(String name, DeltaCloud cloud, CLOUDELEMENT cloudElement,
String family) {
+ super(name, cloud, family);
this.cloudElement = cloudElement;
- // setUser(true);
}
@Override
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractCloudJob.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractCloudJob.java 2010-12-14
15:25:42 UTC (rev 27449)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractCloudJob.java 2010-12-14
15:45:07 UTC (rev 27450)
@@ -29,7 +29,11 @@
private DeltaCloud cloud;
public AbstractCloudJob(String name, DeltaCloud cloud) {
- super(name);
+ this(name, cloud, null);
+ }
+
+ public AbstractCloudJob(String name, DeltaCloud cloud, String family) {
+ super(name, family);
this.cloud = cloud;
}
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractInstanceJob.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractInstanceJob.java
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractInstanceJob.java 2010-12-14
15:45:07 UTC (rev 27450)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * 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.job;
+
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+
+/**
+ * @author André Dietisheim
+ */
+public abstract class AbstractInstanceJob extends AbstractCloudElementJob {
+
+ private DeltaCloudInstance instance;
+
+ public AbstractInstanceJob(String name, DeltaCloudInstance instance) {
+ this(name, instance, null);
+ }
+
+ public AbstractInstanceJob(String name, DeltaCloudInstance instance, String family) {
+ super(name, instance.getDeltaCloud(), CLOUDELEMENT.INSTANCES, family);
+ this.instance = instance;
+ }
+
+ @Override
+ protected ISchedulingRule getSchedulingRule() {
+ return new InstanceSchedulingRule(getCloud(), getCloudElement(), instance);
+ }
+
+ protected DeltaCloudInstance getInstance() {
+ return instance;
+ }
+}
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractInstanceJob.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/InstanceStateJob.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/InstanceStateJob.java 2010-12-14
15:25:42 UTC (rev 27449)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/InstanceStateJob.java 2010-12-14
15:45:07 UTC (rev 27450)
@@ -13,40 +13,28 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance.State;
/**
* @author André Dietisheim
*/
-public class InstanceStateJob extends AbstractCloudElementJob {
+public class InstanceStateJob extends AbstractInstanceJob {
- private DeltaCloudInstance instance;
private State expectedState;
public InstanceStateJob(String name, DeltaCloudInstance instance, State expectedState)
{
- super(name, instance.getDeltaCloud(), CLOUDELEMENT.INSTANCES);
- this.instance = instance;
+ super(name, instance);
this.expectedState = expectedState;
}
@Override
protected IStatus doRun(IProgressMonitor monitor) throws Exception {
- String id = instance.getId();
+ String id = getInstance().getId();
getCloud().waitForState(id, expectedState, monitor);
return Status.OK_STATUS;
}
- @Override
- protected ISchedulingRule getSchedulingRule() {
- return new InstanceSchedulingRule(getCloud(), getCloudElement(), instance);
- }
-
- protected DeltaCloudInstance getInstance() {
- return instance;
- }
-
protected State getExpectedState() {
return expectedState;
}