Package org.wso2.carbon.ntask.core.impl
Class RuleBasedLocationResolver
- java.lang.Object
-
- org.wso2.carbon.ntask.core.impl.RuleBasedLocationResolver
-
- All Implemented Interfaces:
TaskLocationResolver
public class RuleBasedLocationResolver extends Object implements TaskLocationResolver
This class represents a task location resolver, which assigns the locations according to a filtering rules given as parameters. If task-type-pattern matches and task-name-pattern matches, check existing addresses of address-pattern, and if addresses exist, select address in round-robin fashion, if not move onto next rule in sequence, if none matches, the task is not scheduled.[task-type-pattern],[task-name-pattern],[address-pattern]
-
-
Constructor Summary
Constructors Constructor Description RuleBasedLocationResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getLocation(TaskServiceContext ctx, TaskInfo taskInfo)
Returns the location the given task should be scheduled in.void
init(Map<String,String> properties)
Initializes the task location resolver with the given properties.
-
-
-
Method Detail
-
init
public void init(Map<String,String> properties) throws org.wso2.carbon.ntask.common.TaskException
Description copied from interface:TaskLocationResolver
Initializes the task location resolver with the given properties.- Specified by:
init
in interfaceTaskLocationResolver
- Parameters:
properties
- The property map- Throws:
org.wso2.carbon.ntask.common.TaskException
-
getLocation
public int getLocation(TaskServiceContext ctx, TaskInfo taskInfo) throws org.wso2.carbon.ntask.common.TaskException
Description copied from interface:TaskLocationResolver
Returns the location the given task should be scheduled in.- Specified by:
getLocation
in interfaceTaskLocationResolver
- Parameters:
ctx
- The task context, which contains environmental information on other tasks etc..taskInfo
- The task information of the task to be scheduled- Returns:
- The location of the task to be scheduled
- Throws:
org.wso2.carbon.ntask.common.TaskException
-
-