public void run() { int myId = idGenerator.increment(); if (myId % 5 == 1) { new TestWriter().write(); } else { new TestReader("" + myId).read(); } }
public Integer createListenerId(ObjectName name, NotificationFilter filter) { Integer id = new Integer(idCounter.increment()); listenerHolders.put(id, new ClientListenerHolder(name, null, filter, id)); return id; }