Last active
July 1, 2016 21:07
-
-
Save gastaldi/9990e3aa7a4bfb1f0a29c4af23a80129 to your computer and use it in GitHub Desktop.
Changes in Swarm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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