@Override
  public final IFactorySimple<?> lazyGet(//NOPMD
    // Rule:DoubleCheckedLocking isn't true see in beige-common:
    // org.beigesoft.test.DoubleCkeckLockingWrApTest
    final Map<String, Object> pAddParam,
      final Class<?> pBeanClass) throws Exception {
    IFactorySimple<?> factory =
      this.factoriesMap.get(pBeanClass);
    if (factory == null) {
      // locking:
      synchronized (this.factoriesMap) {
        // make sure again whether it's null after locking:
        factory = this.factoriesMap.get(pBeanClass);
        if (AccountingEntries.class == pBeanClass) {
          factory = createPutFactoryAccountingEntries();
        } else if (IDoc.class.isAssignableFrom(pBeanClass)) {
          factory = createPutFactoryAccDoc(pBeanClass);
        } else if (IPersistableBase.class.isAssignableFrom(pBeanClass)) {
          factory = createPutFactoryPersistableBase(pBeanClass);
        } else {
          factory = createPutFactorySimple(pBeanClass);
        }
      }
    }
    return factory;
  }
@ Override public final IFactorySimple < ? > lazyGet ( final Map < String , Object > pAddParam , final Class < ? > pBeanClass ) throws Exception { IFactorySimple < ? > factory = this . factoriesMap . get ( pBeanClass ) ; if ( factory == null ) { synchronized ( this . factoriesMap ) { factory = this . factoriesMap . get ( pBeanClass ) ; if ( AccountingEntries . class == pBeanClass ) { factory = createPutFactoryAccountingEntries ( ) ; } else if ( IDoc . class . isAssignableFrom ( pBeanClass ) ) { factory = createPutFactoryAccDoc ( pBeanClass ) ; } else if ( IPersistableBase . class . isAssignableFrom ( pBeanClass ) ) { factory = createPutFactoryPersistableBase ( pBeanClass ) ; } else { factory = createPutFactorySimple ( pBeanClass ) ; } } } return factory ; }
<p>Get bean in lazy mode (if bean is null then initialize it).</p>
@param pAddParam additional param
@param pBeanClass - bean name
@return requested bean
@throws Exception - an exception