
Untitled
By:
lmajano on
Jul 26th, 2012 | syntax:
Java | size: 0.54 KB | hits: 11 | expires: Never
// Map Binder so you can do utility methods
map("myBinder").toValue( this );
// Map the singleton maps
map("s1Map").toFactoryMethod("myBinder", "buildMap")
.methodArg(name="mapType", value="1");
// Map A service with a singleton map
map("Service").to("path")
.initArg(name="myMap", ref="s1Map");
// Utility method to build singleton maps
function buildMap(mapType){
switch( arguments.mapType ){
case 1 : {
return {
s1 = getInjector().getInstance('s1'),
s2 = getInjector().getInstance('s2')
};
}
}
}