{@inheritDoc}

@param lazyAppFn
513637
@Override
    public <B> Lazy<Compose<F, G, B>> lazyZip(
            Lazy<? extends Applicative<Function<? super A, ? extends B>, Compose<F, G, ?>>> lazyAppFn) {
        @SuppressWarnings("RedundantTypeArguments")
        Lazy<Applicative<Applicative<Function<? super A, ? extends B>, G>, F>> lazyAppFnCoerced =
                lazyAppFn
                        .<Compose<F, G, Function<? super A, ? extends B>>>fmap(
                                Applicative<Function<? super A, ? extends B>, Compose<F, G, ?>>::coerce)
                        .fmap(Compose<F, G, Function<? super A, ? extends B>>::getCompose);

        return fga.<Applicative<A, G>>fmap(upcast())
                .<Applicative<B, G>>lazyZip(lazyAppFnCoerced.fmap(fgf -> fgf.fmap(gf -> ga -> ga.zip(gf))))
                .fmap(Compose::new);
    }
581686
@Override
  public final IProcessor lazyGet(//NOPMD
    final Map<String, Object> pAddParam,
      final String pBeanName) throws Exception {
    IProcessor proc = this.processorsMap.get(pBeanName);
    if (proc == null) {
      // locking:
      synchronized (this.processorsMap) {
        // make sure again whether it's null after locking:
        proc = this.processorsMap.get(pBeanName);
        if (proc == null) {
          if (pBeanName.equals(PrcRefreshItemsInList
            .class.getSimpleName())) {
            proc = lazyGetPrcRefreshItemsInList(pAddParam);
          } else if (pBeanName.equals(PrcRefreshCatalog
            .class.getSimpleName())) {
            proc = lazyGetPrcRefreshCatalog(pAddParam);
          } else if (pBeanName.equals(PrcCsvSampleDataRow
            .class.getSimpleName())) { //only web-store
            proc = lazyGetPrcCsvSampleDataRow(pAddParam);
          } else if (pBeanName.equals(PrcAssignItemsToCatalog
            .class.getSimpleName())) {
            proc = lazyGetPrcAssignItemsToCatalog(pAddParam);
          } else if (pBeanName.equals("waPrcEntitiesPage")) {
            proc = createPutPrcWaEntitiesPage();
          }
        }
      }
    }
    if (proc == null) {
      throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
        pBeanName + " not found!");
    }
    return proc;
  }
1218048
function lazy(arg) {
  var conf = this.configure();
  var action = arg.action();
  if(!conf.command.dir || action !== undefined) return false;
  var file = path.join(conf.command.dir, getModulePath.call(this, arg))
  try{
    action = require(file);
    if(typeof action !== 'function') {
      return this.raise(this.errors.ECMD_TYPE, [file]);
    }
    arg.action(action);
  }catch(e) {
    return this.raise(this.errors.ECMD_REQUIRE, [file, e.message], e);
  }
}
645513
@Override
    public <C> Lazy<Const<A, C>> lazyZip(
            Lazy<? extends Applicative<Function<? super B, ? extends C>, Const<A, ?>>> lazyAppFn) {
        return Monad.super.lazyZip(lazyAppFn).fmap(Monad<C, Const<A, ?>>::coerce);
    }
1185221
public static function lazy(int $count, ?Closure $closure = null) : Lazy
  {
    $page = isset($_GET['page']) ? $_GET['page'] : null;
    $path = isset($_SERVER['REQUEST_URI']) ? ((str_contains($_SERVER['REQUEST_URI'], '?')) ? explode('?', ($_SERVER['REQUEST_URI']))[0] : $_SERVER['REQUEST_URI']) : '';

    if ($page == null) {
      $pattern = explode('/', $path);
      $page = (is_numeric(end($pattern)) ? $page = end($pattern) : 1);
    }

    $skip = ($page * $count) - $count;

    if ($closure !== null) {
      $query = call_user_func_array($closure, [new self]);

      if (!$query instanceof Builder) {
        throw new HibernateBuilderException;
      }
    }

    $get   = isset($query) ? $query->skip($skip)->take($count)->get() : self::skip($skip)->take($count)->get();
    $total = isset($query) ? $query->count() : self::count();
    $next  = ($total - ($page * $count)) > 0 ? '/?page=' . ($page + 1) : null;
    $prev  = $page > 1 ? '/?page=' . ($page - 1) : null;
    $first = ($get->count() < 1) ? null : "/?page=1";
    $last  = '/?page=' . (strpos(($total / $count),'.') ? explode('.', $total / $count)[0] + 1 : ($total / $count));

    $object = [
      'current_page' => (int)$page,
      'data' => $get,
      'first_page_url' => $first,
      'prev_page_url' => $prev,
      'next_page_url' => $next,
      'last_page_url' => $last,
      'per_page' => $count,
      'total' => $total
    ];

    return new Lazy($object);
  }
