public static <O> SingletonSupplier<O> of(Supplier<O> supplier) { return of(supplier, true); }
public SqlScriptConsumer build() { return new SqlScriptConsumer(SingletonSupplier.of(source::build), batchSize, blobsContainers.build()); } }
public SqlScriptReader build() { if (source != null) { InputStream stream = source.get(); try { if (gzip) { stream = new GZIPInputStream(this.source.get()); } } catch (IOException e) { throw new IllegalStateException("Can't get gzip input stream", e); } InputStream finalStream = stream; return new SqlScriptReader(SingletonSupplier.of(() -> new BufferedReader(new InputStreamReader(finalStream, encoding))), skipComment, skipTrim, gzip); } return new SqlScriptReader(sourceReader, skipComment, skipTrim, gzip); } }
private ApplicationBoot(ApplicationBootInitializer<Config, Context> initializer) { this.initializer = initializer; this.initializer.initOnce(); this.configuration = SingletonSupplier.of(() -> this.initializer.createConfiguration(this)); this.context = SingletonSupplier.of(() -> this.initializer.createContext(this, getConfiguration())); this.threadFactory = SingletonSupplier.of(ApplicationThreadFactory::new); this.executor = SingletonSupplier.of(() -> this.initializer.createExecutor(this, getConfiguration(), getContext())); INSTANCE = this; }