Code example for Queue

Methods: add

0
    public boolean isOpen() { 
        return true; 
    } 
 
    public void handle(final T t) throws HandlerException {
        outQueue.add(t);
    } 
 
    public boolean flush() throws HandlerException { 
        int size = outQueue.size();
 
        for (int i = 0; i < size; i++) {
            if (!handler.isOpen()) { 
                break; 
            } 
            handler.handle(outQueue.remove());
        } 
 
        return true; 
    } 
}