return this.started;
}
@SuppressWarnings("unchecked")
public void load() throws FileNotFoundException {
XMLObjectReader reader = null;
try {
reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));
reader.setBinding(binding);
try {
this.connectDelay = reader.read(CONNECT_DELAY_PROP, Integer.class);
this.workerThreads = reader.read(WORKER_THREADS_PROP, Integer.class);
this.singleThread = reader.read(SINGLE_THREAD_PROP, Boolean.class);
} catch (java.lang.NullPointerException npe) {
// ignore.
// For backward compatibility we can ignore if these values are not defined
}
this.servers = reader.read(SERVERS, FastList.class);
for (FastList.Node<Server> n = this.servers.head(), end = this.servers.tail(); (n = n.getNext()) != end;) {
Server serverTemp = n.getValue();
((ServerImpl) serverTemp).setManagement(this);
if (serverTemp.isStarted()) {
try {
((ServerImpl) serverTemp).start();
} catch (Exception e) {
logger.error(String.format("Error while initiating Server=%s", serverTemp.getName()), e);
}
}
}
this.associations = reader.read(ASSOCIATIONS, AssociationMap.class);
for (FastMap.Entry<String, Association> n = this.associations.head(), end = this.associations.tail(); (n = n.getNext()) != end;) {
AssociationImpl associationTemp = (AssociationImpl) n.getValue();
associationTemp.setManagement(this);
}