-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Child statistics pollers now poll all children by default (and not ju…
…st the first one)
- Loading branch information
Showing
6 changed files
with
149 additions
and
133 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...ain/java/com/nitorcreations/willow/deployer/statistics/AbstractChildStatisticsSender.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.nitorcreations.willow.deployer.statistics; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Properties; | ||
|
||
import javax.inject.Inject; | ||
|
||
import com.nitorcreations.willow.deployer.Main; | ||
|
||
public abstract class AbstractChildStatisticsSender extends AbstractStatisticsSender { | ||
@Inject | ||
protected Main main; | ||
protected List<String> configuredChildren = new ArrayList<String>(); | ||
|
||
@Override | ||
public void setProperties(Properties properties) { | ||
String nextChild = properties.getProperty("children[0]"); | ||
int i = 0; | ||
while (nextChild != null) { | ||
configuredChildren.add(nextChild); | ||
nextChild = properties.getProperty("children[" + ++i + "]"); | ||
} | ||
} | ||
protected List<String> getChildren() { | ||
if (configuredChildren.isEmpty()) { | ||
return Arrays.asList(main.getChildNames()); | ||
} else { | ||
return Collections.unmodifiableList(configuredChildren); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.