synchronized (this.dbLock) {
if (this.totalNodes > 0) {
if (this.totalNodes != totalNodesFromAgent) {
throw new ContextBrokerException("Context '" +
this.id + "' has received a conflicting " +
"total node count. Was previously " + this.totalNodes +
"but has received a cluster definition with a total " +
"of " + totalNodesFromAgent);
}
} else {
this.totalNodes = totalNodesFromAgent;
}
this.numNodes += 1;
if (this.numNodes > this.totalNodes) {
throw new ContextBrokerException("Context '" +
this.id + "' has heard from a new agent which " +
"makes the total node count exceed the theoretical" +
"maximum from the cluster definitions (" +
this.totalNodes + ").");
}
// invalidate cache if it existed
this.allIdentityCache = null;
Node node = this.allNodes.get(workspaceID);
if (node != null) {
throw new ContextBrokerException("Blackboard has " +
"already added node with ID #" + workspaceID);
}
String[] requiredDataNames = null;
if (requiredData != null && requiredData.length > 0) {