public abstract class WorkflowWithObjectPool extends WorkflowImp
Modifier and Type | Class and Description |
---|---|
protected class |
WorkflowWithObjectPool.Worker |
protected class |
WorkflowWithObjectPool.WorkerFactory |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_IDLE
The default max idle size.
|
static int |
DEFAULT_MAX_POOLSIZE
The default maximum pool size.
|
static int |
DEFAULT_MIN_IDLE
the default minimum idle size.
|
eventHandler, log, startTime, stopTime
PREVIOUS_GUID_KEY, WORKFLOW_ID_KEY
Constructor and Description |
---|
WorkflowWithObjectPool() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkPoolConfig()
Check the object pool such that it isn't going to cause issues.
|
protected ServiceCollection |
cloneServiceCollection(ServiceCollection original) |
protected org.apache.commons.pool2.ObjectPool<WorkflowWithObjectPool.Worker> |
createObjectPool() |
TimeInterval |
getInitWaitTime()
Set the amount of time to wait for object pool population.
|
java.lang.Integer |
getMaxIdle()
The maximum number of idle objects in the pool.
|
java.lang.Integer |
getMinIdle()
The minimum number of idle objects in the pool.
|
java.lang.Integer |
getPoolSize()
The max size of the pool
|
long |
initWaitTimeMs() |
int |
maxIdle()
Return the maximum idle objects in the pool.
|
int |
minIdle()
Return the maximum idle objects in the pool.
|
void |
onAdaptrisMessage(AdaptrisMessage msg,
java.util.function.Consumer<AdaptrisMessage> success,
java.util.function.Consumer<AdaptrisMessage> failure)
Process a message from the
MessageConsumer |
protected abstract void |
onMessage(AdaptrisMessage msg) |
int |
poolSize() |
protected org.apache.commons.pool2.ObjectPool<WorkflowWithObjectPool.Worker> |
populatePool(org.apache.commons.pool2.ObjectPool<WorkflowWithObjectPool.Worker> objectPool) |
protected void |
preFlightServiceCheck() |
protected void |
prepareWorkflow() |
protected void |
resubmitMessage(AdaptrisMessage msg)
Resubmit a message upon the channel becoming available again.
|
protected void |
returnObject(org.apache.commons.pool2.ObjectPool<WorkflowWithObjectPool.Worker> pool,
WorkflowWithObjectPool.Worker worker) |
void |
setInitWaitTime(TimeInterval initWaitTime)
Set the amount of time to wait for object pool population.
|
void |
setMaxIdle(java.lang.Integer maxIdle)
The maximum number of idle objects in the pool.
|
void |
setMinIdle(java.lang.Integer minIdle)
The minimum number of idle objects in the pool.
|
void |
setPoolSize(java.lang.Integer poolSize)
The max size of the pool
|
addConsumeLocation, addInterceptor, changeState, channelUnavailableWait, close, closeWorkflow, copyExceptionHeaders, disableMessageCount, doProduce, friendlyName, getChannelUnavailableWaitInterval, getComments, getConsumer, getDisableDefaultMessageCount, getInterceptors, getMessageErrorHandler, getMessageLogger, getProduceExceptionHandler, getProducer, getSendEvents, getServiceCollection, getUniqueId, handleBadMessage, handleBadMessage, handleChannelUnavailable, handleProduceException, init, initialiseWorkflow, lastStartTime, lastStopTime, logSuccess, messageLogger, obtainChannel, obtainWorkflowId, prepare, processingStart, registerActiveMsgErrorHandler, registerChannel, registerEventHandler, requestClose, requestInit, requestStart, requestStop, retrieveActiveMsgErrorHandler, retrieveComponentState, sendEvents, sendMessageLifecycleEvent, setChannelUnavailableWaitInterval, setComments, setConsumer, setDisableDefaultMessageCount, setInterceptors, setMessageErrorHandler, setMessageLogger, setProduceExceptionHandler, setProducer, setSendEvents, setServiceCollection, setUniqueId, start, startWorkflow, stop, stopWorkflow, workflowEnd, workflowStart
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onAdaptrisMessage, onAdaptrisMessage
public static final int DEFAULT_MAX_POOLSIZE
public static final int DEFAULT_MIN_IDLE
public static final int DEFAULT_MAX_IDLE
public void onAdaptrisMessage(AdaptrisMessage msg, java.util.function.Consumer<AdaptrisMessage> success, java.util.function.Consumer<AdaptrisMessage> failure)
MessageConsumer
msg
- the messagesuccess
- called on successfailure
- called on failureWorkflowImp.handleBadMessage(AdaptrisMessage)
protected abstract void onMessage(AdaptrisMessage msg)
protected void resubmitMessage(AdaptrisMessage msg)
WorkflowImp
resubmitMessage
in class WorkflowImp
msg
- the AdaptrisMessage.public int poolSize()
protected void preFlightServiceCheck() throws CoreException
CoreException
protected void checkPoolConfig()
protected org.apache.commons.pool2.ObjectPool<WorkflowWithObjectPool.Worker> createObjectPool() throws CoreException
CoreException
protected org.apache.commons.pool2.ObjectPool<WorkflowWithObjectPool.Worker> populatePool(org.apache.commons.pool2.ObjectPool<WorkflowWithObjectPool.Worker> objectPool) throws CoreException
CoreException
public int minIdle()
public int maxIdle()
public long initWaitTimeMs()
protected ServiceCollection cloneServiceCollection(ServiceCollection original) throws CoreException
CoreException
protected void returnObject(org.apache.commons.pool2.ObjectPool<WorkflowWithObjectPool.Worker> pool, WorkflowWithObjectPool.Worker worker)
protected void prepareWorkflow() throws CoreException
prepareWorkflow
in class WorkflowImp
CoreException
public java.lang.Integer getPoolSize()
public void setPoolSize(java.lang.Integer poolSize)
public java.lang.Integer getMinIdle()
public void setMinIdle(java.lang.Integer minIdle)
public java.lang.Integer getMaxIdle()
public void setMaxIdle(java.lang.Integer maxIdle)
public TimeInterval getInitWaitTime()
Upon start the object pool is populated with the minIdle()
number of workers.
public void setInitWaitTime(TimeInterval initWaitTime)
Upon start the object pool is populated with the minIdle()
number of workers.