public override IObjRef Dup(IObjRef objRef) { IPreparedObjRefFactory objRefConstructorDelegate = constructorDelegateMap.Get(objRef.RealType, objRef.IdNameIndex); if (objRefConstructorDelegate == null) { objRefConstructorDelegate = BuildDelegate(objRef.RealType, objRef.IdNameIndex); } return(objRefConstructorDelegate.CreateObjRef(objRef.Id, objRef.Version)); }
public override IObjRef CreateObjRef(Type entityType, int idIndex, Object id, Object version) { IPreparedObjRefFactory objRefConstructorDelegate = constructorDelegateMap.Get(entityType, idIndex); if (objRefConstructorDelegate == null) { objRefConstructorDelegate = BuildDelegate(entityType, idIndex); } return(objRefConstructorDelegate.CreateObjRef(id, version)); }
public override IPreparedObjRefFactory PrepareObjRefFactory(Type entityType, int idIndex) { IPreparedObjRefFactory objRefConstructorDelegate = constructorDelegateMap.Get(entityType, idIndex); if (objRefConstructorDelegate == null) { objRefConstructorDelegate = BuildDelegate(entityType, idIndex); } return(objRefConstructorDelegate); }
public override IObjRef CreateObjRef(AbstractCacheValue cacheValue, int idIndex) { IPreparedObjRefFactory objRefConstructorDelegate = constructorDelegateMap.Get(cacheValue.EntityType, idIndex); if (objRefConstructorDelegate == null) { objRefConstructorDelegate = BuildDelegate(cacheValue.EntityType, idIndex); } return(objRefConstructorDelegate.CreateObjRef(cacheValue.Id, cacheValue.Version)); }
protected IPreparedObjRefFactory BuildDelegate(Type realType, int idIndex) { lock (writeLock) { IPreparedObjRefFactory objRefConstructorDelegate = constructorDelegateMap.Get(realType, idIndex); if (objRefConstructorDelegate != null) { return(objRefConstructorDelegate); } Type enhancedType = BytecodeEnhancer.GetEnhancedType(typeof(Object), new ObjRefEnhancementHint(realType, idIndex)); objRefConstructorDelegate = AccessorTypeProvider.GetConstructorType <IPreparedObjRefFactory>(enhancedType); constructorDelegateMap.Put(realType, idIndex, objRefConstructorDelegate); return(objRefConstructorDelegate); } }