public class SequentialOperationExecutor extends Object implements OperationExecutor
有序的OperationExecutor同步实现。
处理时按照每种数据对应的类操作配置分组,因此会按照统一配操作配置中的
Orderly.getOrder()或Orderly.getOrder()的大小顺序执行处理。
因此,一次执行中一个相同的容器可能会被访问多次。
注意:由于装卸操作总是发生于装配操作前,故无法保证AssembleOperation与DisassembleOperation之间的执行顺序
| 构造器和说明 |
|---|
SequentialOperationExecutor() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected com.google.common.collect.Multimap<OperationConfiguration,Object> |
collectOperationConfigurations(Collection<Object> targets,
OperationConfiguration configuration,
com.google.common.collect.Multimap<OperationConfiguration,Object> collectedConfigurations)
解析数据,将待处理的数据按其对应的类操作配置归类
|
void |
execute(Iterable<?> targets,
OperationConfiguration configuration,
Set<Class<?>> groups)
执行操作
|
protected void |
execute(Set<Class<?>> targetGroups,
com.google.common.collect.Multimap<OperationConfiguration,Object> collectedConfigurations) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecutepublic void execute(Iterable<?> targets, OperationConfiguration configuration, @Nonnull Set<Class<?>> groups)
OperationExecutorexecute 在接口中 OperationExecutortargets - 目标实例configuration - 目标类操作配置groups - 操作的组,若组为空则将不操作任何数据protected void execute(@Nonnull Set<Class<?>> targetGroups, @Nonnull com.google.common.collect.Multimap<OperationConfiguration,Object> collectedConfigurations)
@Nonnull protected com.google.common.collect.Multimap<OperationConfiguration,Object> collectOperationConfigurations(@Nonnull Collection<Object> targets, @Nonnull OperationConfiguration configuration, @Nonnull com.google.common.collect.Multimap<OperationConfiguration,Object> collectedConfigurations)
targets - 当前解析的数据configuration - 当前解析的数据对应的类操作配置collectedConfigurations - 已经归类的操作配置Copyright © 2022. All rights reserved.