五種獲取ApplicationAdapter的方法

1. Inject your ApplicationAdapter through spring // Dominick Accattato
http://www.newviewnetworks.com/nvnhome/blog/client/uploads/Red5_Services.swf


2. Get your ApplicationAdapter from your ApplicationContext // Dominick Accattato
IContext context = scope.getContext();
ApplicationContext appCtx = context.getApplicationContext();
Application app = (Application) appCtx.getBean("web.handler");


3. Inject your service beans into your ApplicaitonAdapter and then have them setup event listeners // Dominick Accattato
// TODO

 

 4. Via the servlet context
ApplicationContext appCtx = (ApplicationContext) getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE); // Paul Gregoire

 

 5. Via ApplicationContextAware
this.application = (Application) appCtx.getBean("web.handler"); // Dominick Accattato

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章