How is Spark started by default?
(afaik, and I've just had a quick look long ago, it is its own process -- own script, etc)
If it doesn't have an embedded way, then it's probably hard, if not impossible.
Perhaps rather have 2 processes, that communicate with each other.
Otoh, it looks pretty easy to embedded it:
So I guess all you need is to add all the right classes on the app's classpath.
And in WildFly the easiest way to do this is to add the classes / jars as modules.
Just dunno what is then needed for the proper cluster, etc.
e.g. would be useful to somehow re-use JGroups (this is what WildFly uses for clustering) for this