Skip to content

Commit

Permalink
Made access to spotterProgress synchronized
Browse files Browse the repository at this point in the history
Change-Id: Ica9a6874a51ed499c5513a206fb0c5eb203515e7
Signed-off-by: Alexander Wert <[email protected]>
  • Loading branch information
Alexander Wert committed Aug 15, 2014
1 parent 155d809 commit 4b5c2f6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

/**
* Representation of the progress of a diagnosis step of Dynamic Spotter run.
*
*
* @author Alexander Wert
*
*
*/
public class DiagnosisProgress {
private String name;
Expand All @@ -33,17 +33,23 @@ public class DiagnosisProgress {
*/
public DiagnosisProgress() {
}

/**
* Constructor.
* @param name problem name
* @param status diagnosis status
* @param estimatedProgress estimated progress in percent
* @param estimatedRemainingDuration estimated remaining duration in seconds
* @param currentProgressMessage additional progress message
*
* @param name
* problem name
* @param status
* diagnosis status
* @param estimatedProgress
* estimated progress in percent
* @param estimatedRemainingDuration
* estimated remaining duration in seconds
* @param currentProgressMessage
* additional progress message
*/
public DiagnosisProgress(String name, DiagnosisStatus status, double estimatedProgress, long estimatedRemainingDuration,
String currentProgressMessage) {
public DiagnosisProgress(String name, DiagnosisStatus status, double estimatedProgress,
long estimatedRemainingDuration, String currentProgressMessage) {
super();
this.name = name;
this.status = status;
Expand All @@ -70,60 +76,60 @@ public void setName(String name) {
/**
* @return the status
*/
public DiagnosisStatus getStatus() {
public synchronized DiagnosisStatus getStatus() {
return status;
}

/**
* @param status
* the status to set
*/
public void setStatus(DiagnosisStatus status) {
public synchronized void setStatus(DiagnosisStatus status) {
this.status = status;
}

/**
* @return the estimatedProgress
*/
public double getEstimatedProgress() {
public synchronized double getEstimatedProgress() {
return estimatedProgress;
}

/**
* @param estimatedProgress
* the estimatedProgress to set
*/
public void setEstimatedProgress(double estimatedProgress) {
public synchronized void setEstimatedProgress(double estimatedProgress) {
this.estimatedProgress = estimatedProgress;
}

/**
* @return the estimatedRemainingDuration
*/
public long getEstimatedRemainingDuration() {
public synchronized long getEstimatedRemainingDuration() {
return estimatedRemainingDuration;
}

/**
* @param estimatedRemainingDuration
* the estimatedRemainingDuration to set
*/
public void setEstimatedRemainingDuration(long estimatedRemainingDuration) {
public synchronized void setEstimatedRemainingDuration(long estimatedRemainingDuration) {
this.estimatedRemainingDuration = estimatedRemainingDuration;
}

/**
* @return the currentProgressMessage
*/
public String getCurrentProgressMessage() {
public synchronized String getCurrentProgressMessage() {
return currentProgressMessage;
}

/**
* @param currentProgressMessage
* the currentProgressMessage to set
*/
public void setCurrentProgressMessage(String currentProgressMessage) {
public synchronized void setCurrentProgressMessage(String currentProgressMessage) {
this.currentProgressMessage = currentProgressMessage;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package org.spotter.shared.status;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
* Progress of a Dynamic Spotter run/job.
Expand All @@ -31,7 +31,7 @@ public class SpotterProgress {
* Constructor.
*/
public SpotterProgress() {
problemProgressMapping = new HashMap<>();
problemProgressMapping = new ConcurrentHashMap<>();
}


Expand Down

0 comments on commit 4b5c2f6

Please sign in to comment.