/** Place the Task to the queue of pending tasks for immediate processing. * If there is no other Task planned, this task is immediatelly processed * in the Processor. */ void enqueue(Item item) { Logger em = logger(); boolean loggable = em.isLoggable(Level.FINE); boolean wasNull; synchronized (processorLock) { wasNull = item.getTask() == null; if (!wasNull) { prioritizedEnqueue(item); if (running < throughput) { running++; Processor proc = Processor.get(); processors.add(proc); proc.setName(name); proc.attachTo(this); } } } if (loggable) { if (wasNull) { em.log(Level.FINE, "Null task for item {0}", item); // NOI18N } else { em.log(Level.FINE, "Item enqueued: {0} status: {1}", new Object[]{item.action, item.enqueued}); // NOI18N } } }
/** Place the Task to the queue of pending tasks for immediate processing. * If there is no other Task planned, this task is immediatelly processed * in the Processor. */ void enqueue (Item item) { synchronized (processorLock) { if (item.getTask() == null) return; prioritizedEnqueue(item); if (running < throughput) { running++; Processor proc = Processor.get(); processors.add(proc); proc.setName(name); proc.attachTo(this); } } }
/** Place the Task to the queue of pending tasks for immediate processing. * If there is no other Task planned, this task is immediatelly processed * in the Processor. */ void enqueue(Item item) { Logger em = logger(); boolean loggable = em.isLoggable(Level.FINE); synchronized (processorLock) { if (item.getTask() == null) { if (loggable) { em.fine("Null task for item " + item); // NOI18N } return; } prioritizedEnqueue(item); if (running < throughput) { running++; Processor proc = Processor.get(); processors.add(proc); proc.setName(name); proc.attachTo(this); } } if (loggable) { em.fine("Item enqueued: " + item.action + " status: " + item.enqueued); // NOI18N } }
/** Place the Task to the queue of pending tasks for immediate processing. * If there is no other Task planned, this task is immediatelly processed * in the Processor. */ void enqueue(Item item) { Logger em = logger(); boolean loggable = em.isLoggable(Level.FINE); boolean wasNull; synchronized (processorLock) { wasNull = item.getTask() == null; if (!wasNull) { prioritizedEnqueue(item); if (running < throughput) { running++; Processor proc = Processor.get(); processors.add(proc); proc.setName(name); proc.attachTo(this); } } } if (loggable) { if (wasNull) { em.log(Level.FINE, "Null task for item {0}", item); // NOI18N } else { em.log(Level.FINE, "Item enqueued: {0} status: {1}", new Object[]{item.action, item.enqueued}); // NOI18N } } }
/** Place the Task to the queue of pending tasks for immediate processing. * If there is no other Task planned, this task is immediatelly processed * in the Processor. */ void enqueue (Item item) { synchronized (processorLock) { if (item.getTask() == null) return; prioritizedEnqueue(item); if (running < throughput) { running++; Processor proc = Processor.get(); processors.add(proc); proc.setName(name); proc.attachTo(this); } } }