public class ConnectorExecutorImpl extends java.lang.Object implements ConnectorExecutor, ObservableExecutor
| Modifier and Type | Class and Description |
|---|---|
class |
ConnectorExecutorImpl.ExecuteConnectorCallable |
| 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
|
protected java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Object>> |
execute(SConnector sConnector,
InterruptibleCallable<java.util.Map<java.lang.String,java.lang.Object>> task) |
java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Object>> |
execute(SConnector sConnector,
java.util.Map<java.lang.String,java.lang.Object> inputParameters,
java.lang.ClassLoader classLoader)
Executes a connector.
|
long |
getExecuted() |
long |
getPendings() |
long |
getRunnings() |
void |
pause()
Temporary halt the execution of this service.
|
void |
resume()
resume the execution the service
|
void |
start()
Start the service
|
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 - maximumPoolSize - the maximum number of threads to allow in the
poolkeepAliveTimeSeconds - 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 java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Object>> execute(SConnector sConnector, java.util.Map<java.lang.String,java.lang.Object> inputParameters, java.lang.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 java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Object>> execute(SConnector sConnector, InterruptibleCallable<java.util.Map<java.lang.String,java.lang.Object>> task)
public void disconnect(SConnector sConnector) throws SConnectorException
ConnectorExecutordisconnect in interface ConnectorExecutorSConnectorExceptionpublic long getPendings()
getPendings in interface ObservableExecutorpublic long getRunnings()
getRunnings in interface ObservableExecutorpublic long getExecuted()
getExecuted in interface ObservableExecutorpublic void start()
LifecycleServicestart in interface LifecycleServicepublic void stop()
stop in interface LifecycleServicepublic void pause()
LifecycleServicepause in interface LifecycleServicepublic void resume()
LifecycleServiceresume in interface LifecycleService