KIE Internal 6.1.0.Final

org.kie.internal.executor.api
Interface Executor


public interface Executor

Core logic of executor is encapsulated by this interface. It allows to operate on request instances of the execution.


Method Summary
 void cancelRequest(Long requestId)
          Cancels active (queued, running or retrying) request
 void destroy()
          Destroys executor
 int getInterval()
          Returns configured interval at which executor threads are running
 int getRetries()
          Returns configured default number of retries that shall be attempted in case of an error
 int getThreadPoolSize()
          Returns configured executor thread pool size
 void init()
          Initialized executor
 Long scheduleRequest(String commandName, CommandContext ctx)
          Schedules execution of given command as soon as possible.
 Long scheduleRequest(String commandName, Date date, CommandContext ctx)
          Schedules execution of given command on defined time.
 void setInterval(int waitTime)
          Sets interval at which executor threads are running.
 void setRetries(int defaultNroOfRetries)
          Sets default number of retries that shall be attempted in case of an error.
 void setThreadPoolSize(int nroOfThreads)
          Sets default executor thread pool size.
 

Method Detail

scheduleRequest

Long scheduleRequest(String commandName,
                     CommandContext ctx)
Schedules execution of given command as soon as possible.

Parameters:
commandName - - FQCN of the command
ctx - - contextual data given by executor service
Returns:
unique identifier of the request

scheduleRequest

Long scheduleRequest(String commandName,
                     Date date,
                     CommandContext ctx)
Schedules execution of given command on defined time.

Parameters:
commandName - - FQCN of the command
date - - date at which given command shall be executed
ctx - - contextual data given by executor service
Returns:
unique identifier of the request

cancelRequest

void cancelRequest(Long requestId)
Cancels active (queued, running or retrying) request

Parameters:
requestId - - id of the request to cancel

getInterval

int getInterval()
Returns configured interval at which executor threads are running

Returns:

setInterval

void setInterval(int waitTime)
Sets interval at which executor threads are running. Should not be used after init method has been called.

Parameters:
waitTime -

getRetries

int getRetries()
Returns configured default number of retries that shall be attempted in case of an error

Returns:

setRetries

void setRetries(int defaultNroOfRetries)
Sets default number of retries that shall be attempted in case of an error. Should not be used after init method has been called.

Parameters:
defaultNroOfRetries -

getThreadPoolSize

int getThreadPoolSize()
Returns configured executor thread pool size

Returns:

setThreadPoolSize

void setThreadPoolSize(int nroOfThreads)
Sets default executor thread pool size. Should not be used after init method has been called.

Parameters:
nroOfThreads -

init

void init()
Initialized executor


destroy

void destroy()
Destroys executor


KIE Internal 6.1.0.Final

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.