1029634
@Override
  public final IEntityProcessor lazyGet(final Map<String, Object> pAddParam,
    final String pBeanName) throws Exception {
    IEntityProcessor proc = this.processorsMap.get(pBeanName);
    if (proc == null) {
      // locking:
      synchronized (this.processorsMap) {
        // make sure again whether it's null after locking:
        proc = this.processorsMap.get(pBeanName);
        if (proc == null) {
          if (pBeanName.equals(PrcHasSeSellerSave.class.getSimpleName())) {
            proc = lazyGetPrcHasSeSellerSave(pAddParam);
          } else if (pBeanName.equals(PrcHasSeSellerDel
            .class.getSimpleName())) {
            proc = lazyGetPrcHasSeSellerDel(pAddParam);
          } else if (pBeanName.equals(PrcSeGoodsSpecSave
            .class.getSimpleName())) {
            proc = lazyGetPrcSeGoodsSpecSave(pAddParam);
          } else if (pBeanName.equals(PrCuOrSeSv
            .class.getSimpleName())) {
            proc = lazyGetPrCuOrSeSv(pAddParam);
          } else if (pBeanName.equals(PrcSeServiceSpecSave
            .class.getSimpleName())) {
            proc = lazyGetPrcSeServiceSpecSave(pAddParam);
          } else if (pBeanName.equals(PrcSeGdSpecEmbFlSave
            .class.getSimpleName())) {
            proc = lazyGetPrcSeGdSpecEmbFlSave(pAddParam);
          } else if (pBeanName.equals(PrcSeGdSpecEmbFlDel
            .class.getSimpleName())) {
            proc = lazyGetPrcSeGdSpecEmbFlDel(pAddParam);
          } else if (pBeanName.equals(PrcSeSrvSpecEmbFlSave
            .class.getSimpleName())) {
            proc = lazyGetPrcSeSrvSpecEmbFlSave(pAddParam);
          } else if (pBeanName.equals(PrcSeSrvSpecEmbFlDel
            .class.getSimpleName())) {
            proc = lazyGetPrcSeSrvSpecEmbFlDel(pAddParam);
          } else {
            proc = this.fctBnEntitiesProcessors.lazyGet(pAddParam, pBeanName);
          }
        }
      }
    }
    if (proc == null) {
      throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
        "There is no processor with name " + pBeanName);
    }
    return proc;
  }
93920
@Override
    public <B> Lazy<LambdaIterable<B>> lazyZip(
            Lazy<? extends Applicative<Function<? super A, ? extends B>, LambdaIterable<?>>> lazyAppFn) {
        return Empty.empty(as)
               ? lazy(LambdaIterable.empty())
               : Monad.super.lazyZip(lazyAppFn).fmap(Monad<B, LambdaIterable<?>>::coerce);
    }
818883
@Override
  public final IConverter<?, ColumnsValues> 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 {
    IConverter<?, ColumnsValues> convrt =
      this.convertersMap.get(pBeanClass);
    if (convrt == null) {
      // locking:
      synchronized (this.convertersMap) {
        // make sure again whether it's null after locking:
        convrt = this.convertersMap.get(pBeanClass);
        if (convrt == null) {
          if (IHasVersion.class.isAssignableFrom(pBeanClass)) {
            convrt = lazyGetCnvHasVersionToColumnsValues(pBeanClass);
          } else {
            convrt = lazyGetCnvObjectToColumnsValues(pBeanClass);
          }
        }
      }
    }
    return convrt;
  }
