Package org.springframework.beans.factory.access

Examples of org.springframework.beans.factory.access.BeanFactoryLocator


   * Retrieves the bean factory.
   *
   * @return
   */
  protected BeanFactory retrieveBeanFactory() {
    BeanFactoryLocator factoryLocator = new JbpmFactoryLocator();
    BeanFactoryReference factory = factoryLocator.useBeanFactory(factoryKey);
    if (factory == null)
      throw new IllegalArgumentException("no beanFactory found under key=" + factoryKey);

    return factory.getFactory();
  }
View Full Code Here


   * Retrieves the bean factory.
   *
   * @return
   */
  protected BeanFactory retrieveBeanFactory() {
    BeanFactoryLocator factoryLocator = new JbpmFactoryLocator();
    BeanFactoryReference factory = factoryLocator.useBeanFactory(factoryKey);
    if (factory == null)
      throw new IllegalArgumentException("no beanFactory found under key=" + factoryKey);

    try {
      return factory.getFactory();
View Full Code Here

        if (parentContextKey != null)
        {
            // locatorFactorySelector may be null, indicating the default
            // "classpath*:beanRefContext.xml"
            BeanFactoryLocator locator = ContextSingletonBeanFactoryLocator.getInstance(locatorFactorySelector);
            if (logger.isDebugEnabled())
            {
                logger.debug("Getting parent context definition: using parent context key of '" + parentContextKey
                             + "' with BeanFactoryLocator");
            }
            parentContext = (ApplicationContext) locator.useBeanFactory(parentContextKey).getFactory();
        }

        return parentContext;
    }
View Full Code Here

    String locatorFactorySelector = servletContext.getInitParameter(LOCATOR_FACTORY_SELECTOR_PARAM);
    String parentContextKey = servletContext.getInitParameter(LOCATOR_FACTORY_KEY_PARAM);

    if (parentContextKey != null) {
      // locatorFactorySelector may be null, indicating the default "classpath*:beanRefContext.xml"
      BeanFactoryLocator locator = ContextSingletonBeanFactoryLocator.getInstance(locatorFactorySelector);
      Log logger = LogFactory.getLog(ContextLoader.class);
      if (logger.isDebugEnabled()) {
        logger.debug("Getting parent context definition: using parent context key of '" +
            parentContextKey + "' with BeanFactoryLocator");
      }
      this.parentContextRef = locator.useBeanFactory(parentContextKey);
      parentContext = (ApplicationContext) this.parentContextRef.getFactory();
    }

    return parentContext;
  }
View Full Code Here

    String locatorFactorySelector = servletContext.getInitParameter(LOCATOR_FACTORY_SELECTOR_PARAM);
    String parentContextKey = servletContext.getInitParameter(LOCATOR_FACTORY_KEY_PARAM);

    if (parentContextKey != null) {
      // locatorFactorySelector may be null, indicating the default "classpath*:beanRefContext.xml"
      BeanFactoryLocator locator = ContextSingletonBeanFactoryLocator.getInstance(locatorFactorySelector);
      Log logger = LogFactory.getLog(ContextLoader.class);
      if (logger.isDebugEnabled()) {
        logger.debug("Getting parent context definition: using parent context key of '" +
            parentContextKey + "' with BeanFactoryLocator");
      }
      this.parentContextRef = locator.useBeanFactory(parentContextKey);
      parentContext = (ApplicationContext) this.parentContextRef.getFactory();
    }

    return parentContext;
  }
View Full Code Here

    String locatorFactorySelector = servletContext.getInitParameter(LOCATOR_FACTORY_SELECTOR_PARAM);
    String parentContextKey = servletContext.getInitParameter(LOCATOR_FACTORY_KEY_PARAM);

    if (parentContextKey != null) {
      // locatorFactorySelector may be null, indicating the default "classpath*:beanRefContext.xml"
      BeanFactoryLocator locator = ContextSingletonBeanFactoryLocator.getInstance(locatorFactorySelector);
      if (this.logger.isDebugEnabled()) {
        this.logger.debug("Getting parent context definition: using parent context key of '" +
            parentContextKey + "' with BeanFactoryLocator");
      }
      this.parentContextRef = locator.useBeanFactory(parentContextKey);
      parentContext = (ApplicationContext) this.parentContextRef.getFactory();
    }

    return parentContext;
  }
View Full Code Here

    String locatorFactorySelector = servletContext.getInitParameter(LOCATOR_FACTORY_SELECTOR_PARAM);
    String parentContextKey = servletContext.getInitParameter(LOCATOR_FACTORY_KEY_PARAM);

    if (parentContextKey != null) {
      // locatorFactorySelector may be null, indicating the default "classpath*:beanRefContext.xml"
      BeanFactoryLocator locator = ContextSingletonBeanFactoryLocator.getInstance(locatorFactorySelector);
      if (logger.isDebugEnabled()) {
        logger.debug("Getting parent context definition: using parent context key of '" +
            parentContextKey + "' with BeanFactoryLocator");
      }
      this.parentContextRef = locator.useBeanFactory(parentContextKey);
      parentContext = (ApplicationContext) this.parentContextRef.getFactory();
    }

    return parentContext;
  }
View Full Code Here

    String locatorFactorySelector = servletContext.getInitParameter(LOCATOR_FACTORY_SELECTOR_PARAM);
    String parentContextKey = servletContext.getInitParameter(LOCATOR_FACTORY_KEY_PARAM);

    if (parentContextKey != null) {
      // locatorFactorySelector may be null, indicating the default "classpath*:beanRefContext.xml"
      BeanFactoryLocator locator = ContextSingletonBeanFactoryLocator.getInstance(locatorFactorySelector);
      if (logger.isDebugEnabled()) {
        logger.debug("Getting parent context definition: using parent context key of '" +
            parentContextKey + "' with BeanFactoryLocator");
      }
      this.parentContextRef = locator.useBeanFactory(parentContextKey);
      parentContext = (ApplicationContext) this.parentContextRef.getFactory();
    }

    return parentContext;
  }
View Full Code Here

   * 2nd and subsequent calls will actuall get back same locator instance. This is not
   * really an issue, since the contained bean factories will still be loaded and released.
   */
  public void testGetInstance() {
    // Try with and without 'classpath*:' prefix, and with 'classpath:' prefix.
    BeanFactoryLocator facLoc = ContextSingletonBeanFactoryLocator.getInstance(
        ClassUtils.addResourcePathToPackagePath(
        SingletonBeanFactoryLocatorTests.class, "ref1.xml"));
    getInstanceTest1(facLoc);
   
    facLoc = ContextSingletonBeanFactoryLocator.getInstance(
View Full Code Here

  /*
   * Class to test for BeanFactoryLocator getInstance()
   */
  public void testGetInstance() {
    BeanFactoryLocator bf = DefaultLocatorFactory.getInstance();
    BeanFactoryLocator bf2 = DefaultLocatorFactory.getInstance();
    assertTrue(bf.equals(bf2));
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.access.BeanFactoryLocator

Copyright © 2018 www.massapicom. 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.