For example we have WordCountService with countWords method:
class WordCountService {
def countWords(url: String): Map[String, Int] = {
val sparkConf = new SparkConf().setMaster("spark://somehost:7077").setAppName("WordCount"))
val sc = new SparkContext(sp...