1040666
protected void lazyor(final ImmutableRoaringBitmap x2) {
    int pos1 = 0, pos2 = 0;
    int length1 = highLowContainer.size();
    final int length2 = x2.highLowContainer.size();
    main: if (pos1 < length1 && pos2 < length2) {
      short s1 = highLowContainer.getKeyAtIndex(pos1);
      short s2 = x2.highLowContainer.getKeyAtIndex(pos2);

      while (true) {
        if (s1 == s2) {
          getMappeableRoaringArray().setContainerAtIndex(pos1, highLowContainer
              .getContainerAtIndex(pos1).lazyIOR(x2.highLowContainer.getContainerAtIndex(pos2)));
          pos1++;
          pos2++;
          if ((pos1 == length1) || (pos2 == length2)) {
            break main;
          }
          s1 = highLowContainer.getKeyAtIndex(pos1);
          s2 = x2.highLowContainer.getKeyAtIndex(pos2);
        } else if (Util.compareUnsigned(s1, s2) < 0) { // s1 < s2
          pos1++;
          if (pos1 == length1) {
            break main;
          }
          s1 = highLowContainer.getKeyAtIndex(pos1);
        } else { // s1 > s2
          getMappeableRoaringArray().insertNewKeyValueAt(pos1, s2,
              x2.highLowContainer.getContainerAtIndex(pos2).clone());
          pos1++;
          length1++;
          pos2++;
          if (pos2 == length2) {
            break main;
          }
          s2 = x2.highLowContainer.getKeyAtIndex(pos2);
        }
      }
    }
    if (pos1 == length1) {
      getMappeableRoaringArray().appendCopy(x2.highLowContainer, pos2, length2);
    }
  }
1281964
public function setApplication(Application $application = null)
    {
        parent::setApplication($application);

        if (!is_null($application)) {
            try {
                foreach($this->getContainer()->plugins as $plugin) {
                    if ($plugin instanceof PluginTaskListenerInterface) {
                        $name = implode('.', array_slice($this->getTaskReference(), 1));
                        $listeners = $plugin->getTaskListeners();
                        if (in_array($name, array_keys($listeners))) {
                            call_user_func_array(array($plugin, $listeners[$name]), array($this));
                        }
                    }
                }
            } catch (\UnexpectedValueException $e) {}
        }

    }
1085170
protected function lazyLoad($eventName)
    {
        parent::lazyLoad($eventName);

        if (isset($this->listenerIds[$eventName])) {
            foreach ($this->listenerIds[$eventName] as $args) {
                list($serviceId, $method, $priority, $queueName) = $args;
                if ($queueName != null) {
                    $listener = $this->container->get($serviceId);
                    $key = $serviceId.'.'.$method;
                    $this->listeners[$eventName][$key] = array($listener, $queueName);
                }
            }
        }
    }
1020466
synchronized void activateLazily() {
        if (cacheManager != null)
            return; // lazy initialization has already completed

        final boolean trace = TraceComponent.isAnyTracingEnabled();
        
        Properties vendorProperties = new Properties();
        
        String uriValue = (String) configurationProperties.get("uri");
        final URI uri;
        if (uriValue != null)
            try {
                uri = new URI(uriValue);
            } catch (URISyntaxException e) {
                throw new IllegalArgumentException(Tr.formatMessage(tc, "INCORRECT_URI_SYNTAX", e), e);
            }
        else
            uri = null;
        
        for (Map.Entry<String, Object> entry : configurationProperties.entrySet()) {
            String key = entry.getKey();
            Object value = entry.getValue();

            //properties start with properties.0.
            if (key.length () > TOTAL_PREFIX_LENGTH && key.charAt(BASE_PREFIX_LENGTH) == '.' && key.startsWith(BASE_PREFIX)) {
                key = key.substring(TOTAL_PREFIX_LENGTH);
                if (!key.equals("config.referenceType")) 
                    vendorProperties.setProperty(key, (String) value);
            }
        }

        // load JCache provider from configured library, which is either specified as a libraryRef or via a bell
        final ClassLoader cl = library.getClassLoader();

        try {
            AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
                ClassLoader loader = new CachingProviderClassLoader(cl);

                if (trace && tc.isDebugEnabled())
                    CacheHashMap.tcInvoke("Caching", "getCachingProvider", loader);

                cachingProvider = Caching.getCachingProvider(loader);

                tcCachingProvider = "CachingProvider" + Integer.toHexString(System.identityHashCode(cachingProvider));

                if (trace && tc.isDebugEnabled()) {
                    CacheHashMap.tcReturn("Caching", "getCachingProvider", tcCachingProvider, cachingProvider);
                    Tr.debug(this, tc, "caching provider class is " + cachingProvider.getClass().getName());
                    CacheHashMap.tcInvoke(tcCachingProvider, "getCacheManager", uri, null, vendorProperties);
                }

                cacheManager = cachingProvider.getCacheManager(uri, null, vendorProperties);

                return null;
            });

            tcCacheManager = "CacheManager" + Integer.toHexString(System.identityHashCode(cacheManager));

            if (trace && tc.isDebugEnabled()) {
                CacheHashMap.tcReturn(tcCachingProvider, "getCacheManager", tcCacheManager, cacheManager);
                CacheHashMap.tcInvoke(tcCachingProvider, "isSupported", "STORE_BY_REFERENCE");
            }

            supportsStoreByReference = cachingProvider.isSupported(OptionalFeature.STORE_BY_REFERENCE);

            if (trace && tc.isDebugEnabled())
                CacheHashMap.tcReturn(tcCachingProvider, "isSupported", supportsStoreByReference);
        } catch (CacheException x) {
            if (library.getFiles().isEmpty()) {
                Tr.error(tc, "ERROR_CONFIG_EMPTY_LIBRARY", library.id(), Tr.formatMessage(tc, "SESSION_CACHE_CONFIG_MESSAGE", RuntimeUpdateListenerImpl.sampleConfig));
            }
            throw x;
        } catch (Error | RuntimeException x) {
            // deactivate will not be invoked if activate fails, so ensure CachingProvider is closed on error paths
            if (cachingProvider != null) {
                CacheHashMap.tcInvoke(tcCachingProvider, "close");
                cachingProvider.close();
                CacheHashMap.tcReturn(tcCachingProvider, "close");
            }
            throw x;
        }
    }
