try {
pnc = (PNamingContext) classLoader
.loadClass(tokens[PNC_IDX]).newInstance();
//if the PNC is polymorphic
if (tokens[PNC_IDX].equals(POLYMORPHIC_PNC)) {
PolymorphicPNamingContext polymorphicPNC = (PolymorphicPNamingContext) pnc;
//link the cache
//cache null
polymorphicPNC.setCache(this.cache);
//instanciate a new binder
PBinder delegatedBinder = getPBinder(className, hints, classLoader,
mappingStructureRule, cn2binder, cn2pnc);
//link a new instanciated and dedicated binder
polymorphicPNC.setDelegatedBinder(delegatedBinder);
delegatedBinder.setPClassMapping(pcm);
delegatedBinder.setPType(pcm.getPType());
//link the PClassMapping
polymorphicPNC.setPcm(delegatedBinder.getBinderClassMapping());
}
} catch (Exception e) {
throw new PException(e,
"Impossible to instanciate the PNC of the class "
+ hints);