public void publish() {
//logger.info("publish");
Iterator<Data> i = array.iterator();
Data data = null;
DataReceivedListener listener = CacheImpl.getInstance();
while (i.hasNext()) {
data = i.next();
listener.dataReceived(data.getTimestamp(), data.getSender(), data.getDest(), data.getName(), data.getValue(), data.getSource(), data.getType());
//logger.debug("Publishing " + data.getName() + " timestamp " + data.getTimestamp());
}
array.clear();
}