public class ProducerServicePool
extends org.apache.camel.support.service.ServiceSupport
Producer pool.| Constructor and Description |
|---|
ProducerServicePool(org.apache.camel.util.function.ThrowingFunction<org.apache.camel.Endpoint,org.apache.camel.AsyncProducer,Exception> creator,
Function<org.apache.camel.AsyncProducer,org.apache.camel.Endpoint> getEndpoint,
int capacity) |
| Modifier and Type | Method and Description |
|---|---|
S |
acquire(org.apache.camel.Endpoint endpoint)
Tries to acquire the producer/consumer with the given key
|
void |
cleanUp()
Cleanup the pool (removing stale instances that should be evicted)
|
protected void |
doStart() |
protected void |
doStop() |
protected void |
onEvict(S s)
This callback is invoked by LRUCache from a separate background cleanup thread.
|
void |
release(org.apache.camel.Endpoint endpoint,
S s)
Releases the producer/consumer back to the pool
|
int |
size()
Returns the current size of the pool
|
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected void onEvict(S s)
public S acquire(org.apache.camel.Endpoint endpoint)
throws Exception
endpoint - the endpointExceptionpublic void release(org.apache.camel.Endpoint endpoint,
S s)
endpoint - the endpoints - the producer/consumerpublic int size()
public void cleanUp()
protected void doStart()
throws Exception
doStart in class org.apache.camel.support.service.BaseServiceExceptionApache Camel