for (int i = startIndex; i < endIndex; i++) {
Service service = services[i];
writer.writeStartElement("service");
this.writeBean(writer, service);
if (service instanceof IPublishService) {
IPublishService publishService = (IPublishService) service;
PublishMessageQueue<SCMPMessage> publishMessageQueue = publishService.getMessageQueue();
writer.writeStartElement("publishMessageQueueSize");
writer.writeCData(String.valueOf(publishMessageQueue.getTotalSize() + simulation));
writer.writeEndElement(); // end of publishMessageQueueSize
writer.writeStartElement("publishMessageQueueReferencedNodeCount");
writer.writeCData(String.valueOf(publishMessageQueue.getReferencedNodesCount() + simulation));
writer.writeEndElement(); // end of publishMessageQueueReferencedNodeCount
}
if (service.getName().equals(serviceParameter)) {
// take a look into
writer.writeStartElement("details");
if (service instanceof StatefulService) {
List<StatefulServer> serverList = ((StatefulService) service).getServerList();
writer.writeStartElement("servers");
for (StatefulServer server : serverList) {
writer.writeStartElement("server");
this.writeBean(writer, server);
writer.writeEndElement(); // close server tag
}
writer.writeEndElement(); // close servers tag
}
if (service instanceof IPublishService) {
IPublishService publishService = (IPublishService) service;
PublishMessageQueue<SCMPMessage> publishMessageQueue = publishService.getMessageQueue();
writer.writeStartElement("publishMessageQueue");
Iterator<LinkedNode<SCMPMessage>> sqIter = publishMessageQueue.nodeIterator();
while (sqIter.hasNext()) {
LinkedNode<SCMPMessage> node = sqIter.next();
SCMPMessage scmpMessage = node.getValue();