Scoping
Scope Annotations
Scope Configuration Binder
component extends="wirebox.system.ioc.config.Binder"{
function configure(){
// map with shorthand or full scope notation
mapPath("model.CoffeeShop").asSingleton();
mapPath("model.CoffeeShop").into(this.SCOPES.SINGLETON);
// map some long espresso into request scope
map("longEspress")
.to("model.Espresso")
.into(this.SCOPES.REQUEST);
// cache some tea
map("GreenTea")
.to("model.Tea")
.inCacheBox(timeout=20,provider="ehCache");
// cache some google news that refresh themselves every 40 minutes or after 20 minutes of inactivity
map("latestNews")
.inCacheBox(timeout=40,lastAccessTimeout=20,provider="ehCache");
.toRSS("http://news.google.com/news?output=rss")
}
}Internal Scopes
Last updated
Was this helpful?