Skip to content

Latest commit

 

History

History
412 lines (343 loc) · 13.3 KB

CHANGELOG.md

File metadata and controls

412 lines (343 loc) · 13.3 KB

TODAY Context CHANGE LOG

🍎 A Java library for dependency injection and aspect oriented programing

TODAY Framework v1.0.1

  • ✨ 实现 WebSocket Netty 部分功能
  • 🐛 修复 StandardWebEnvironment yaml 依赖问题
  • ⬆️ update undertow to 2.2.8
  • ✨ 添加 WebServerAutoConfiguration 实现 WebServer 自动配置

Codacy Badge

安装

<dependency>
  <groupId>cn.taketoday</groupId>
  <artifactId>today-context</artifactId>
  <version>3.0.5.RELEASE</version>
</dependency>

当前版本

v4.0

  • ✨ 添加 策略加载器 StrategiesLoader 代替 load META-INFO

v3.0.6

v3.0.5

  • 🐛 修复 Configuration 遗漏配置问题

v3.0.4

⚡ 优化 BeanProperty 添加 TypeDescriptor 🐛 修复 NumberConverter stringSource 为空时 null 转换问题 :zap: 优化 布尔 转换问题 StringToBooleanConverter ⚡ 优化 DefaultConversionService 添加 对 null 值的处理 :zap: 优化 ContextUtils#resolveInitMethod :zap: 优化 EL 表达式性能

v3.0.3

  • 🐛 fix handleDependency 并发修改

v3.0.2

  • ✨ 新增 BeanProperties 工具类
  • ✨ 新增 StringToBytesConverter
  • ✨ 新增 TypeDescriptor#ofParameter
  • ⚡ 解决 原型Bean 依赖循环 initializeBean
  • ⚡ 解决 其他scope Bean 依赖循环 initializeBean
  • ✨ 新增 IgnoreDuplicates 忽略重复注册 bean
  • ⚡ 添加 新特性 BeanPropertyAccessor#throwsWhenReadOnly
  • ⚡ 重新设计property 异常体系
  • ✨ 添加 FunctionConstructor,SupplierConstructor
  • ⚡ 反射工具类新增 获取getter setter方法 修复newPropertyAccessor
  • ⚡ 添加 BeanMapping 相当于 BeanMap
  • ⚡ 修复 bean destroy 逻辑
  • 🔥 Deprecated SetterSupport
  • 🔥 Deprecated BeanReference
  • ⚡ 大量优化 AbstractBeanFactory
  • ⚡ 大量优化 反射体系
  • 🐛 修复 Aop 在没有拦截器模式下生成的子类错误问题

v3.0.1

🐛 修复 createObjectFactoryDependencyProxy 非接口的问题 🔥 delete Deprecated method 🐛 修复 ParameterFunction

v3.0.0(v2.1.7)

2021-4-29

  • ✨ 新增 BeanProperty BeanMetadata 提供高性能访问对象属性
  • ⚡ EL表达式 新增 handlePropertyNotResolved 极大的提高了扩展性
  • 🔨 重构 Aop 引入了 Spring API
  • ✨ 对泛型的支持
  • DataBinder
  • ✨ 添加 BeanPropertyAccessor 支持对对象属性的访问和设置
  • 🔨 重构了整个转换器机制,引入 ConversionService
  • 🔨 重构了 bean 初始化逻辑,提升了性能

