Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private void Update(TpClusterInfoResponseWrapper ci)
if (info2.getName().equals(ci.getName()))
{
info2 = ci.getRaw();
setChanged();

}
}

Expand All @@ -138,7 +138,7 @@ public void Update(TpTargetCluster tc)
if (info.getName().equals(tc.getName()))
{
info = tc;
setChanged();

}
}

Expand All @@ -153,7 +153,7 @@ void Update(TpClusterInfoResponse ci)
if (info2.getName().equals(ci.getName()))
{
info2 = ci;
setChanged();

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public void update(TpDropZone dz)
{
dzInfo = dz;
update(dz.getTpMachines().getTpMachine());
setChanged();

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public enum Notification
this.platform = platform;
info = new DFUWorkunitWrapper();
info.setID(id);
setChanged();
}

/**
Expand Down Expand Up @@ -248,8 +247,6 @@ protected void fullRefresh()
if (e.getCode().equals("20082"))
{ // No longer exists...
info.setState(999);
setChanged();
notifyObservers(Notification.LOGICALFILEWORKUNIT);
break;
}
}
Expand Down Expand Up @@ -278,15 +275,14 @@ public boolean update(DFUWorkunitWrapper dfuWorkunitWrapper)
boolean retVal = false;
if (dfuWorkunitWrapper != null && info.getID().equals(dfuWorkunitWrapper.getID()) && !info.equals(dfuWorkunitWrapper))
{
if (updateState(dfuWorkunitWrapper))
retVal = true;
if (!updateState(dfuWorkunitWrapper))
{
retVal = true;
notifyObservers(Notification.LOGICALFILEWORKUNIT);
retVal = false;
}
if (updateLogicalFiles(dfuWorkunitWrapper))
if (!updateLogicalFiles(dfuWorkunitWrapper))
{
retVal = true;
notifyObservers(Notification.LOGICALFILEWORKUNIT);
retVal = false;
}
}
monitor();
Expand All @@ -305,7 +301,6 @@ synchronized boolean updateState(DFUWorkunitWrapper dfuWorkunitWrapper)
if (dfuWorkunitWrapper != null && info.getID().equals(dfuWorkunitWrapper.getID()) && EqualsUtil.hasChanged(info.getState(), dfuWorkunitWrapper.getState()))
{
info.setState(dfuWorkunitWrapper.getState());
setChanged();
return true;
}
return false;
Expand All @@ -326,7 +321,6 @@ synchronized boolean updateLogicalFiles(DFUWorkunitWrapper dfuWorkunitWrapper)
.hasChanged(info.getDestLogicalName(), dfuWorkunitWrapper.getDestLogicalName())))
{
info = dfuWorkunitWrapper;
setChanged();
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ boolean update(ECLGraph graph)
if (UpdateState(graph))
{
retVal = true;
notifyObservers(Notification.GRAPH);

}
}
monitor();
Expand All @@ -181,7 +181,7 @@ boolean UpdateState(ECLGraph graph)
if (info.getName().equals(graph.getName()) && EqualsUtil.hasChanged(info, graph))
{
info = graph;
setChanged();

return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected void fullRefresh()
{
e.printStackTrace();
}
notifyObservers(Notification.LOGICALFILE);

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ protected void fullRefresh()
log.error("Could not refresh files list for PhysicalMachine: '" + physicalmachinestruct.getName() + "'");
e.printStackTrace();
}
notifyObservers(Notification.PHYSICALMACHINE);

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ private enum SERVER_EXISTS

static int LATENCY_TEST = 0;


/**
* Instantiates a new platform.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private Result(Workunit workunit, Integer sequence)
info = new ECLResult();
info.setSequence(sequence);
data = new ResultData();
setChanged();

}

/**
Expand Down Expand Up @@ -339,7 +339,7 @@ boolean update(ECLResult result)
if (UpdateState(result))
{
retVal = true;
notifyObservers(Notification.RESULT);

}
}
monitor();
Expand All @@ -360,7 +360,7 @@ synchronized boolean UpdateState(ECLResult result)

assert (result.getECLSchemas() != null);
info = result;
setChanged();

return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private Workunit(Platform platform, String wuid)
graphs = new ArrayList<Graph>();
sourceFiles = new ArrayList<LogicalFile>();
applicationValues = new HashMap<String, String>();
setChanged();

}

/**
Expand Down Expand Up @@ -655,7 +655,6 @@ protected void fastRefresh()
e1.printStackTrace();
}


if (previousState != getStateID())
{
fullRefresh();
Expand Down Expand Up @@ -726,8 +725,7 @@ void fullRefresh(boolean includeGraphs, boolean includeResults, boolean includeS
//if (e.getCode().equals("20082") || e.getCode().equals("20080"))
//{ // No longer exists... //$NON-NLS-1$ //$NON-NLS-2$
// info.setStateID(999);
setChanged();
notifyObservers(Notification.WORKUNIT);

// break;
//}
}
Expand Down Expand Up @@ -757,50 +755,42 @@ public boolean update(ECLWorkunit wu)
boolean retVal = false;
if (wu != null && info.getWuid().equals(wu.getWuid()) && !info.equals(wu))
{
if (updateState(wu))
retVal = true;
if (!updateState(wu))
{
retVal = true;
notifyObservers(Notification.WORKUNIT);
retVal = false;
}
if (updateOwner(wu.getOwner()))
if (!updateOwner(wu.getOwner()))
{
retVal = true;
notifyObservers(Notification.OWNER);
retVal = false;
}
if (updateJobname(wu.getJobname()))
if (!updateJobname(wu.getJobname()))
{
retVal = true;
notifyObservers(Notification.JOBNAME);
retVal = false;
}
if (updateCluster(wu.getCluster()))
if (!updateCluster(wu.getCluster()))
{
retVal = true;
notifyObservers(Notification.CLUSTER);
retVal = false;
}
if (updateQuery(wu.getQuery()))
if (!updateQuery(wu.getQuery()))
{
retVal = true;
notifyObservers(Notification.QUERY);
retVal = false;
}
if (updateApplicationValues(wu.getApplicationValues().getApplicationValue()))
if (!updateApplicationValues(wu.getApplicationValues().getApplicationValue()))
{
retVal = true;
notifyObservers(Notification.APPLICATIONVALUES);
retVal = false;
}
if (updateResults(wu.getResults().getECLResult()))
if (!updateResults(wu.getResults().getECLResult()))
{
retVal = true;
notifyObservers(Notification.RESULTS);
retVal = false;
}
if (updateGraphs(wu.getGraphs().getECLGraph()))
if (!updateGraphs(wu.getGraphs().getECLGraph()))
{
retVal = true;
notifyObservers(Notification.GRAPHS);
retVal = false;
}
if (updateSourceFiles(wu.getSourceFiles().getECLSourceFile()))
if (!updateSourceFiles(wu.getSourceFiles().getECLSourceFile()))
{
retVal = true;
notifyObservers(Notification.SOURCEFILES);
retVal = false;
}
}
monitor();
Expand All @@ -823,7 +813,7 @@ synchronized boolean updateState(ECLWorkunit wu)
info.setStateID(wu.getStateID());
info.setStateEx(wu.getStateEx());
info.setState(wu.getState());
setChanged();

retVal = true;
}
return retVal;
Expand All @@ -841,7 +831,7 @@ synchronized boolean updateCluster(String cluster)
if (cluster != null && EqualsUtil.hasChanged(info.getCluster(), cluster))
{
info.setCluster(cluster);
setChanged();

return true;
}
return false;
Expand All @@ -859,7 +849,7 @@ synchronized boolean updateOwner(String owner)
if (owner != null && EqualsUtil.hasChanged(info.getOwner(), owner))
{
info.setOwner(owner);
setChanged();

return true;
}
return false;
Expand All @@ -877,7 +867,7 @@ synchronized boolean updateJobname(String jobname)
if (jobname != null && EqualsUtil.hasChanged(info.getJobname(), jobname))
{
info.setJobname(jobname);
setChanged();

return true;
}
return false;
Expand All @@ -895,7 +885,7 @@ synchronized boolean updateQuery(ECLQuery q)
if (q != null && EqualsUtil.hasChanged(info.getQuery(), q))
{
info.setQuery(q);
setChanged();

return true;
}
return false;
Expand Down Expand Up @@ -928,7 +918,7 @@ synchronized boolean updateApplicationValues(ApplicationValue[] rawAppVals)

if (applicationValuesCount != applicationValues.size())
{
setChanged();

return true;
}
}
Expand All @@ -955,7 +945,7 @@ synchronized boolean updateResults(ECLResult[] rawResults)
}
if (resultCount != results.size())
{
setChanged();

return true;
}
}
Expand All @@ -982,7 +972,7 @@ synchronized boolean updateGraphs(ECLGraph[] rawGraphs)
}
if (graphCount != graphs.size())
{
setChanged();

return true;
}
}
Expand All @@ -1009,7 +999,7 @@ synchronized boolean updateSourceFiles(ECLSourceFile[] rawSourceFiles)
}
if (sourceFileCount != sourceFiles.size())
{
setChanged();

return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
******************************************************************************/
package org.hpccsystems.ws.client.utils;

import java.util.Observable;

import org.apache.axis2.AxisFault;
import org.apache.axis2.client.Stub;

public abstract class DataSingleton extends Observable
public abstract class DataSingleton
{
static final int MONITOR_SLEEP = 1000;

Expand Down Expand Up @@ -90,16 +88,13 @@ void refresh()

void refresh(boolean full)
{
if (countObservers() > 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot This logic can be removed and fastRefresh() can be called directly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified by removing unnecessary isComplete() check in refresh logic (commit 6900c24)

if (full)
{
if (full || isComplete())
{
fullRefresh();
}
else
{
fastRefresh();
}
fullRefresh();
}
else
{
fastRefresh();
}
}
});
Expand Down
Loading