public synchronized boolean enqueue(Object b) { if (queue.size() < MAXQUEUESIZE) { queue.add(b); notifyAll(); return true; } if (b instanceof CObjList) { CObjList l = (CObjList) b; l.close(); } return false; }
private void process() { Object o = queue.poll(); try { if (o != null) { if (o instanceof CObj) { processCObj((CObj) o); } else if (o instanceof CObjList) { CObjList cl = (CObjList) o; for (int c = 0; c < cl.size(); c++) { processCObj(cl.get(c)); } cl.close(); } else { processor.processObj(o); } } } catch (Exception e) { e.printStackTrace(); } }