Examples of registerSingleton()


Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory.registerSingleton()

      autowireValue = AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE;
    }

    DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
    beanFactory.setParentBeanFactory(parentBeanFactory);
    beanFactory.registerSingleton(taskref, target);

    log("Autowiring reference: " + taskref);

    beanFactory.autowireBeanProperties(target, autowireValue, false);
  }
View Full Code Here

Examples of org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.registerSingleton()

  public void testSingletons() {
    DefaultSingletonBeanRegistry beanRegistry = new DefaultSingletonBeanRegistry();

    TestBean tb = new TestBean();
    beanRegistry.registerSingleton("tb", tb);
    assertSame(tb, beanRegistry.getSingleton("tb"));

    TestBean tb2 = (TestBean) beanRegistry.getSingleton("tb2", new ObjectFactory() {
      public Object getObject() throws BeansException {
        return new TestBean();
View Full Code Here

Examples of org.springframework.beans.factory.xml.XmlBeanFactory.registerSingleton()

                }
            });
            PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
            ppc.setProperties(_properties);
            ppc.postProcessBeanFactory(f);
            f.registerSingleton("serverManagementService", getServerManagementService());
            WOJServer s = (WOJServer)f.getBean("wojServer", WOJServer.class);
            return s;
        } catch (Exception ex) {
            LOGGER.error("impossible to configure server "+mode, ex);
            throw new IllegalStateException("impossible to configure server "+mode);
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext.registerSingleton()

public class MapBasedSoapEndpointMappingTest {

    @Test
    public void testBeanNames() throws Exception {
        StaticApplicationContext context = new StaticApplicationContext();
        context.registerSingleton("endpointMapping", MyMapBasedEndpointMapping.class);
        context.registerSingleton("endpoint", Object.class);
        context.registerAlias("endpoint", "alias");
        MyMapBasedEndpointMapping mapping = new MyMapBasedEndpointMapping();
        mapping.setValidKeys(new String[]{"endpoint", "alias"});
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext.registerSingleton()

    @Test
    public void testBeanNames() throws Exception {
        StaticApplicationContext context = new StaticApplicationContext();
        context.registerSingleton("endpointMapping", MyMapBasedEndpointMapping.class);
        context.registerSingleton("endpoint", Object.class);
        context.registerAlias("endpoint", "alias");
        MyMapBasedEndpointMapping mapping = new MyMapBasedEndpointMapping();
        mapping.setValidKeys(new String[]{"endpoint", "alias"});

        mapping.setRegisterBeanNames(true);
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext.registerSingleton()

    }

    @Test
    public void testDisabledBeanNames() throws Exception {
        StaticApplicationContext context = new StaticApplicationContext();
        context.registerSingleton("endpoint", Object.class);

        MyMapBasedEndpointMapping mapping = new MyMapBasedEndpointMapping();

        mapping.setRegisterBeanNames(true);
        mapping.setApplicationContext(context);
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext.registerSingleton()

    }

    @Test
    public void smartEndpointInterceptors() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("smartInterceptor", MySmartEndpointInterceptor.class);

        final Object endpoint = new Object();
        EndpointInterceptor interceptor = new EndpointInterceptorAdapter();
        AbstractEndpointMapping mapping = new AbstractEndpointMapping() {
            @Override
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext.registerSingleton()

    }

    @Test
    public void endpointBeanName() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("endpoint", Object.class);

        AbstractEndpointMapping mapping = new AbstractEndpointMapping() {

            @Override
            protected Object getEndpointInternal(MessageContext message) throws Exception {
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext.registerSingleton()

    }

    @Test
    public void endpointInvalidBeanName() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("endpoint", Object.class);

        AbstractEndpointMapping mapping = new AbstractEndpointMapping() {

            @Override
            protected Object getEndpointInternal(MessageContext message) throws Exception {
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext.registerSingleton()

    @Test
    public void runAsManagerIsSetCorrectly() throws Exception {
        StaticApplicationContext parent = new StaticApplicationContext();
        MutablePropertyValues props = new MutablePropertyValues();
        props.addPropertyValue("key", "blah");
        parent.registerSingleton("runAsMgr", RunAsManagerImpl.class, props);
        parent.refresh();

        setContext("<global-method-security run-as-manager-ref='runAsMgr'/>" + AUTH_PROVIDER_XML, parent);
        RunAsManagerImpl ram = (RunAsManagerImpl) appContext.getBean("runAsMgr");
        MethodSecurityMetadataSourceAdvisor msi = (MethodSecurityMetadataSourceAdvisor)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.