// convert the recipientGroupList into group content users
private void getGroupContent() throws CruiseControlException {
if (this.recipientGroupSet == null) {
return;
}
GroupContentGetter groupContentGetter = this.lookupService.createGroupContentGetter();
groupContentGetter.addGroupContentListener(this);
try {
for (Iterator i = this.recipientGroupSet.iterator(); i.hasNext(); ) {
this.groupContent = null;
STGroup group = (STGroup) i.next();
groupContentGetter.queryGroupContent(group);
// how long do we wait to resolve?
boolean bored = false;
long waitStart = System.currentTimeMillis();
while (!this.haveGroupContent() && !bored && !this.isQueryGroupContentError()) {
try {
Thread.sleep(this.getSleepMillis());
} catch (InterruptedException ex) {
throw new CruiseControlException("sleep interrupted: " + ex);
}
bored = System.currentTimeMillis() - waitStart > this.getTimeoutMillis();
}
if (this.isQueryGroupContentError()) {
throw new CruiseControlException(this.queryGroupContentFailMessage);
}
if (bored && !this.haveGroupContent()) {
throw new CruiseControlException("bored waiting to get group content for " + group);
}
}
} finally {
groupContentGetter.removeGroupContentListener(this);
}
}