protected HttpClient getOrCreateClient() { return client.get(); }
HttpManagedHandlerDecorator(AbstractDecoratingHttpHandler handler, final FastHttp http, final RouteOptions options) { super(handler, http); this.options = options; this.wrappers = new LazyInit<>(() -> HttpWrappers.assembleWrappers(http, options)); }
public HttpClient client() { return client.getValue(); }
public void setArgs(String... args) { this.args = Coll.synchronizedList(args); this.argsView = Collections.unmodifiableList(this.args); this.argsAsMap.reset(); }
public synchronized void shutdownNow() { active.set(false); if (executor.isInitialized()) { Opt<ThreadPoolExecutor> exe = executor(); if (exe.exists()) { exe.get().shutdownNow(); Jobs.awaitTermination(exe.get()); } } if (scheduler.isInitialized()) { Opt<ScheduledThreadPoolExecutor> sch = scheduler(); if (sch.exists()) { sch.get().shutdownNow(); Jobs.awaitTermination(sch.get()); } } }
public synchronized void reset() { errorCounter.set(0); executor.resetAndClose(); scheduler.resetAndClose(); active.set(true); }
public T client(HttpClient client) { this.client.setValue(client); return me(); }
public synchronized void reset() { profiles = null; mode = null; argsAsMap.reset(); setArgs(); // no args }
public synchronized void shutdown() { active.set(false); if (executor.isInitialized()) { Opt<ThreadPoolExecutor> exe = executor(); if (exe.exists()) { exe.get().shutdown(); Jobs.awaitTermination(exe.get()); } } if (scheduler.isInitialized()) { Opt<ScheduledThreadPoolExecutor> sch = scheduler(); if (sch.exists()) { sch.get().shutdown(); Jobs.awaitTermination(sch.get()); } } }
public synchronized void close() { try { client.resetAndClose(); } catch (Exception e) { Log.error("Error while closing the HTTP client!", e); } }
public T client(HttpClient client) { this.client.setValue(client); return me(); }
public static synchronized Setup setup() { return setup.get(); }
static void initDefaults() { DefaultSetup defaultSetup = DEFAULT.getValue(); if (defaultSetup != null) { defaultSetup.initDefaults(); } }
public void reset() { http().resetConfig(); listening = false; reloaded = false; port = null; lazyHttp.reset(); address = null; processor = null; activated = false; ioCContext.reset(); server = null; autoActivating = !isAppSetupAtomic(); defaults = new RouteOptions(); defaults().zone(zone); if (isApp()) { AppInfo.isAppServerActive = false; AppInfo.appPort = 0; } if (isAdmin()) { AppInfo.isAdminServerActive = false; AppInfo.adminPort = 0; } bootstrappedBeans.reset(); initDefaults(); }
private FastHttp initHttp() { if (isAdminAndSameAsApp() && on().lazyHttp.isInitialized()) { return on().http(); } else if (isAppAndSameAsAdmin() && admin().lazyHttp.isInitialized()) { return admin().http(); } if (isAppOrAdminOnSameServer()) { U.must(on().routes == admin().routes); return new FastHttp(on().routes, on().serverConfig); } else { return new FastHttp(routes, serverConfig); } }
HttpManagedHandlerDecorator(AbstractDecoratingHttpHandler handler, final FastHttp http, final RouteOptions options) { super(handler, http); this.options = options; this.wrappers = new LazyInit<>(new Callable<HttpWrapper[]>() { @Override public HttpWrapper[] call() { return HttpWrappers.assembleWrappers(http, options); } }); }
public static Setup main() { return DEFAULT.get().main; }
public HttpClient client() { return client.getValue(); }
public Map<String, String> argsAsMap() { RapidoidEnv.touch(); return argsAsMap.get(); }