MentaContainer

Rev

Rev 38 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 38 Rev 39
Line 23... Line 23...
23
                SomeFactory factory = new SomeFactory();
23
                SomeFactory factory = new SomeFactory();
24
               
24
               
25
                Container c = new MentaContainer();
25
                Container c = new MentaContainer();
26
               
26
               
27
                // giveMeSomething => method that will be called to return object
27
                // giveMeSomething => method that will be called to return object
28
                Component generic = new GenericComponent("myFactory", factory, "giveMeSomething");
-
 
-
 
28
                Component generic = new GenericComponent(factory, "giveMeSomething");
29
               
29
               
30
                c.ioc(generic);
-
 
-
 
30
                c.ioc("myFactory", generic);
31
               
31
               
32
                String s1 = (String) c.get("myFactory");
32
                String s1 = (String) c.get("myFactory");
33
               
33
               
34
                Thread.sleep(5); // so strings are different... my cpu is fast! :-)
34
                Thread.sleep(5); // so strings are different... my cpu is fast! :-)
35
               
35