/** * Process the instance file if this is DAS and there are instances configured already in this domain */ @Override public void postConstruct() { // If this is not the DAS, no need for this pool if(serverEnv.isInstance()) { return; } int poolSize = 5; Config svrConfig = domain.getConfigNamed("server-config"); // I am doing this code instead of a simple svrConfig.getAdminListener() here because embedded tests are failing // during build; got to check the reason why later. if(svrConfig != null) { NetworkConfig nwc = svrConfig.getNetworkConfig(); if (nwc != null) { List<NetworkListener> lss = nwc.getNetworkListeners().getNetworkListener(); if ( (lss != null) && (!lss.isEmpty()) ) { for (NetworkListener ls : lss) { if (ServerTags.ADMIN_LISTENER_ID.equals(ls.getName())) { if(ls.findThreadPool() != null) { poolSize = Integer.valueOf(ls.findThreadPool().getMaxThreadPoolSize()); } } } } } } svc = Executors.newFixedThreadPool(poolSize, new InstanceStateThreadFactory()); }
/** * Process the instance file if this is DAS and there are instances configured already in this domain */ @Override public void postConstruct() { // If this is not the DAS, no need for this pool if(serverEnv.isInstance()) { return; } int poolSize = 5; Config svrConfig = domain.getConfigNamed("server-config"); // I am doing this code instead of a simple svrConfig.getAdminListener() here because embedded tests are failing // during build; got to check the reason why later. if(svrConfig != null) { NetworkConfig nwc = svrConfig.getNetworkConfig(); if (nwc != null) { List<NetworkListener> lss = nwc.getNetworkListeners().getNetworkListener(); if ( (lss != null) && (!lss.isEmpty()) ) { for (NetworkListener ls : lss) { if (ServerTags.ADMIN_LISTENER_ID.equals(ls.getName())) { if(ls.findThreadPool() != null) { poolSize = Integer.parseInt(ls.findThreadPool().getMaxThreadPoolSize()); } } } } } } svc = Executors.newFixedThreadPool(poolSize, new InstanceStateThreadFactory()); }