?

  • 🐛 fix: loadBeanDefinition can't be catch exception
  • 🐛 fix: ContextUtils#loadProps() only support String
  • 🐛 fix: #11 JarEntryResource#getJarFilePath(String) jar file not found
  • ✨ feat: 使用方法名作为默认实例名称
  • 🔨 重构FactoryBean注册逻辑
  • 🔨 重构BeanFactory获取Bean的逻辑
  • ✨ 利用cglib构建了真正的原型实例
  • ✨ 增加导入配置(@Import)功能
  • ✨ 去除ClassUtils的classesCache,在应用环境下可能会使用到相同class
  • ✨ ConfigurableBeanFactory添加registerBean(BeanDefinition)方法
  • ✨ ContextUtils添加loadFromMetaInfo(String)统一加载META-INF下的类
  • ⚡ 重构DefaultBeanNameCreator提升性能
  • ✨ 6.添加StandardBeanDefinition#mergeAnnotations()方法来合并注解
  • ✨ StandardBeanFactory实现BeanDefinitionLoader接口作为默认bean加载器原本的默认加载器被丢弃不在使用
  • ⚡ 优化StandardEnvironment获取BeanNameCreator逻辑
  • ⚡ 优化AutowiredPropertyResolver不必要的局部变量
  • ⚡ 优化AbstractBeanFactory#containsBeanDefinition(Class,boolean)
  • ✨ 添加ExecutableParameterResolver增强构造器注入或方法注入的扩展性
  • ✨ 添加 Method Invoker
  • 🐛 修复#13注解扫描不完全
  • ✨ 添加日志包适配主流日志框架
  • ✨ 添加ApplicationEventCapable接口,提高扩展性
  • ✨ 添加BeanDefinition#setInitMethods(String[])
  • 🐛 修复重大漏洞:el执行期间潜在的并发问题
  • 🐛 修复bean实例重复创建
  • ✨ 新增ComponentScan支持自定义扫描包
  • ✨ 支持ApplicationContextSupport
  • ✨ 支持任意事件类型
  • ⚡ 优化循环依赖问题
  • ✨ 实现 DestructionBeanPostProcessor
  • 🔨 重构 使用CandidateComponentScanner加载类
  • ✨ 新增PathMatchingPatternResourceLoader
  • ✨ 添加ClassUtils#getQualifiedMethodName
  • ⚡ 优化AnnotationAttributes
  • ⚡ 优化ContextUtils
  • 🐛 修复listener顺序问题
  • 🐛 修复META-INFO/beans
  • 🐛 修复bean实例重复创建
  • ✨ 新增StringUtils#parseParameters()
  • ⚡ 优化Resource
  • ⚡ 优化toArray
  • ⚡ 优化AntPathMatcher
  • ✨ 新增OrderedSupport
  • ✨ 新增CandidateComponentScannerCapable
  • ⚡ 优化Resource
  • ✨ 增加Assert,MultiValueMap
  • ✨ 新增ImportAware
  • ✨ 将aop整合进来
  • 🔨 重大重构: 大量代码优化,重构,更正测试代码
  • ✨ 新增AbstractFactoryBean
  • ✨ 新增Spring AttributeAccessor
  • ✨ 新增BeanClassLoaderAware
  • 🔨 重构Condition
  • ✨ 新增BeanFactoryPostProcessor
  • 🔥 除去MessageFactory
  • ✨ 新的反射API
  • 🐛 修复ResourceUtils#getResource文件路径带有转义字符时的错误
  • ⚡ 优化AutoProxyCreator, CandidateComponentScanner, AbstractApplicationContext, PropertyValueResolver, ExecutableParameterResolver, StandardBeanFactory, AbstractCacheInterceptor, AspectsDestroyListener
  • ⚡ 新增Environment#getFlag
  • ⚡ 优化ContextUtils#resolveInitMethod
  • ⚡ 减少lombok依赖
  • ⚡ 优化加载过程
  • ✨ 支持使用Autowired方法注入
  • ⚡ 优化RedissonCache
  • 📝 优化部分Javadoc
  • ⚡ 优化扫描日志
  • ⚡ 优化PathMatchingPatternResourceLoader
  • ⚡ 优化AbstractAdvice代码
  • ⚡ 优化cglib
  • ⚡ 优化Environment初始化顺序
  • ✨ 新的反射API
  • ✨ ClassUtils#ParameterFunction可开启参数检查
  • ⚡ 重构PropertyValueResolver
  • 🐛 修复findTargetAttributes死循环
  • ✨ 新的AutowireCapableBeanFactory接口 -⚡ 新ReflectionUtils反射API

v2.1.6

  • ✨ feat: add Environment new api to get property
  • ✨ feat: add jar-prefix file to ignore jar scanning
  • 🐛 fix: ensure ExpressionFactory's instance consistent
  • 🐛 fix: DataSize.parse()
  • ⚡ add ConcurrentProperties
  • 🐛 fix #3 when get annotated beans that StandardBeanDefinition missed
  • 🐛 fix: NumberUtils String[].class can't be resolve
  • ✨ feat: full Prototype supports (only support interface)
  • ✨ feat: full Prototype Lifecycle supports (destroy bean after every single call)
  • 🐛 fix: can not access a member
  • 🐛 fix: can't getMethodArgsNames
  • 🐛 fix: ELProcessor not process
  • ✨ feat: lazy loading
  • 🐛 fix: no constructor
  • unify date format
  • ✨ feat: add Resource api
  • ✨ feat: add ResourceFilter to filter Resource
  • 🐛 fix: #6 Properties not found
  • 🐛 fix: ConfigurationException detail message
  • ✨ feat: add TypeConverter,StringTypeConverter api
  • 🔧 move jar-prefix to META-INF/jar-prefix
  • ✨ feat: Props nested class feature
  • 🐛 fix: #7 The bean is not initialized due to the startup sequence not found
  • ✨ feat: add new annotations: ConditionalOnClass, ConditionalOnExpression,ConditionalOnMissingClass,ConditionalOnProperty,ConditionalOnResource
  • 🐛 fix: #8 Property inject failure
  • 🐛 fix: NumberUtils#toArrayObject()
  • 🐛 fix: @since 2.1.6 elManager my be null
  • ✨ feat: @Value default value feature
  • ✨ feat: add @Env
  • ✨ feat: add META-INF/beans to avoid scan all jar file
  • ✨ feat: Use static method ContextUtils#getApplicationContext() to get ApplicationContext
  • 🐛 fix: #9 Some listener in a jar can't be load
  • 🐛 fix: #10 classes loading from a jar can't be load
  • 🔖 release v2.1.6 2019/7/24-1:37

