Package org.copperengine.core.batcher
Class BatchExecutor<E extends BatchExecutor<E,T>,T extends BatchCommand<E,T>>
- java.lang.Object
-
- org.copperengine.core.batcher.BatchExecutor<E,T>
-
- Type Parameters:
E
- type of the BatchExecutorT
- type of the BatchCommand to be executed by the executor implementation
- All Implemented Interfaces:
BatchExecutorBase<E,T>
- Direct Known Subclasses:
BatchInsertIntoAutoTrail.Executor
public abstract class BatchExecutor<E extends BatchExecutor<E,T>,T extends BatchCommand<E,T>> extends java.lang.Object implements BatchExecutorBase<E,T>
Abstract base implementation of theBatchExecutorBase
interface.
-
-
Constructor Summary
Constructors Constructor Description BatchExecutor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
doExec(java.util.Collection<BatchCommand<E,T>> commands, java.sql.Connection connection)
Executes a batch of commandsjava.lang.String
id()
boolean
prioritize()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.copperengine.core.batcher.BatchExecutorBase
maximumBatchSize, preferredBatchSize
-
-
-
-
Method Detail
-
doExec
public abstract void doExec(java.util.Collection<BatchCommand<E,T>> commands, java.sql.Connection connection) throws java.lang.Exception
Description copied from interface:BatchExecutorBase
Executes a batch of commands- Specified by:
doExec
in interfaceBatchExecutorBase<E extends BatchExecutor<E,T>,T extends BatchCommand<E,T>>
- Parameters:
commands
- the batch of commands is collected by the batcher and passed in to this method which can then execute them all in one batch.connection
- the connection to work on- Throws:
java.lang.Exception
- any kind of uncaught exception with the implementation of the executor
-
prioritize
public boolean prioritize()
- Specified by:
prioritize
in interfaceBatchExecutorBase<E extends BatchExecutor<E,T>,T extends BatchCommand<E,T>>
-
id
public java.lang.String id()
- Specified by:
id
in interfaceBatchExecutorBase<E extends BatchExecutor<E,T>,T extends BatchCommand<E,T>>
- Returns:
- unique ID of this batcher.
-
-