MentaContainer

Rev

Rev 91 | Rev 95 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 91 Rev 94
Line 268... Line 268...
268
               
268
               
269
                c.ioc("aDependency", SomeDependency.class, Scope.SINGLETON).addPropertyValue("name", "A super dependency!");
269
                c.ioc("aDependency", SomeDependency.class, Scope.SINGLETON).addPropertyValue("name", "A super dependency!");
270
               
270
               
271
                c.ioc("connection", Connection.class).addInitValue("A super JDBC connection!");
271
                c.ioc("connection", Connection.class).addInitValue("A super JDBC connection!");
272
               
272
               
273
                c.wire("conn" /* the property name that will receive the dependency */,
-
 
274
                                   Connection.class /* the type of the property that will receive the dependency */,
-
 
-
 
273
                c.autowireBySetter("conn" /* the property name that will receive the dependency */,
275
                                   "connection" /* the source inside the container */);
274
                                   "connection" /* the source inside the container */);
276
               
275
               
277
                c.wire("myDep" /* notice this is the setter of the Connection class */,
-
 
278
                                   SomeDependency.class /* the type - it could be an interface for better decoupling */,
-
 
-
 
276
                c.autowireBySetter("myDep" /* notice this is the setter of the Connection class */,
279
                                   "aDependency" /* again this is the name of the bean/component inside the container */);
277
                                   "aDependency" /* again this is the name of the bean/component inside the container */);
280
               
278
               
281
                return c;
279
                return c;
282
        }
280
        }
283
       
281