private ServiceContainer register() { Runtime.getRuntime().addShutdownHook(this); synchronized (this) { if (!down) { container = ServiceContainer.Factory.create("host-controller", false); return container; } else { throw new IllegalStateException(); } } }
private static int calculateCoreSize() { int cpuCount = Runtime.getRuntime().availableProcessors(); return calculateCoreSize(Math.max(cpuCount << 1, 2)); }
ServiceContainer container = ServiceContainer.Factory.create("subsystem-test" + (legacyModelVersion != null ? "-legacy-" : "-") + counter.incrementAndGet()); ServiceTarget target = container.subTarget(); List<ModelNode> extraOps = controllerInitializer.initializeBootOperations();
ServiceContainer container = ServiceContainer.Factory.create("subsystem-test" + (legacyModelVersion != null ? "-legacy-" : "-") + counter.incrementAndGet()); ServiceTarget target = container.subTarget(); List<ModelNode> extraOps = controllerInitializer.initializeBootOperations();
ServiceContainer container = ServiceContainer.Factory.create("core-test" + counter.incrementAndGet()); ServiceTarget target = container.subTarget();
ServiceContainer container = ServiceContainer.Factory.create("core-test" + counter.incrementAndGet()); ServiceTarget target = container.subTarget();
ServiceContainer container = ServiceContainer.Factory.create("test" + counter.incrementAndGet()); ServiceTarget target = container.subTarget(); List<ModelNode> extraOps = controllerInitializer.initializeBootOperations();
/** * Create a new instance with a given name and specified initial thread pool settings. The core and maximum pool * size will be the same. * * @param name the name of the new container * @param poolSize the thread pool size (must be greater than zero) * @param keepAliveTime the amount of time that non-core threads should linger without tasks * @param keepAliveTimeUnit the time unit for {@code keepAliveTime} * @param autoShutdown {@code true} to automatically shut down the container at VM exit, {@code false} otherwise * @return a new service container instance */ public static ServiceContainer create(String name, int poolSize, long keepAliveTime, TimeUnit keepAliveTimeUnit, boolean autoShutdown) { return create(name, poolSize, poolSize, keepAliveTime, keepAliveTimeUnit, autoShutdown); }
private LiveOakFactory(File configDir, File applicationsDir, Vertx vertx, String bindAddress) { this(configDir, applicationsDir, vertx, bindAddress, ServiceContainer.Factory.create()); }
/** * Create a new instance with a given name and specified initial thread pool settings. * * * @param name the name of the new container * @param coreSize the core pool size (must be greater than zero) * @param maxSize the maximum pool size (must be greater than zero) * @param keepAliveTime the amount of time that non-core threads should linger without tasks * @param keepAliveTimeUnit the time unit for {@code keepAliveTime} * @return a new service container instance */ public static ServiceContainer create(String name, int coreSize, int maxSize, long keepAliveTime, TimeUnit keepAliveTimeUnit) { return create(name, coreSize, maxSize, keepAliveTime, keepAliveTimeUnit, true); }
/** * Create a new instance with a given name and specified initial thread pool settings. * * * @param name the name of the new container * @param coreSize the core pool size (must be greater than zero) * @param keepAliveTime the amount of time that non-core threads should linger without tasks * @param keepAliveTimeUnit the time unit for {@code keepAliveTime} * @param autoShutdown {@code true} to automatically shut down the container at VM exit, {@code false} otherwise * @return a new service container instance */ public static ServiceContainer create(String name, int coreSize, long keepAliveTime, TimeUnit keepAliveTimeUnit, boolean autoShutdown) { return new ServiceContainerImpl(name, calculateCoreSize(coreSize), keepAliveTime, keepAliveTimeUnit, autoShutdown); }
/** * Create a new instance with a given name and specified initial thread pool settings. * * @param name the name of the new container * @param poolSize the thread pool size (must be greater than zero) * @param keepAliveTime the amount of time that non-core threads should linger without tasks * @param keepAliveTimeUnit the time unit for {@code keepAliveTime} * @return a new service container instance */ public static ServiceContainer create(String name, int poolSize, long keepAliveTime, TimeUnit keepAliveTimeUnit) { return create(name, poolSize, poolSize, keepAliveTime, keepAliveTimeUnit, true); }
/** * Create a new instance with a generated name and specified initial thread pool settings. * * @param poolSize the thread pool size (must be greater than zero) * @param keepAliveTime the amount of time that non-core threads should linger without tasks * @param keepAliveTimeUnit the time unit for {@code keepAliveTime} * @return a new service container instance */ public static ServiceContainer create(int poolSize, long keepAliveTime, TimeUnit keepAliveTimeUnit) { return create(null, poolSize, poolSize, keepAliveTime, keepAliveTimeUnit, true); }
/** * Create a new instance with a given name and default thread pool. * * @param name the name of the new container * @param autoShutdown {@code true} to automatically shut down the container at VM exit, {@code false} otherwise * @return a new service container instance */ public static ServiceContainer create(String name, boolean autoShutdown) { return create(name, CORE_THREADS_COUNT, MAX_THREADS_COUNT, 30L, TimeUnit.SECONDS, autoShutdown); }
/** * Create a new instance with a generated name and default thread pool. * * @param autoShutdown {@code true} to automatically shut down the container at VM exit, {@code false} otherwise * @return a new service container instance */ public static ServiceContainer create(boolean autoShutdown) { return create(null, CORE_THREADS_COUNT, MAX_THREADS_COUNT, 30L, TimeUnit.SECONDS, autoShutdown); }
/** * Create a new instance with a given name and specified initial thread pool settings. * * * @param name the name of the new container * @param coreSize the core pool size (must be greater than zero) * @param keepAliveTime the amount of time that non-core threads should linger without tasks * @param keepAliveTimeUnit the time unit for {@code keepAliveTime} * @return a new service container instance */ public static ServiceContainer create(String name, int coreSize, long keepAliveTime, TimeUnit keepAliveTimeUnit) { return new ServiceContainerImpl(name, calculateCoreSize(coreSize), keepAliveTime, keepAliveTimeUnit, true); }
/** * Create a new instance with a generated name and specified initial thread pool settings. * * @param poolSize the thread pool size (must be greater than zero) * @param keepAliveTime the amount of time that non-core threads should linger without tasks * @param keepAliveTimeUnit the time unit for {@code keepAliveTime} * @param autoShutdown {@code true} to automatically shut down the container at VM exit, {@code false} otherwise * @return a new service container instance */ public static ServiceContainer create(int poolSize, long keepAliveTime, TimeUnit keepAliveTimeUnit, boolean autoShutdown) { return create(null, poolSize, poolSize, keepAliveTime, keepAliveTimeUnit, autoShutdown); }
private ServiceContainer register() { Runtime.getRuntime().addShutdownHook(this); synchronized (this) { if (!down) { container = ServiceContainer.Factory.create("host-controller", false); return container; } else { throw new IllegalStateException(); } } }
/** * Create a new instance with a generated name and specified initial thread pool settings. * * * @param coreSize the core pool size (must be greater than zero) * @param keepAliveTime the amount of time that non-core threads should linger without tasks * @param keepAliveTimeUnit the time unit for {@code keepAliveTime} * @param autoShutdown {@code true} to automatically shut down the container at VM exit, {@code false} otherwise * @return a new service container instance */ public static ServiceContainer create(int coreSize, long keepAliveTime, TimeUnit keepAliveTimeUnit, boolean autoShutdown) { return new ServiceContainerImpl(null, calculateCoreSize(coreSize), keepAliveTime, keepAliveTimeUnit, autoShutdown); }
private ServiceContainer register() { Runtime.getRuntime().addShutdownHook(this); synchronized (this) { if (!down) { container = ServiceContainer.Factory.create("host-controller", false); return container; } else { throw new IllegalStateException(); } } }