v2.1.5

  • ✨ feat: Add context state feature
  • 🐛 fix: StandardEnvironment.addActiveProfile() when add profile before load context it is not work
  • ✨ feat: support Constructor injection
  • adjust: Adjust context event
  • ✨ feat: Enhance Props
  • ✨ feat: Add el support
  • 🐛 fix: When manually load context some properties can't be loaded
  • 🐛 fix: el Messages resource bundle not found

v2.1.4

  • fix some singletons could not be initialized.

v2.1.3

  • fix missing @Props injection
  • sync to maven central

v2.1.2

  • Use BeanNameCreator to create bean name
  • FactoryBean
  • 🐛 fix: handleDependency(): when handle dependency some bean definition has already exist
  • 🐛 fix: same name of bean when applyPropertyValues() cause exception
  • ✨ feat: add initMethods feature
  • ✨ feat: add destroyMethods feature
  • ✨ feat: add @MissingBean feature

v2.1.1

  • ✨ feat: add the destroy bean feature
  • 🐛 fix: #1 some singletons could not be initialized
  • discard @PropertyResolver

v2.1.0

examples

@Singleton
@Order(Ordered.HIGHEST_PRECEDENCE)
public class ProxyBeanPostProcessor implements BeanPostProcessor {

}

or

@ContextListener
public class BeanDefinitionLoadedListener_2 implements ApplicationListener<BeanDefinitionLoadedEvent>, Ordered {
    
    @Override
    public void onApplicationEvent(BeanDefinitionLoadedEvent event) {
        log.debug("BeanDefinitionLoadedListener_2");
    }

    @Override
    public int getOrder() {
        return 2;
    }
}

@Profile("test")

@Configuration
public class ConfigurationBean {

    @Prototype
    public User user() {
        return new User().setId(12);
    }

    @Singleton("user__")
    public User user__() {
        return new User().setId(12);
    }

    @Profile("test")
    @Prototype("user")
    public User testUser() {
        return new User().setUserName("TEST");
    }

    @Profile("prod")
    @Singleton("user")
    public User prodUser() {
        return new User().setUserName("PROD");
    }
    
    @Singleton("user_")
    @Conditional(WindowsCondition.class)
    public User windowsUser() {
        return new User().setUserName("Windows");
    }
}

public class WindowsCondition implements Condition {
    @Override
    public boolean matches(ApplicationContext applicationContext, AnnotatedElement annotatedElement) {
        String system = applicationContext.getEnvironment().getProperty("os.name");
        if(system.contains("Windows")) {
            return true;
        }
        return false;
    }
}

@Test
public void test_Profile() {

    try (ApplicationContext applicationContext = new AnnotationConfigApplicationContext(true)) {
        
        User user = applicationContext.getBean("user", User.class);
        System.out.println(user);
        assert "TEST".equals(user.getUserName());
    }
}

@Test
public void test_Conditional() {
    
    try (ApplicationContext applicationContext = new AnnotationConfigApplicationContext(true)) {
        User user = applicationContext.getBean("user_", User.class);
        System.out.println(user);
        assert "Windows".equals(user.getUserName());
    }
}

v2.0.0

  • 加入ObjectFactory
  • 框架重构

v1.2.1

  • 修复注入原型错误

v1.2.0

  • 添加 AnntationApplicationContext 支持 Configuration 注解
  • ClassPathApplicationContext 改为 DefaultApplicationContext
  • bean 注解支持方法标注

v1.1.1

  • 修复单例情况下接口对象与实现类对象不一致问题
  • 添加部分doc
  • 添加refresh方法
  • 添加test code
  • Properties 注入时可以选择替换掉前缀,前缀有时是为了区分一类配置
  • 优化注入可以自定义注解注入

v1.0.3

  1. 增加 FactoryBean 功能
  2. 增加 BeanFactoryAware
  3. 增加 BeanClassLoaderAware
  4. 增加 PropertyResolver 注解绑定依赖注入处理器
  5. 增加 Props 注解注入 直接注入Properties
  6. 优化依赖注入流程
  7. 加入 BeanPostProcessor
  8. 加入 DisposableBean
  9. 加入 InitializingBean

4:

public @interface PropertyResolver {

    Class<? extends Annotation> value() default Autowired.class;>
}

5:

public @interface Props {

	/**
	 * @return properties file name
	 */
    String[] value() default {};

	/**
	 * prefix of the key <br>
	 * default ""
	 * 
	 * @return
	 */
	String[] prefix() default { "" };

	/**
	 * replace prefix.
	 * 
	 * @return
	 */
	boolean replace() default false;

}