import { ICloseable } from "../java"; import { ILifecycle } from "../org.springframework.context/lifecycle"; import { TWishedBean } from "./annotations"; import { TWishedBeanOrFactory, IBeanFactory } from "./factory"; import { IResourceLoader } from "../org.springframework.context/resourceLoader"; /** * Abstract base class for IBeanFactory implementations. * @remark https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/beans/factory/support/AbstractBeanFactory.html */ export declare abstract class AbstractBeanFactory implements IBeanFactory, ILifecycle, ICloseable, IResourceLoader { beansMap: Map; beanPathMap: Map; protected running: boolean; protected abstract parentBeanFactory: AbstractBeanFactory; static beansMap: Map; constructor(); /** * Get resource from server. * @param url - json resource url. */ abstract getResource(url: string): Promise; /** * Retrieve instantiated bean from cache. */ findSingletonInstance(key: any): any; /** * Retrieve instantiated bean from cache. */ private findGlobalInstance; /** * Set bean token mapping. * @param key - bean token. * @param value - target to which bean token will be mapped (bean name or token). */ set(key: Symbol, value: TWishedBeanOrFactory): void; /** * Unset bean token mapping. * @param key - bean token to unset. */ unset(key: Symbol): void; /** * Set bean token mapping in batch way. * @param beanPathMap - map with beans mapping. */ configure(beanPathMap: Map): void; /** * Proxy beans to specified context. * @param context - context to inherit. * @param wishedBeans - beans to proxy to inherited context. */ inherit(context: AbstractBeanFactory, wishedBeans: TWishedBean[]): void; /** * Proxy all not found beans to specified context. * @param context - context to search not found beans. */ setParent(context: AbstractBeanFactory): void; /** * Execute all disposers in bean. * @param instance - bean. */ disposeBean(instance: any): void; /** * Destroy specified bean without deleting from path map. * @param instance - bean. */ destroyBean(instance: any): void; /** * Retrieve bean from cache. Similar to getBean but in sync way. * @param wishedBean - bean name or token. * @param required - if not found and not required function returns null. * @param extraBeanPathMap - extension of context bean mapping. * @param debug - show bean resolution to console. */ getCachedBean(wishedBean: TWishedBeanOrFactory | T, required?: boolean, extraBeanPathMap?: Map, debug?: boolean): T | null; private getCachedBeanByToken; /** * Retrieve bean from cache. * @param wishedBean - bean name or token. * @param required - if not found and not required function returns null. * @param extraBeanPathMap - extension of context bean mapping. * @param debug - show bean resolution to console. */ getBean(wishedBean: TWishedBeanOrFactory | T, required?: boolean, extraBeanPathMap?: Map, debug?: boolean): Promise; /** * Resolve bean name or token. * @param wishedBean - bean name or token. * @param extraBeanPathMap - extension of context bean mapping. */ resolveBean(wishedBean: TWishedBean, extraBeanPathMap?: Map): TWishedBeanOrFactory; private getBeanByToken; private instantiateBean; private autowire; private resource; /** * Destroy all beans in context and erase beans names mapping. */ close(): void; /** * Start context */ start(): void; /** * Destroy all beans in context but keep bean names mapping. */ stop(): void; /** * Wheather context running and beans ready to retrieving. */ isRunning(): boolean; }