Skip to content

Instantly share code, notes, and snippets.

@guilhermesilveira
Created August 22, 2014 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guilhermesilveira/d647863a1deafb8823e7 to your computer and use it in GitHub Desktop.
Save guilhermesilveira/d647863a1deafb8823e7 to your computer and use it in GitHub Desktop.
MyWeld
public class MyWeld {
private static WeldContainer weldContainer = new Weld().initialize();
public static void main(String[] args) {
System.out.println(get(Router.class).allRoutes().size());
get(Router.class).allRoutes().stream().map(Route::getOriginalUri).forEach(System.out::println);
}
private static <T> T get(Class<T> type) {
T instance = weldContainer.instance().select(type).get();
return instance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment