log.info("Increment local token " +counter.getToken() + " by " + counter.getCounter());
IdQuery<GlobalCounter> counterIdQuery = new IdQuery<GlobalCounter>(GlobalCounter.class, counter.getToken());
ChangeResult<GlobalCounter> changeResult = gigaSpace.change(counterIdQuery, new ChangeSet().increment("counter", counter.getCounter()));
//No counter for this token already exists
if (changeResult.getNumberOfChangedEntries() == 0)
gigaSpace.write(new GlobalCounter(counter.getToken(),counter.getCounter()));
if (log.isLoggable(Level.FINE)) {
log.fine("+++ token=" + counter.getToken() + " counter=" + counter.getCounter());
}
}