import RequestContext from "../scope/RequestContext"; import {SCAN_TYPE} from "../@types/types"; import {applicationContext} from "../context/ApplicationContext"; import DiSupplier from "./DiSupplier"; import {logger} from "../logger/Logger"; export class SingletonDiSupplier extends DiSupplier{ public async scopeDiSupplierWorker(rc:RequestContext, className:string):Promise { let bean:SCAN_TYPE | undefined = applicationContext.findBean(className); if(bean && bean.OPTION?.SCOPE === "singleton") { return bean.BEAN; } logger.error(`[@SCOPE.singleton] no bean exist : ${className}` ); return undefined; } }