public class ConnectorExecutorImpl extends Object implements ConnectorExecutor
| Constructor and Description |
|---|
ConnectorExecutorImpl(int queueCapacity,
int corePoolSize,
org.bonitasoft.engine.log.technical.TechnicalLoggerService loggerService,
int maximumPoolSize,
long keepAliveTimeSeconds,
org.bonitasoft.engine.sessionaccessor.SessionAccessor sessionAccessor,
SessionService sessionService,
TimeTracker timeTracker)
The handling of threads relies on the JVM
The rules to create new thread are:
- If the number of threads is less than the corePoolSize, create a new Thread to run a new task.
|
| Modifier and Type | Method and Description |
|---|---|
void |
disconnect(SConnector sConnector) |
Map<String,Object> |
execute(SConnector sConnector,
Map<String,Object> inputParameters,
ClassLoader classLoader) |
protected Map<String,Object> |
getValue(Future<Map<String,Object>> submit) |
void |
pause() |
void |
resume() |
void |
setExecutorService(ExecutorService executorService) |
void |
start() |
void |
stop() |
public ConnectorExecutorImpl(int queueCapacity,
int corePoolSize,
org.bonitasoft.engine.log.technical.TechnicalLoggerService loggerService,
int maximumPoolSize,
long keepAliveTimeSeconds,
org.bonitasoft.engine.sessionaccessor.SessionAccessor sessionAccessor,
SessionService sessionService,
TimeTracker timeTracker)
queueCapacity - The maximum number of execution of connector to queue for each threadcorePoolSize - the number of threads to keep in the pool, even
if they are idle, unless allowCoreThreadTimeOut is setloggerService - timeout - if the execution of the connector is above this time in milliseconds the execution will failmaximumPoolSize - the maximum number of threads to allow in the
poolkeepAliveTime - when the number of threads is greater than
the core, this is the maximum time that excess idle threads
will wait for new tasks before terminating. (in seconds)public Map<String,Object> execute(SConnector sConnector, Map<String,Object> inputParameters, ClassLoader classLoader) throws org.bonitasoft.engine.connector.exception.SConnectorException
execute in interface ConnectorExecutororg.bonitasoft.engine.connector.exception.SConnectorExceptionprotected Map<String,Object> getValue(Future<Map<String,Object>> submit) throws InterruptedException, ExecutionException, TimeoutException
public void disconnect(SConnector sConnector) throws org.bonitasoft.engine.connector.exception.SConnectorException
disconnect in interface ConnectorExecutororg.bonitasoft.engine.connector.exception.SConnectorExceptionpublic void start()
start in interface org.bonitasoft.engine.commons.LifecycleServicepublic void setExecutorService(ExecutorService executorService)
public void stop()
stop in interface org.bonitasoft.engine.commons.LifecycleServicepublic void pause()
pause in interface org.bonitasoft.engine.commons.LifecycleServicepublic void resume()
resume in interface org.bonitasoft.engine.commons.LifecycleServiceCopyright © 2017 Bonitasoft S.A.. All rights reserved.