java类org.springframework.beans.factory.config.MethodInvokingFactoryBean的实例源码

RedissonNamespaceParserSupport.java 文件源码 项目:JRediClients 阅读 28 收藏 0 点赞 0 评论 0
private BeanDefinitionBuilder preInvoke(Element element, Object obj, String method, Object[] args, ParserContext parserContext, boolean factory) {
    BeanDefinitionBuilder builder
            = createBeanDefinitionBuilder(element, parserContext,
                    factory
                            ? MethodInvokingFactoryBean.class
                            : BeanMethodInvoker.class);
    if (obj instanceof Class) {
        builder.addPropertyValue("staticMethod",
                ((Class) obj).getName() + "." + method);
    } else {
        builder.addPropertyValue("targetMethod", method);
    }
    builder.addPropertyValue("arguments", args);
    if (element != null) {
        parserContext.getDelegate().parseQualifierElements(element,
                builder.getRawBeanDefinition());
    }
    return builder;
}
Log4jConfig.java 文件源码 项目:rjb-blog-multitenancy 阅读 26 收藏 0 点赞 0 评论 0
@SuppressWarnings("deprecation")
@Bean
public Object log4jInitializer() {
    MethodInvokingFactoryBean returnVal = new MethodInvokingFactoryBean();
    returnVal
            .setTargetClass(org.springframework.util.Log4jConfigurer.class);
    returnVal.setTargetMethod("initLogging");
    returnVal.setArguments(new Object[] { propertiesConfig.log4jConfigFile(), Long.valueOf(5000) });
    return returnVal;
}
Log4jConfig.java 文件源码 项目:rjb-blog-multitenancy 阅读 24 收藏 0 点赞 0 评论 0
@SuppressWarnings("deprecation")
@Bean
public Object log4jInitializer() {
    MethodInvokingFactoryBean returnVal = new MethodInvokingFactoryBean();
    returnVal
            .setTargetClass(org.springframework.util.Log4jConfigurer.class);
    returnVal.setTargetMethod("initLogging");
    returnVal.setArguments(new Object[] { propertiesConfig.log4jConfigFile(), Long.valueOf(5000) });
    return returnVal;
}
Log4jConfig.java 文件源码 项目:rjb-blog-multitenancy 阅读 25 收藏 0 点赞 0 评论 0
@SuppressWarnings("deprecation")
@Bean
public Object log4jInitializer() {
    MethodInvokingFactoryBean returnVal = new MethodInvokingFactoryBean();
    returnVal
            .setTargetClass(org.springframework.util.Log4jConfigurer.class);
    returnVal.setTargetMethod("initLogging");
    returnVal.setArguments(new Object[] { propertiesConfig.log4jConfigFile(), Long.valueOf(5000) });
    return returnVal;
}
AspectJAutoProxyCreatorTests.java 文件源码 项目:spring4-understanding 阅读 30 收藏 0 点赞 0 评论 0
@Test
public void testAspectsAreApplied() {
    ClassPathXmlApplicationContext bf = newContext("aspects.xml");
    ITestBean tb = (ITestBean) bf.getBean("adrian");
    assertEquals(68, tb.getAge());
    MethodInvokingFactoryBean factoryBean = (MethodInvokingFactoryBean) bf.getBean("&factoryBean");
    assertTrue(AopUtils.isAopProxy(factoryBean.getTargetObject()));
    assertEquals(68, ((ITestBean) factoryBean.getTargetObject()).getAge());
}
SAMLWebSecurityConfigurerAdapter.java 文件源码 项目:spring-security-adfs-saml2 阅读 31 收藏 0 点赞 0 评论 0
@Bean
public MethodInvokingFactoryBean socketFactoryInitialization() {
    MethodInvokingFactoryBean methodInvokingFactoryBean = new MethodInvokingFactoryBean();
    methodInvokingFactoryBean.setTargetClass(Protocol.class);
    methodInvokingFactoryBean.setTargetMethod("registerProtocol");
    methodInvokingFactoryBean.setArguments(new Object[]{"https", protocol()});
    return methodInvokingFactoryBean;
}
ServicesConfig.java 文件源码 项目:elucidate-server 阅读 23 收藏 0 点赞 0 评论 0
@Bean(name = "log4jInitialization")
public MethodInvoker log4j() {
    MethodInvokingFactoryBean methodInvoker = new MethodInvokingFactoryBean();
    methodInvoker.setTargetClass(Log4jConfigurer.class);
    methodInvoker.setTargetMethod("initLogging");
    methodInvoker.setArguments(getLog4jArgs());
    return methodInvoker;
}
SecurityConfiguration.java 文件源码 项目:java-platform 阅读 30 收藏 0 点赞 0 评论 0
@Bean
public MethodInvokingFactoryBean setSecurityManager() {
    MethodInvokingFactoryBean factoryBean = new MethodInvokingFactoryBean();
    factoryBean.setStaticMethod("org.apache.shiro.SecurityUtils.setSecurityManager");
    factoryBean.setArguments(new Object[] { securityManager() });
    return factoryBean;
}
WebSecurityConfig.java 文件源码 项目:spring-boot-saml2 阅读 24 收藏 0 点赞 0 评论 0
@Bean
public MethodInvokingFactoryBean socketFactoryInitialization() {
    MethodInvokingFactoryBean methodInvokingFactoryBean = new MethodInvokingFactoryBean();
    methodInvokingFactoryBean.setTargetClass(Protocol.class);
    methodInvokingFactoryBean.setTargetMethod("registerProtocol");
    Object[] args = {"https", socketFactoryProtocol()};
    methodInvokingFactoryBean.setArguments(args);
    return methodInvokingFactoryBean;
}
SamlSpringSecurityConfig.java 文件源码 项目:websec-saml2sp 阅读 26 收藏 0 点赞 0 评论 0
@Bean
public MethodInvokingFactoryBean socketFactoryInitialization() {
    MethodInvokingFactoryBean methodInvokingFactoryBean = new MethodInvokingFactoryBean();
    methodInvokingFactoryBean.setTargetClass(Protocol.class);
    methodInvokingFactoryBean.setTargetMethod("registerProtocol");
    Object[] args = {"https", socketFactoryProtocol()};
    methodInvokingFactoryBean.setArguments(args);
    return methodInvokingFactoryBean;
}
AspectJAutoProxyCreatorTests.java 文件源码 项目:class-guard 阅读 28 收藏 0 点赞 0 评论 0
@Test
public void testAspectsAreApplied() {
    ClassPathXmlApplicationContext bf = newContext("aspects.xml");
    ITestBean tb = (ITestBean) bf.getBean("adrian");
    assertEquals(68, tb.getAge());
    MethodInvokingFactoryBean factoryBean = (MethodInvokingFactoryBean) bf.getBean("&factoryBean");
    assertTrue(AopUtils.isAopProxy(factoryBean.getTargetObject()));
    assertEquals(68, ((ITestBean) factoryBean.getTargetObject()).getAge());
}
WebSecurityConfig.java 文件源码 项目:spring-boot-security-saml-sample 阅读 25 收藏 0 点赞 0 评论 0
@Bean
public MethodInvokingFactoryBean socketFactoryInitialization() {
    MethodInvokingFactoryBean methodInvokingFactoryBean = new MethodInvokingFactoryBean();
    methodInvokingFactoryBean.setTargetClass(Protocol.class);
    methodInvokingFactoryBean.setTargetMethod("registerProtocol");
    Object[] args = {"https", socketFactoryProtocol()};
    methodInvokingFactoryBean.setArguments(args);
    return methodInvokingFactoryBean;
}
RedissonRPCClientDefinitionParser.java 文件源码 项目:JRediClients 阅读 30 收藏 0 点赞 0 评论 0
@Override
protected Class<?> getBeanClass(Element element) {
    return MethodInvokingFactoryBean.class;
}
RedissonLiveObjectDefinitionParser.java 文件源码 项目:JRediClients 阅读 26 收藏 0 点赞 0 评论 0
@Override
protected Class<?> getBeanClass(Element element) {
    return MethodInvokingFactoryBean.class;
}
DefaultConfiguration.java 文件源码 项目:gen-sbconfigurator 阅读 25 收藏 0 点赞 0 评论 0
/**
 * Registers the specified <code>module</code> to all the loaded modules.
 * 
 * @param id
 *            the id of the module to be registered
 * @param module
 *            the <code>module</code> to be registered
 * 
 * @return <code>true</code> if the <code>module</code> was added, otherwise
 *         <code>false</code>
 */
protected boolean registerModule(final String id, final Object module) {
    final Object current;

    // register the module
    if (!isModule(id, module)) {
        if (isAnonymousId(id)) {
            if (id.contains(MethodInvokingFactoryBean.class.getName())
                    || id.contains(MethodExecutorBean.class.getName())
                    || id.contains(net.meisen.general.sbconfigurator.factories.MethodInvokingFactoryBean.class
                            .getName())) {
                if (LOG.isTraceEnabled()) {
                    LOG.trace("Skipping the bean '"
                            + id
                            + "' as module, because it is an anonymous bean used for MethodInvokation");
                }
            } else if (LOG.isWarnEnabled()) {
                LOG.warn("Skipping the bean '"
                        + id
                        + "' as module, because it is probably an anonymous bean");
            }
        } else {
            if (LOG.isTraceEnabled()) {
                LOG.trace("Skipping the bean '" + id + "' as module");
            }
        }

        return false;
    } else if ((current = modules.put(id, module)) != null) {

        if (LOG.isWarnEnabled() && !Objects.equals(current, module)) {
            LOG.warn("Overloading the module '" + id + "'");
        }

        return true;
    } else {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Loaded the module '" + id + "' of type '"
                    + module.getClass().getName() + "'");
        }

        return true;
    }
}


问题


面经


文章

微信
公众号

扫码关注公众号