Advertisement
Guest User

Untitled

a guest
May 26th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.81 KB | None | 0 0
  1. public class TestPage extends Page {
  2.  
  3.       private A a;
  4.  
  5.     @Inject
  6.     public void setA(A a) {
  7.         this.a = a;
  8.     }
  9.  
  10.    
  11. }
  12.  
  13. public class A {
  14.  
  15.  
  16.     @Inject
  17.     public A (CatadvisorProperties properties) {
  18.         System.out.println("test");
  19.     }
  20.  
  21. }
  22.  
  23.  
  24.  
  25. @Singleton
  26. public class CatadvisorProperties extends Properties {
  27.  
  28.     @Inject
  29.     public CatadvisorProperties() {
  30.         super();
  31.         try {
  32.             final InputStream inStream = this.getClass().getClassLoader().getResourceAsStream("catadvisor.properties");
  33.             try {
  34.                 load(inStream);
  35.             } finally {
  36.                 inStream.close();
  37.             }
  38.         } catch (IOException e) {
  39.             throw new InvalidConfigurationException("error loading properties file", e);
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement