Re-order methods.
This commit is contained in:
parent
6ac60d72f0
commit
cc7037be0b
1 changed files with 30 additions and 30 deletions
|
|
@ -102,36 +102,6 @@ public class CpuController extends Component {
|
|||
deleteCpus(used, diff);
|
||||
}
|
||||
|
||||
/**
|
||||
* On cpu added.
|
||||
*
|
||||
* @param event the event
|
||||
*/
|
||||
@Handler
|
||||
public void onCpuAdded(CpuAdded event) {
|
||||
currentCpus += 1;
|
||||
checkCpus();
|
||||
}
|
||||
|
||||
/**
|
||||
* On cpu deleted.
|
||||
*
|
||||
* @param event the event
|
||||
*/
|
||||
@Handler
|
||||
public void onCpuDeleted(CpuDeleted event) {
|
||||
currentCpus -= 1;
|
||||
checkCpus();
|
||||
}
|
||||
|
||||
private void checkCpus() {
|
||||
if (suspendedConfigure != null && desiredCpus != null
|
||||
&& currentCpus == desiredCpus.intValue()) {
|
||||
suspendedConfigure.resumeHandling();
|
||||
suspendedConfigure = null;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
|
||||
private int addCpus(List<ObjectNode> used, List<ObjectNode> unused,
|
||||
int diff) {
|
||||
|
|
@ -170,4 +140,34 @@ public class CpuController extends Component {
|
|||
}
|
||||
return diff;
|
||||
}
|
||||
|
||||
/**
|
||||
* On cpu added.
|
||||
*
|
||||
* @param event the event
|
||||
*/
|
||||
@Handler
|
||||
public void onCpuAdded(CpuAdded event) {
|
||||
currentCpus += 1;
|
||||
checkCpus();
|
||||
}
|
||||
|
||||
/**
|
||||
* On cpu deleted.
|
||||
*
|
||||
* @param event the event
|
||||
*/
|
||||
@Handler
|
||||
public void onCpuDeleted(CpuDeleted event) {
|
||||
currentCpus -= 1;
|
||||
checkCpus();
|
||||
}
|
||||
|
||||
private void checkCpus() {
|
||||
if (suspendedConfigure != null && desiredCpus != null
|
||||
&& currentCpus == desiredCpus.intValue()) {
|
||||
suspendedConfigure.resumeHandling();
|
||||
suspendedConfigure = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue