All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scouter.server.netio.data.PackExtProcessChain.scala Maven / Gradle / Ivy

There is a newer version: 2.20.0
Show newest version
package scouter.server.netio.data

import java.util

import scouter.lang.pack.Pack
import scouter.server.util.EnumerScala

/**
  * Pack processor extension chain
  * Created by LeeGunHee on 2016-03-08.
  */
object PackExtProcessChain {

    val processorList = new util.ArrayList[IPackProcessor]

    def addProsessor(processor: IPackProcessor): Unit = {
        processorList.add(processor)
    }

    def doChain(pack: Pack): Unit = {
        var isMatched = false;
        EnumerScala.forward(processorList, (processor: IPackProcessor) => {
            val matched = processor.process(pack);
            if(matched) {
                isMatched = true
            }
        })

        if(!isMatched) {
            System.out.println(pack)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy