this.store();
// Stop all associations
FastMap<String, Association> associationsTemp = this.associations;
for (FastMap.Entry<String, Association> n = associationsTemp.head(), end = associationsTemp.tail(); (n = n.getNext()) != end;) {
Association associationTemp = n.getValue();
if (associationTemp.isStarted()) {
((AssociationImpl) associationTemp).stop();
}
}
FastList<Server> tempServers = servers;
for (FastList.Node<Server> n = tempServers.head(), end = tempServers.tail(); (n = n.getNext()) != end;) {
Server serverTemp = n.getValue();
if (serverTemp.isStarted()) {
try {
((ServerImpl) serverTemp).stop();
} catch (Exception e) {
logger.error(String.format("Exception while stopping the Server=%s", serverTemp.getName()), e);
}
}
}
if (this.executorServices != null) {
for (int i = 0; i < this.executorServices.length; i++) {
this.executorServices[i].shutdown();
}
}
this.selectorThread.setStarted(false);
this.socketSelector.wakeup(); // Wakeup selector so SelectorThread dies
// waiting till stopping associations
for (int i1 = 0; i1 < 20; i1++) {
boolean assConnected = false;
for (FastMap.Entry<String, Association> n = this.associations.head(), end = this.associations.tail(); (n = n.getNext()) != end;) {
Association associationTemp = n.getValue();
if (associationTemp.isConnected()) {
assConnected = true;
break;
}
}
if (!assConnected)