952192
@Override
  public final void make(final Map<String, Object> pReqVars) throws Exception {
    @SuppressWarnings("unchecked")
    AFactoryAppBeans<RS> factoryAppBeans =
      (AFactoryAppBeans<RS>) this.factoryAndServlet.getFactoryAppBeans();
    this.factoryAndServlet.getHttpServlet().getServletContext()
      .setAttribute("srvI18n", factoryAppBeans.lazyGet("ISrvI18n"));
    String langCountriesStr = this.factoryAndServlet.getHttpServlet()
      .getInitParameter("langCountries");
    List<String> lngCntLst = new ArrayList<String>();
    for (String str : langCountriesStr.split(",")) {
      lngCntLst.add(str);
    }
    String[] lngCntArr = new String[lngCntLst.size()];
    factoryAppBeans.lazyGetSrvI18n().add(lngCntLst.toArray(lngCntArr));
    this.factoryAndServlet.getHttpServlet().getServletContext()
      .setAttribute("sessionTracker",
        factoryAppBeans.lazyGet("ISessionTracker"));
    HndlTradeVarsRequest<RS> hndlTradeVarsRequest =
      new HndlTradeVarsRequest<RS>();
    hndlTradeVarsRequest.setLogger(factoryAppBeans.lazyGetLogger());
    hndlTradeVarsRequest.setSrvDatabase(factoryAppBeans.lazyGetSrvDatabase());
    hndlTradeVarsRequest.setSrvOrm(factoryAppBeans.lazyGetSrvOrm());
    hndlTradeVarsRequest.setUtlTradeJsp((UtlTradeJsp)
      factoryAppBeans.lazyGet("utlTradeJsp"));
    hndlTradeVarsRequest.setSrvSettingsAdd((ISrvSettingsAdd)
      factoryAppBeans.lazyGet("ISrvSettingsAdd"));
    hndlTradeVarsRequest.setSrvTradingSettings((ISrvTradingSettings)
      factoryAppBeans.lazyGet("ISrvTradingSettings"));
    HndlAccVarsRequest<RS> hndlAccVarsRequest = new HndlAccVarsRequest<RS>();
    hndlAccVarsRequest.setAdditionalI18nReqHndl(hndlTradeVarsRequest);
    hndlAccVarsRequest.setLogger(factoryAppBeans.lazyGetLogger());
    hndlAccVarsRequest.setSrvDatabase(factoryAppBeans.lazyGetSrvDatabase());
    hndlAccVarsRequest.setSrvOrm(factoryAppBeans.lazyGetSrvOrm());
    hndlAccVarsRequest.setSrvAccSettings((ISrvAccSettings) factoryAppBeans
      .lazyGet("ISrvAccSettings"));
    factoryAppBeans.lazyGetHndlI18nRequest()
      .setAdditionalI18nReqHndl(hndlAccVarsRequest);
    ISrvDatabase<RS> srvDb = (ISrvDatabase<RS>)
      factoryAppBeans.lazyGet("ISrvDatabase");
    @SuppressWarnings("unchecked")
    SrvAddTheFirstUser<RS> srvAddFiU = (SrvAddTheFirstUser<RS>)
      this.factoryAndServlet.getHttpServlet().getServletContext()
        .getAttribute("srvAddTheFirstUser");
    srvAddFiU.setSrvDatabase(srvDb);
    srvAddFiU.setIsThereAnyUser(false);
    DataBaseLoginService srvDbl = (DataBaseLoginService)
      this.factoryAndServlet.getHttpServlet().getServletContext()
        .getAttribute("JDBCRealm");
    if (srvDbl != null) {
      @SuppressWarnings("unchecked")
      SrvGetUserCredentials<RS> srvCr = (SrvGetUserCredentials<RS>) srvDbl
        .getSrvGetUserCredentials();
      srvCr.setSrvDatabase(srvDb);
      srvDbl.getUsers().clear();
      LstnUserPswdChanged lstnUserPswdChanged = new LstnUserPswdChanged();
      lstnUserPswdChanged.setDbLoginService(srvDbl);
      this.factoryAndServlet.getHttpServlet().getServletContext()
        .setAttribute("ILstnUserPswdChanged", lstnUserPswdChanged);
    }
    //crypto init:
    CryptoHelper ch = (CryptoHelper) factoryAppBeans.lazyGet("ICryptoHelper");
    KeyStore ks = (KeyStore) this.factoryAndServlet.getHttpServlet()
      .getServletContext().getAttribute("ajettyKeystore");
    ch.setKeyStore(ks);
    String passw = (String) this.factoryAndServlet.getHttpServlet()
      .getServletContext().getAttribute("ksPassword");
    ch.setKsPassword(passw.toCharArray());
    Integer ajettyIn = (Integer) this.factoryAndServlet.getHttpServlet()
      .getServletContext().getAttribute("ajettyIn");
    ch.setAjettyIn(ajettyIn);
  }
