预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共33页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

南华大学 计算机科学与技术学院 实验报告 (2013-2014学年度第二学期) 课程名称:JAVAEE平台软件开发 课程内容:JAVAEE平台简介(翻译) 姓名学号 专业班级 地点教师 原文: 2.1.1TheBeanContextasaparticipantinnestedstructure(嵌套结构) OneoftherolesoftheBeanContextistointroducethenotion(概念)ofahierarchicalnesting(嵌套层次)orstructureofBeanContextandJavaBeaninstances(实例).InordertomodelthisstructuretheBeanContextmustexposeAPIthatdefinestherelationshipsinthestructureorhierarchy. TheBeanContextexposesitssuperstructure(上层建筑)throughimplementation(实施)ofthejava.beans.beancontext.BeanContextChildinterface(asdescribedlater).Thisinterfaceallowsthediscoveryandmanipulation(操作)ofaBeanContext’snestingBeanContext,andthusintroducesafacilitytocreateahierarchyofBeanContexts. TheBeanContextexposesitssubstructurethroughanumberofinterfacemethodsmodeledbythejava.util.Collectioninterfacesemantics(语义) BeanContextsarerequiredtoimplementallthemandatory(强制的)CollectionAPI’s,withthefollowingparticularsemanticsforadd()andremove():. Theadd()methodmaybeinvokedinordertonestanewObject,BeanContextChild,orBeanContextwithinthetargetBeanContext.Aconformantadd()implementationis requiredtoadhereto(坚持)thefollowingsemantics: •SynchronizeontheBeanContext.globalHierarchyLock. •EachchildobjectshallappearonlyonceinthesetofchildrenforagivenBeanContext. IftheinstanceisalreadyamemberoftheBeanContextthenthemethodshallreturnFalse. •Eachvalid(有效的)childshallbeaddedtothesetofchildrenofagivensourceBeanContext,andthusshallappearinthesetofchildren,obtainedthrougheitherthetoArray(),oriterator()methods,untilsuchtimeasthatchildisdeletedfromthenestingBeanContextviaaninvocationofremove(),removeAll(),retainAll(),orclear() •Asthechildisaddedtothesetofnestedchildren,andwherethatchildimplementthejava.beans.beancontext.BeanContextChildinterface(orBeanContextProxy,seelater fordetails),theBeanContextshallinvokethesetBeanContext()methoduponthatchild, withareferencetoitself.Uponinvocation,achildmay,ifitisforsomereasonunableorunpreparedtofunctioninthatBeanContext,throwaPropertyVetoExceptiontonotifythenestingBeanContex