类 BeanNameAutoProxyCreator

    • 方法详细资料

      • setBeanNames

        public void setBeanNames​(String... beanNames)
        Set the names of the beans that should automatically get wrapped with proxies. A name can specify a prefix to match by ending with "*", e.g. "myBean,tx*" will match the bean named "myBean" and all beans whose name start with "tx".

        NOTE: In case of a FactoryBean, only the objects created by the FactoryBean will get proxied. This default behavior applies as of Spring 2.0. If you intend to proxy a FactoryBean instance itself (a rare use case, but Spring 1.2's default behavior), specify the bean name of the FactoryBean including the factory-bean prefix "&": e.g. "&myFactoryBean".

        另请参阅:
        FactoryBean, BeanFactory.FACTORY_BEAN_PREFIX
      • isMatch

        protected boolean isMatch​(String beanName,
                                  String mappedName)
        Return if the given bean name matches the mapped name.

        The default implementation checks for "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality. Can be overridden in subclasses.

        参数:
        beanName - the bean name to check
        mappedName - the name in the configured list of names
        返回:
        if the names match
        另请参阅:
        PatternMatchUtils.simpleMatch(String, String)