Interface ProcessorSubscription
-
- All Known Implementing Classes:
DefaultProcessorSubscription
public interface ProcessorSubscription
Represents a processor subscription. This class is used for a "fluent" API, so that you can modify the condition, execution strategy of the processor after subscribing to a gateway.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description GatewaySubscription
finishSubscribing()
Finish subscribing this processor.RoutingPolicy
getPolicy()
Get the routing policy of this processordefault ProcessorSubscription
instrumentWhen(java.lang.String condition, io.gridgo.framework.execution.ExecutionStrategyInstrumenter instrumenter)
Instrument the processor with anExecutionStrategyInstrumenter
, if the condition resolved to true.default ProcessorSubscription
instrumentWhen(java.util.function.BooleanSupplier condition, io.gridgo.framework.execution.ExecutionStrategyInstrumenter instrumenter)
Instrument the processor with anExecutionStrategyInstrumenter
, if the condition resolved to true.default ProcessorSubscription
instrumentWhen(java.util.function.Predicate<io.gridgo.framework.support.Message> condition, io.gridgo.framework.execution.ExecutionStrategyInstrumenter instrumenter)
Instrument the processor with anExecutionStrategyInstrumenter
, if the condition resolved to true.ProcessorSubscription
instrumentWhen(org.joo.libra.Predicate condition, io.gridgo.framework.execution.ExecutionStrategyInstrumenter instrumenter)
Instrument the processor with anExecutionStrategyInstrumenter
, if the condition resolved to true.ProcessorSubscription
instrumentWith(io.gridgo.framework.execution.ExecutionStrategyInstrumenter instrumenter)
Instrument the processor with anExecutionStrategyInstrumenter
ProcessorSubscription
using(io.gridgo.framework.execution.ExecutionStrategy strategy)
Set the execution strategy of the processor to run.default ProcessorSubscription
when(java.lang.String condition)
Set the condition of the processor to run, usingorg.joo.libra.sql.SqlPredicate
syntax.default ProcessorSubscription
when(java.util.function.Predicate<io.gridgo.framework.support.Message> condition)
Set the condition of the processor to run, using Java Predicate.ProcessorSubscription
when(org.joo.libra.Predicate condition)
Set the condition of the processor to run, using a customorg.joo.libra.Predicate
GatewaySubscription
withPolicy(RoutingPolicy policy)
Copy another routing policy configuration.
-
-
-
Method Detail
-
when
default ProcessorSubscription when(java.lang.String condition)
Set the condition of the processor to run, usingorg.joo.libra.sql.SqlPredicate
syntax.- Parameters:
condition
- the condition- Returns:
- the current object
-
when
default ProcessorSubscription when(java.util.function.Predicate<io.gridgo.framework.support.Message> condition)
Set the condition of the processor to run, using Java Predicate.- Parameters:
condition
- the condition- Returns:
- the current object
-
when
ProcessorSubscription when(org.joo.libra.Predicate condition)
Set the condition of the processor to run, using a customorg.joo.libra.Predicate
- Parameters:
condition
- the condition- Returns:
- the current object
-
using
ProcessorSubscription using(io.gridgo.framework.execution.ExecutionStrategy strategy)
Set the execution strategy of the processor to run.- Parameters:
strategy
- the strategy- Returns:
- the current object
-
instrumentWith
ProcessorSubscription instrumentWith(io.gridgo.framework.execution.ExecutionStrategyInstrumenter instrumenter)
Instrument the processor with anExecutionStrategyInstrumenter
- Parameters:
instrumenter
- the instrumenter- Returns:
- the current object
-
instrumentWhen
default ProcessorSubscription instrumentWhen(java.util.function.BooleanSupplier condition, io.gridgo.framework.execution.ExecutionStrategyInstrumenter instrumenter)
Instrument the processor with anExecutionStrategyInstrumenter
, if the condition resolved to true.- Parameters:
condition
- the conditioninstrumenter
- the instrumenter- Returns:
- the current object
-
instrumentWhen
default ProcessorSubscription instrumentWhen(java.lang.String condition, io.gridgo.framework.execution.ExecutionStrategyInstrumenter instrumenter)
Instrument the processor with anExecutionStrategyInstrumenter
, if the condition resolved to true.- Parameters:
condition
- the conditioninstrumenter
- the instrumenter- Returns:
- the current object
-
instrumentWhen
default ProcessorSubscription instrumentWhen(java.util.function.Predicate<io.gridgo.framework.support.Message> condition, io.gridgo.framework.execution.ExecutionStrategyInstrumenter instrumenter)
Instrument the processor with anExecutionStrategyInstrumenter
, if the condition resolved to true.- Parameters:
condition
- the conditioninstrumenter
- the instrumenter- Returns:
- the current object
-
instrumentWhen
ProcessorSubscription instrumentWhen(org.joo.libra.Predicate condition, io.gridgo.framework.execution.ExecutionStrategyInstrumenter instrumenter)
Instrument the processor with anExecutionStrategyInstrumenter
, if the condition resolved to true.- Parameters:
condition
- the conditioninstrumenter
- the instrumenter- Returns:
- the current object
-
withPolicy
GatewaySubscription withPolicy(RoutingPolicy policy)
Copy another routing policy configuration.- Parameters:
policy
- the routing policy- Returns:
- the GatewaySubscription which this processor is subscribed
-
finishSubscribing
GatewaySubscription finishSubscribing()
Finish subscribing this processor.- Returns:
- the GatewaySubscription which this processor is subscribed
-
getPolicy
RoutingPolicy getPolicy()
Get the routing policy of this processor- Returns:
- the routing policy
-
-