public class ServicePool<S extends org.apache.camel.Service>
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.NonManagedService
| Constructor and Description |
|---|
ServicePool(org.apache.camel.util.function.ThrowingFunction<org.apache.camel.Endpoint,S,Exception> producer,
Function<S,org.apache.camel.Endpoint> getEndpoint,
int capacity) |
| Modifier and Type | Method and Description |
|---|---|
S |
acquire(org.apache.camel.Endpoint endpoint)
Tries to acquire the service with the given key
|
void |
cleanUp() |
protected void |
doStart() |
protected void |
doStop() |
long |
getEvicted() |
long |
getHits() |
int |
getMaxCacheSize() |
long |
getMisses() |
protected org.apache.camel.impl.engine.ServicePool.Pool<S> |
getPool(org.apache.camel.Endpoint endpoint) |
protected void |
onEvict(S s) |
void |
release(org.apache.camel.Endpoint endpoint,
S s)
Releases the service back to the pool
|
void |
resetStatistics() |
int |
size()
Returns the current size of the pool
|
build, doBuild, doInit, doResume, doShutdown, doSuspend, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendprotected 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 serviceprotected org.apache.camel.impl.engine.ServicePool.Pool<S> getPool(org.apache.camel.Endpoint endpoint)
public int size()
protected void doStart()
throws Exception
doStart in class org.apache.camel.support.service.ServiceSupportExceptionprotected void doStop()
throws Exception
doStop in class org.apache.camel.support.service.ServiceSupportExceptionpublic void cleanUp()
public void resetStatistics()
public long getEvicted()
public long getMisses()
public long getHits()
public int getMaxCacheSize()
Apache Camel