public class SpringForestObjectFactory extends DefaultObjectFactory implements org.springframework.context.ApplicationContextAware
Constructor and Description |
---|
SpringForestObjectFactory() |
Modifier and Type | Method and Description |
---|---|
<T> T |
getObject(Class<T> clazz)
获取Forest接口对象(Spring方式)
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
getObjectFromCache, registerConstructor, registerObject
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public <T> T getObject(Class<T> clazz)
适用于Forest相关接口(非请求客户端接口)和回调函数的工厂接口
当这些类没有实例的情况下,会先实例化并缓存下来,以后再取会通过缓存获取对象
实例化方式:通过Spring上下文获取Bean
getObject
in interface ForestObjectFactory
getObject
in class DefaultObjectFactory
T
- Forest对象接口类泛型clazz
- Forest对象接口类Copyright © 2022. All rights reserved.