mirror of
https://gitee.com/agents-flex/agents-flex.git
synced 2024-11-29 18:38:17 +08:00
feat: refactor Chain module
This commit is contained in:
parent
643231c643
commit
0f4fb9fc43
@ -19,10 +19,22 @@ import java.io.Serializable;
|
||||
|
||||
public class Chain implements Serializable {
|
||||
|
||||
private String id;
|
||||
private ChainContext context;
|
||||
private Invoker[] invokers;
|
||||
private int index = 0;
|
||||
protected String id;
|
||||
protected ChainContext context;
|
||||
protected Invoker[] invokers;
|
||||
protected int index = 0;
|
||||
|
||||
public Chain(Invoker[] invokers) {
|
||||
this.invokers = invokers;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public ChainContext getContext() {
|
||||
return context;
|
||||
@ -32,6 +44,22 @@ public class Chain implements Serializable {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public Invoker[] getInvokers() {
|
||||
return invokers;
|
||||
}
|
||||
|
||||
public void setInvokers(Invoker[] invokers) {
|
||||
this.invokers = invokers;
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
doComplete();
|
||||
}
|
||||
|
@ -16,6 +16,10 @@
|
||||
package com.agentsflex.chain;
|
||||
|
||||
public class ParallelChain extends Chain implements Invoker{
|
||||
public ParallelChain(Invoker[] invokers) {
|
||||
super(invokers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Chain getChain() {
|
||||
return null;
|
||||
|
@ -15,7 +15,11 @@
|
||||
*/
|
||||
package com.agentsflex.chain;
|
||||
|
||||
public class SequentialChain extends Chain implements Invoker{
|
||||
public class SequentialChain extends Chain implements Invoker {
|
||||
public SequentialChain(Invoker[] invokers) {
|
||||
super(invokers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Chain getChain() {
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user