Class ConnectorExecutorImpl
java.lang.Object
org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl
- All Implemented Interfaces:
LifecycleService,TenantLifecycleService,ConnectorExecutor
@Component
@ConditionalOnSingleCandidate(ConnectorExecutor.class)
public class ConnectorExecutorImpl
extends Object
implements ConnectorExecutor
Execute connectors directly
- Author:
- Baptiste Mesta, Celine Souchet, Matthieu Chaffotte
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConnectorExecutorImpl(SessionAccessor sessionAccessor, SessionService sessionService, TimeTracker timeTracker, io.micrometer.core.instrument.MeterRegistry meterRegistry, ExecutorServiceMetricsProvider executorServiceMetricsProvider, BonitaConnectorExecutorFactory bonitaConnectorExecutorFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoiddisconnect(SConnector sConnector) call disconnect method of the connectorexecute(SConnector sConnector, Map<String, Object> inputParameters, ClassLoader classLoader) Executes a connector.protected CompletableFuture<ConnectorExecutionResult>execute(SConnector sConnector, InterruptibleCallable<Map<String, Object>> task) voidpause()Temporary halt the execution of this service.voidresume()resume the execution the servicevoidstart()Start the servicevoidstop()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bonitasoft.engine.commons.TenantLifecycleService
init
-
Field Details
-
NUMBER_OF_CONNECTORS_PENDING
- See Also:
-
NUMBER_OF_CONNECTORS_RUNNING
- See Also:
-
NUMBER_OF_CONNECTORS_EXECUTED
- See Also:
-
CONNECTORS_UNIT
- See Also:
-
-
Constructor Details
-
ConnectorExecutorImpl
public ConnectorExecutorImpl(SessionAccessor sessionAccessor, SessionService sessionService, TimeTracker timeTracker, io.micrometer.core.instrument.MeterRegistry meterRegistry, ExecutorServiceMetricsProvider executorServiceMetricsProvider, BonitaConnectorExecutorFactory bonitaConnectorExecutorFactory)
-
-
Method Details
-
execute
public CompletableFuture<ConnectorExecutionResult> execute(SConnector sConnector, Map<String, Object> inputParameters, ClassLoader classLoader) throws SConnectorExceptionDescription copied from interface:ConnectorExecutorExecutes a connector.- Specified by:
executein interfaceConnectorExecutor- Parameters:
sConnector- The connector will be executedinputParameters- The input parameters of connectorclassLoader- The classLoader within the connector will be executed- Returns:
- a completable future with the result
- Throws:
SConnectorException- Error thrown when error occurs in connector executing
-
execute
protected CompletableFuture<ConnectorExecutionResult> execute(SConnector sConnector, InterruptibleCallable<Map<String, Object>> task) -
disconnect
Description copied from interface:ConnectorExecutorcall disconnect method of the connector- Specified by:
disconnectin interfaceConnectorExecutor- Throws:
SConnectorException
-
start
public void start()Description copied from interface:LifecycleServiceStart the service- Specified by:
startin interfaceLifecycleService
-
stop
public void stop()- Specified by:
stopin interfaceLifecycleService
-
pause
public void pause()Description copied from interface:LifecycleServiceTemporary halt the execution of this service.- Specified by:
pausein interfaceLifecycleService
-
resume
public void resume()Description copied from interface:LifecycleServiceresume the execution the service- Specified by:
resumein interfaceLifecycleService
-