资源描述:
《java ee 平台简介(翻译)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、南华大学计算机科学与技术学院实验报告(2013-2014学年度第二学期)课程名称:JAVAEE平台软件开发课程内容:JAVAEE平台简介(翻译)姓名学号专业班级地点教师原文:2.1.1TheBeanContextasaparticipantinnestedstructure(嵌套结构)OneoftherolesoftheBeanContextistointroducethenotion(概念)ofahierarchicalnesting(嵌套层次)orstructureofBeanContextandJavaBeaninstances(实例).Inordertomodelth
2、isstructuretheBeanContextmustexposeAPIthatdefinestherelationshipsinthestructureorhierarchy.TheBeanContextexposesitssuperstructure(上层建筑)throughimplementation(实施)ofthejava.beans.beancontext.BeanContextChildinterface(asdescribedlater).Thisinterfaceallowsthediscoveryandmanipulation(操作)ofaBeanCo
3、ntext’snestingBeanContext,andthusintroducesafacilitytocreateahierarchyofBeanContexts.TheBeanContextexposesitssubstructurethroughanumberofinterfacemethodsmodeledbythejava.util.Collectioninterfacesemantics(语义)BeanContextsarerequiredtoimplementallthemandatory(强制的)CollectionAPI’s,withthefollowi
4、ngparticularsemanticsforadd()andremove():.Theadd()methodmaybeinvokedinordertonestanewObject,BeanContextChild,orBeanContextwithinthetargetBeanContext.Aconformantadd()implementationisrequiredtoadhereto(坚持)thefollowingsemantics:•SynchronizeontheBeanContext.globalHierarchyLock.•Eachchildobjects
5、hallappearonlyonceinthesetofchildrenforagivenBeanContext.IftheinstanceisalreadyamemberoftheBeanContextthenthemethodshallreturnFalse.•Eachvalid(有效的)childshallbeaddedtothesetofchildrenofagivensourceBeanContext,andthusshallappearinthesetofchildren,obtainedthrougheitherthetoArray(),oriterator()
6、methods,untilsuchtimeasthatchildisdeletedfromthenestingBeanContextviaaninvocationofremove(),removeAll(),retainAll(),orclear()•Asthechildisaddedtothesetofnestedchildren,andwherethatchildimplementthejava.beans.beancontext.BeanContextChildinterface(orBeanContextProxy,seelaterfordetails),theBea
7、nContextshallinvokethesetBeanContext()methoduponthatchild,withareferencetoitself.Uponinvocation,achildmay,ifitisforsomereasonunableorunpreparedtofunctioninthatBeanContext,throwaPropertyVetoExceptiontonotifythenestingBeanContext.Ifthechildthrowssuchanexce