private synchronized void sendUpdates()
    {

        _dataGenerator.generateUpdatedEntries();

        Set<Token> deletedTokens = new HashSet<Token>();

        Iterator<Token> iter = _pendingStreamItems.keySet().iterator();
        while (iter.hasNext())
        {
            Token rq = (Token)(iter.next());
            DataStreamItem streamItem = (DataStreamItem)_pendingStreamItems.get(rq);
            if (streamItem == null)
            {
                continue;
            }
            if (streamItem.isClosed() || streamItem.sendUpdate())
            {
                deletedTokens.add(rq);
            }
        }

        iter = deletedTokens.iterator();
        while (iter.hasNext())
        {
            Token tk = (Token)iter.next();
            DataStreamItem streamItem = (DataStreamItem)_pendingStreamItems.remove(tk);
            if (streamItem != null && !streamItem.isClosed())
            {
                streamItem.close();
            }
        }
    }