Guest User

Untitled

a guest
Mar 12th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. public final class ModuleRegistry {
  2.  
  3.     private static final class Holder {
  4.         private static final ModuleRegistry instance = new ModuleRegistry();
  5.     }
  6.  
  7.     private ModuleRegistry() {
  8.         Reflections reflections = new Reflections("");
  9.         // Some components registration
  10.     }
  11.  
  12.     public static ModuleRegistry getInstance() {
  13.         return Holder.instance;
  14.     }
  15. }
  16.  
  17. public final class Main{
  18.     public static void main(String[] args){
  19.         // Let's eagerly initialize everything
  20.         ModuleRegistry.getInstance();
  21.        
  22.        // Do all the work
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment