Skip to content

Instantly share code, notes, and snippets.

@gastaldi
Last active July 1, 2016 21:07
Show Gist options
  • Save gastaldi/9990e3aa7a4bfb1f0a29c4af23a80129 to your computer and use it in GitHub Desktop.
Save gastaldi/9990e3aa7a4bfb1f0a29c4af23a80129 to your computer and use it in GitHub Desktop.
Changes in Swarm
// This is the class inside the application
public class App implements SwarmCallback {
public static void main(String[] args) {
// Swarm.run will do the dirty job of initializing a JBoss Modules module and callback the methods defined in App
Swarm.run(new App(),args);
}
@Override
public void deploy(Swarm swarm) {
// We could provide some sort of factory to create the fractions in the correct classloader
swarm.fraction(new FooFraction());
swarm.deploy();
}
}
//This is an interface that goes inside container-api
public interface SwarmCallback {
default void start(Swarm swarm) {
swarm.start();
}
default void deploy(Swarm swarm) {
swarm.deploy();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment