public class ConnectorExecutorImpl extends Object implements ConnectorExecutor
| Constructor and Description |
|---|
ConnectorExecutorImpl(int queueCapacity,
int corePoolSize,
TechnicalLoggerService loggerService,
int maximumPoolSize,
long keepAliveTimeSeconds,
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)
call disconnect method of the connector
|
Map<String,Object> |
execute(SConnector sConnector,
Map<String,Object> inputParameters,
ClassLoader classLoader)
Executes a connector.
|
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,
TechnicalLoggerService loggerService,
int maximumPoolSize,
long keepAliveTimeSeconds,
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 SConnectorException
ConnectorExecutorexecute in interface ConnectorExecutorsConnector - The connector will be executedinputParameters - The input parameters of connectorclassLoader - The classLoader within the connector will be executedSConnectorException - Error thrown when error occurs in connector executingprotected Map<String,Object> getValue(Future<Map<String,Object>> submit) throws InterruptedException, ExecutionException, TimeoutException
public void disconnect(SConnector sConnector) throws SConnectorException
ConnectorExecutordisconnect in interface ConnectorExecutorSConnectorExceptionpublic 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 © 2018 Bonitasoft S.A.. All rights reserved.