Search in sources :

Example 1 with AbstractLinkedProcessorSlot

use of com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot in project Sentinel by alibaba.

the class DefaultSlotChainBuilder method build.

@Override
public ProcessorSlotChain build() {
    ProcessorSlotChain chain = new DefaultProcessorSlotChain();
    List<ProcessorSlot> sortedSlotList = SpiLoader.of(ProcessorSlot.class).loadInstanceListSorted();
    for (ProcessorSlot slot : sortedSlotList) {
        if (!(slot instanceof AbstractLinkedProcessorSlot)) {
            RecordLog.warn("The ProcessorSlot(" + slot.getClass().getCanonicalName() + ") is not an instance of AbstractLinkedProcessorSlot, can't be added into ProcessorSlotChain");
            continue;
        }
        chain.addLast((AbstractLinkedProcessorSlot<?>) slot);
    }
    return chain;
}
Also used : DefaultProcessorSlotChain(com.alibaba.csp.sentinel.slotchain.DefaultProcessorSlotChain) ProcessorSlotChain(com.alibaba.csp.sentinel.slotchain.ProcessorSlotChain) DefaultProcessorSlotChain(com.alibaba.csp.sentinel.slotchain.DefaultProcessorSlotChain) AbstractLinkedProcessorSlot(com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot) ProcessorSlot(com.alibaba.csp.sentinel.slotchain.ProcessorSlot) AbstractLinkedProcessorSlot(com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot)

Aggregations

AbstractLinkedProcessorSlot (com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot)1 DefaultProcessorSlotChain (com.alibaba.csp.sentinel.slotchain.DefaultProcessorSlotChain)1 ProcessorSlot (com.alibaba.csp.sentinel.slotchain.ProcessorSlot)1 ProcessorSlotChain (com.alibaba.csp.sentinel.slotchain.ProcessorSlotChain)1