Advertisement
JetForMe

Untitled

Mar 9th, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.47 KB | None | 0 0
  1. package com.latencyzero.satdb.web;
  2.  
  3.  
  4. //
  5. //  Standard Imports
  6. //
  7.  
  8. import javax.annotation.PostConstruct;
  9. import javax.ejb.Singleton;
  10. import javax.ejb.Startup;
  11. import javax.enterprise.context.ApplicationScoped;
  12. import javax.inject.Inject;
  13.  
  14. //
  15. //  Library Imports
  16. //
  17.  
  18. import org.apache.log4j.Logger;
  19.  
  20.  
  21.  
  22.  
  23.  
  24. @ApplicationScoped
  25. @Singleton
  26. @Startup
  27. public
  28. class
  29. UsageMapServer
  30. {
  31.     @PostConstruct
  32.     void
  33.     init()
  34.     {
  35.         sLogger.warn("HOLY FUCK IT STARTED");
  36.         System.out.println("postconstruct out");
  37.         System.err.println("postconstruct err");
  38.     }
  39.    
  40.    
  41.     //private   static  Logger              sLogger                     =   Logger.getLogger(UsageMapServer.class);
  42.     @Inject private static  Logger      sLogger;
  43.     static
  44.     {
  45.         System.out.println("static init out");
  46.         System.err.println("static init err");
  47.         sLogger.warn("Why not here?");
  48.     }
  49.    
  50. }
  51.  
  52.  
  53. ----------------------------
  54.  
  55.  
  56. package com.latencyzero.utils;
  57.  
  58.  
  59. //
  60. //  Standard Imports
  61.  
  62. import javax.enterprise.inject.Produces;
  63. import javax.enterprise.inject.spi.InjectionPoint;
  64. //import javax.enterprise.inject.spi.Produces;
  65.  
  66. //
  67. //  Library Imports
  68. //
  69.  
  70. import org.apache.log4j.Logger;
  71.  
  72.  
  73.  
  74. public
  75. class
  76. LoggerFactory
  77. {
  78.     @Produces
  79.     public
  80.     Logger
  81.     getLogger(InjectionPoint inInjectionPoint)
  82.     {
  83.         return Logger.getLogger(inInjectionPoint.getMember().getDeclaringClass().getSimpleName());
  84.     }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement