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

项目:JRediClients    文件:RedissonNamespaceParserSupport.java   
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;
}
项目:rjb-blog-multitenancy    文件:Log4jConfig.java   
@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;
}
项目:rjb-blog-multitenancy    文件:Log4jConfig.java   
@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;
}
项目:rjb-blog-multitenancy    文件:Log4jConfig.java   
@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;
}
项目:spring4-understanding    文件:AspectJAutoProxyCreatorTests.java   
@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());
}
项目:spring-security-adfs-saml2    文件:SAMLWebSecurityConfigurerAdapter.java   
@Bean
public MethodInvokingFactoryBean socketFactoryInitialization() {
    MethodInvokingFactoryBean methodInvokingFactoryBean = new MethodInvokingFactoryBean();
    methodInvokingFactoryBean.setTargetClass(Protocol.class);
    methodInvokingFactoryBean.setTargetMethod("registerProtocol");
    methodInvokingFactoryBean.setArguments(new Object[]{"https", protocol()});
    return methodInvokingFactoryBean;
}
项目:elucidate-server    文件:ServicesConfig.java   
@Bean(name = "log4jInitialization")
public MethodInvoker log4j() {
    MethodInvokingFactoryBean methodInvoker = new MethodInvokingFactoryBean();
    methodInvoker.setTargetClass(Log4jConfigurer.class);
    methodInvoker.setTargetMethod("initLogging");
    methodInvoker.setArguments(getLog4jArgs());
    return methodInvoker;
}
项目:java-platform    文件:SecurityConfiguration.java   
@Bean
public MethodInvokingFactoryBean setSecurityManager() {
    MethodInvokingFactoryBean factoryBean = new MethodInvokingFactoryBean();
    factoryBean.setStaticMethod("org.apache.shiro.SecurityUtils.setSecurityManager");
    factoryBean.setArguments(new Object[] { securityManager() });
    return factoryBean;
}
项目:spring-boot-saml2    文件:WebSecurityConfig.java   
@Bean
public MethodInvokingFactoryBean socketFactoryInitialization() {
    MethodInvokingFactoryBean methodInvokingFactoryBean = new MethodInvokingFactoryBean();
    methodInvokingFactoryBean.setTargetClass(Protocol.class);
    methodInvokingFactoryBean.setTargetMethod("registerProtocol");
    Object[] args = {"https", socketFactoryProtocol()};
    methodInvokingFactoryBean.setArguments(args);
    return methodInvokingFactoryBean;
}
项目:websec-saml2sp    文件:SamlSpringSecurityConfig.java   
@Bean
public MethodInvokingFactoryBean socketFactoryInitialization() {
    MethodInvokingFactoryBean methodInvokingFactoryBean = new MethodInvokingFactoryBean();
    methodInvokingFactoryBean.setTargetClass(Protocol.class);
    methodInvokingFactoryBean.setTargetMethod("registerProtocol");
    Object[] args = {"https", socketFactoryProtocol()};
    methodInvokingFactoryBean.setArguments(args);
    return methodInvokingFactoryBean;
}
项目:class-guard    文件:AspectJAutoProxyCreatorTests.java   
@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());
}
项目:spring-boot-security-saml-sample    文件:WebSecurityConfig.java   
@Bean
public MethodInvokingFactoryBean socketFactoryInitialization() {
    MethodInvokingFactoryBean methodInvokingFactoryBean = new MethodInvokingFactoryBean();
    methodInvokingFactoryBean.setTargetClass(Protocol.class);
    methodInvokingFactoryBean.setTargetMethod("registerProtocol");
    Object[] args = {"https", socketFactoryProtocol()};
    methodInvokingFactoryBean.setArguments(args);
    return methodInvokingFactoryBean;
}
项目:JRediClients    文件:RedissonRPCClientDefinitionParser.java   
@Override
protected Class<?> getBeanClass(Element element) {
    return MethodInvokingFactoryBean.class;
}
项目:JRediClients    文件:RedissonLiveObjectDefinitionParser.java   
@Override
protected Class<?> getBeanClass(Element element) {
    return MethodInvokingFactoryBean.class;
}
项目:gen-sbconfigurator    文件:DefaultConfiguration.java   
/**
 * 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;
    }
}