1224540
public final MailSenderStd lazyGetMailSender() throws Exception {
    String beanName = getMailSenderName();
    MailSenderStd mailSender = (MailSenderStd) this.beansMap.get(beanName);
    if (mailSender == null) {
      mailSender = new MailSenderStd(lazyGetLogger());
      mailSender.setWebAppPath(this.webAppPath);
      this.beansMap.put(beanName, mailSender);
      lazyGetLogger().info(null, AFactoryAppBeans.class, beanName
        + " has been created.");
    }
    return mailSender;
  }
1084981
public static void lazyAppend(Element parent, Element child) {
        if (!parent.contains(child)) {
            parent.appendChild(child);
        }
    }
395406
protected function lazyCriterion(): void
	{
		$this->where($this->table . '.' . $this->getForeignKey(), '=', $this->parent->getPrimaryKeyValue());
	}
419222
private synchronized void lazyInit(HttpServletRequest request) throws IOException {
        List<File> files;
        URL url;
        long lastModified;
        long now;
        Resolver resolver;
        Node localhost;
        FileNode file;
        Object[] tmp;

        resolver = application.resolver;
        if (engine != null && resolver.isLife()) {
            for (Node node : reloadFiles) {
                lastModified = node.getLastModified();
                if (lastModified > loaded) {
                    now = System.currentTimeMillis();
                    if (lastModified > now) {
                        // fail to avoid repeated re-init
                        throw new IOException(node.getUri() + " has lastModifiedDate in the future: "
                                + new Date(lastModified) + "(now: " + new Date(now) + ")");
                    }
                    LOG.info("reloading jasmin for application '" + application.getContextPath() + "' - changed file: " + node);
                    engine = null;
                    resolver.reset();
                }
            }
        }
        if (engine == null) {
            url = new URL(request.getRequestURL().toString());
            try {
                localhost = resolver.getWorld().node(new URI(url.getProtocol(), null, url.getHost(), url.getPort(), "", null, null));
            } catch (URISyntaxException e) {
                throw new IllegalStateException(e);
            }
            tmp = application.createEngine(docroot, localhost);
            engine = (Engine) tmp[0];
            LOG.info("started engine, initial url=" + url);
            for (Module module : engine.repository.modules()) {
                files = module.files();
                if (files.size() > 2) {
                    LOG.warn("deprecated: module '" + module.getName() + "' contains more than 2 file: " + files);
                }
                for (File f : files) {
                    if (f.getNormal() instanceof HttpNode) {
                        LOG.warn("deprecated: module '" + module.getName() + "' uses base LOCALHOST: " + f.getNormal().getUri());
                    }
                }
            }
            if (resolver.isLife()) {
                reloadFiles = (List<Node>) tmp[1];
                file = resolver.getLiveXml();
                if (file != null) {
                    reloadFiles.add(file);
                }
                LOG.info("reload if one of these " + reloadFiles.size() + " files is modified: ");
                for (Node node : reloadFiles) {
                    LOG.info("  " + node.getUri());
                }
                loaded = System.currentTimeMillis();
            }
            if (engine == null) {
                throw new IllegalStateException();
            }
        }
    }