Created
December 22, 2012 18:21
-
-
Save andytill/4360318 to your computer and use it in GitHub Desktop.
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
public class Main | |
{ | |
public static void main(String[] args) | |
{ | |
MiddleEarthModule module; | |
module = new MiddleEarthModule(); | |
Injector injector; | |
injector = Guice.createInjector(module); | |
System.out.println("entering scope"); | |
module.enter(); | |
injector.getInstance(Hero.class); | |
injector.getInstance(Hero.class); | |
injector.getInstance(Hero.class); | |
injector.getInstance(Hero.class); | |
System.out.println("exiting scope"); | |
module.exit(); | |
injector.getInstance(Hero.class); | |
injector.getInstance(Hero.class); | |
injector.getInstance(Hero.class); | |
injector.getInstance(Hero.class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment