@Override public boolean preAuthorization(AdminCommandContext context) { config = CLIUtil.updateConfigIfNeeded(config, target, habitat); threadPools = config.getThreadPools(); return true; }
private void ensureAdminThreadPool() throws TransactionFailure { final ThreadPools threadPools = currentConfig.getThreadPools(); boolean adminThreadPoolFound = false; for (ThreadPool pool : threadPools.getThreadPool()) { adminThreadPoolFound |= "admin-thread-pool".equals(pool.getName()); } if (!adminThreadPoolFound) { ConfigSupport.apply(new SingleConfigCode<ThreadPools>() { @Override public Object run(ThreadPools param) throws PropertyVetoException, TransactionFailure { final ThreadPool pool = param.createChild(ThreadPool.class); param.getThreadPool().add(pool); pool.setName("admin-thread-pool"); pool.setMaxThreadPoolSize("50"); pool.setMaxQueueSize("256"); return null; } }, threadPools); } }
private void ensureAdminThreadPool() throws TransactionFailure { final ThreadPools threadPools = currentConfig.getThreadPools(); boolean adminThreadPoolFound = false; for (ThreadPool pool : threadPools.getThreadPool()) { adminThreadPoolFound |= "admin-thread-pool".equals(pool.getName()); } if (!adminThreadPoolFound) { ConfigSupport.apply(new SingleConfigCode<ThreadPools>() { @Override public Object run(ThreadPools param) throws PropertyVetoException, TransactionFailure { final ThreadPool pool = param.createChild(ThreadPool.class); param.getThreadPool().add(pool); pool.setName("admin-thread-pool"); pool.setMaxThreadPoolSize("50"); pool.setMaxQueueSize("256"); return null; } }, threadPools); } }
private void updateThreadPool(NetworkConfig config, final ConnectionPool pool) throws TransactionFailure { final Config parent = config.getParent(Config.class); for (ThreadPool threadPool : parent.getThreadPools().getThreadPool()) { ConfigSupport.apply(new SingleConfigCode<ThreadPool>() { @Override public Object run(ThreadPool param) { param.setMaxQueueSize(pool.getQueueSizeInBytes()); if (param.getMinThreadPoolSize() == null || Integer.parseInt(param.getMinThreadPoolSize()) < 2) { param.setMinThreadPoolSize("2"); } return null; } }, threadPool); } } }
public void postConstruct() { processType = processEnv.getProcessType(); if( processEnv.getProcessType().isServer()) { iiopService = habitat.getComponent(IiopService.class); final Collection<ThreadPool> threadPool = iiopService.getParent(Config.class).getThreadPools().getThreadPool(); final Collection<NetworkListener> listeners = habitat.getAllByContract(NetworkListener.class); final Set<String> names = new TreeSet<String>(); threadPools = new ArrayList<ThreadPool>(); for (NetworkListener listener : listeners) { names.add(listener.getThreadPool()); } for (ThreadPool pool : threadPool) { if(!names.contains(pool.getName())) { threadPools.add(pool); } } serverRefs = habitat.getAllByContract(ServerRef.class); configs = habitat.getComponent(Configs.class); } IIOPUtils.initMe(this); }
@Override public boolean preAuthorization(AdminCommandContext context) { config = CLIUtil.updateConfigIfNeeded(config, target, habitat); threadPools = config.getThreadPools(); for (ThreadPool pool: threadPools.getThreadPool()) { final ActionReport report = context.getActionReport(); if (pool.getName().equals(threadpool_id)) { report.setMessage(localStrings.getLocalString("create.threadpool.duplicate", "Thread Pool named {0} already exists.", threadpool_id)); report.setActionExitCode(ActionReport.ExitCode.FAILURE); return false; } } return true; }
final ActionReport report = context.getActionReport(); config = CLIUtil.updateConfigIfNeeded(config, target, habitat); threadPools = config.getThreadPools(); if(!isThreadPoolExists(threadPools)) { report.setMessage(localStrings.getLocalString("delete.threadpool.notexists", for (ThreadPool tp : config.getThreadPools().getThreadPool()) { if (tp.getName().equals(threadpool_id)) { pool = tp;
private void normalizeThreadPools() throws TransactionFailure { ThreadPools threadPools = currentConfig.getThreadPools(); if (threadPools == null) { threadPools = createThreadPools();
private void normalizeThreadPools() throws TransactionFailure { ThreadPools threadPools = currentConfig.getThreadPools(); if (threadPools == null) { threadPools = createThreadPools();
public static void addIndex(Config c, ServiceLocator habitat, String name) { ServiceLocatorUtilities.addOneDescriptor(habitat, BuilderHelper.createConstantDescriptor(c, name, Config.class)); // directly referenced objects ConfigBeanProxy dirref[] = { c.getAdminService(), c.getAvailabilityService(), c.getDiagnosticService(), c.getHttpService(), c.getJavaConfig(), c.getLogService(), c.getNetworkConfig(), c.getSecurityService(), c.getThreadPools(), c.getMonitoringService(), }; for (ConfigBeanProxy cbp : dirref) { if (cbp != null) { ServiceLocatorUtilities.addOneDescriptor(habitat, BuilderHelper.createConstantDescriptor(cbp, name, ConfigSupport.getImpl(cbp).getProxyType())); } } // containers for (Container extension : c.getContainers()) { ServiceLocatorUtilities.addOneDescriptor(habitat, BuilderHelper.createConstantDescriptor(extension, name, ConfigSupport.getImpl(extension).getProxyType())); } }