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

streaming.core.datasource.SourceTypeRegistry.scala Maven / Gradle / Ivy

The newest version!
package streaming.core.datasource

import scala.collection.JavaConverters._
import scala.collection.mutable

object SourceTypeRegistry {
  private val registry = new java.util.concurrent.ConcurrentHashMap[String, mutable.Set[SourceInfo]]()

  def register(name: String, obj: SourceInfo) = {

    if (!registry.containsKey(name)) {
      registry.put(name, new mutable.HashSet[SourceInfo]())
    }
    registry.get(name) += obj
  }

  def sources = {
    registry.keys().asScala.toSeq
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy