protected int getMaxThreadsExecutor(boolean useExecutor) { if (useExecutor && executor != null) { if (executor instanceof java.util.concurrent.ThreadPoolExecutor) { return ((java.util.concurrent.ThreadPoolExecutor)executor).getMaximumPoolSize(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor)executor).getMaxThreads(); } else { return -1; } } else { return maxThreads; } }
public void setMinSpareThreads(int minSpareThreads) { this.minSpareThreads = minSpareThreads; if (running && executor!=null) { if (executor instanceof java.util.concurrent.ThreadPoolExecutor) { ((java.util.concurrent.ThreadPoolExecutor)executor).setCorePoolSize(minSpareThreads); } else if (executor instanceof ResizableExecutor) { ((ResizableExecutor)executor).resizePool(minSpareThreads, maxThreads); } } }
/** * Return the amount of threads that are in use * * @return the amount of threads that are in use */ public int getCurrentThreadsBusy() { if (executor!=null) { if (executor instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor)executor).getActiveCount(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor)executor).getActiveCount(); } else { return -1; } } else { return -2; } }
/** * Return the amount of threads that are managed by the pool. * * @return the amount of threads that are managed by the pool */ public int getCurrentThreadCount() { if (executor!=null) { if (executor instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor)executor).getPoolSize(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor)executor).getPoolSize(); } else { return -1; } } else { return -2; } }
/** * Return the amount of threads that are in use * * @return the amount of threads that are in use */ public int getCurrentThreadsBusy() { if (executor!=null) { if (executor instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor)executor).getActiveCount(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor)executor).getActiveCount(); } else { return -1; } } else { return -2; } }
/** * Return the amount of threads that are managed by the pool. * * @return the amount of threads that are managed by the pool */ public int getCurrentThreadCount() { if (executor!=null) { if (executor instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor)executor).getPoolSize(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor)executor).getPoolSize(); } else { return -1; } } else { return -2; } }
/** * Return the amount of threads that are in use * * @return the amount of threads that are in use */ public int getCurrentThreadsBusy() { if (executor!=null) { if (executor instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor)executor).getActiveCount(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor)executor).getActiveCount(); } else { return -1; } } else { return -2; } }
public void setMinSpareThreads(int minSpareThreads) { this.minSpareThreads = minSpareThreads; if (running && executor!=null) { if (executor instanceof java.util.concurrent.ThreadPoolExecutor) { ((java.util.concurrent.ThreadPoolExecutor)executor).setCorePoolSize(minSpareThreads); } else if (executor instanceof ResizableExecutor) { ((ResizableExecutor)executor).resizePool(minSpareThreads, maxThreads); } } }
public int getMaxThreads() { if (running && executor!=null) { if (executor instanceof java.util.concurrent.ThreadPoolExecutor) { return ((java.util.concurrent.ThreadPoolExecutor)executor).getMaximumPoolSize(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor)executor).getMaxThreads(); } else { return -1; } } else { return maxThreads; } }
/** * Return the amount of threads that are managed by the pool. * * @return the amount of threads that are managed by the pool */ public int getCurrentThreadCount() { if (executor!=null) { if (executor instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor)executor).getPoolSize(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor)executor).getPoolSize(); } else { return -1; } } else { return -2; } }
/** * Return the amount of threads that are in use * * @return the amount of threads that are in use */ public int getCurrentThreadsBusy() { if (executor!=null) { if (executor instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor)executor).getActiveCount(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor)executor).getActiveCount(); } else { return -1; } } else { return -2; } }
public void setMinSpareThreads(int minSpareThreads) { this.minSpareThreads = minSpareThreads; if (running && executor!=null) { if (executor instanceof java.util.concurrent.ThreadPoolExecutor) { ((java.util.concurrent.ThreadPoolExecutor)executor).setCorePoolSize(minSpareThreads); } else if (executor instanceof ResizableExecutor) { ((ResizableExecutor)executor).resizePool(minSpareThreads, maxThreads); } } }
protected int getMaxThreadsExecutor(boolean useExecutor) { if (useExecutor && executor != null) { if (executor instanceof java.util.concurrent.ThreadPoolExecutor) { return ((java.util.concurrent.ThreadPoolExecutor)executor).getMaximumPoolSize(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor)executor).getMaxThreads(); } else { return -1; } } else { return maxThreads; } }
/** * Return the amount of threads that are managed by the pool. * * @return the amount of threads that are managed by the pool */ public int getCurrentThreadCount() { if (executor!=null) { if (executor instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor)executor).getPoolSize(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor)executor).getPoolSize(); } else { return -1; } } else { return -2; } }
/** * Return the amount of threads that are in use * * @return the amount of threads that are in use */ public int getCurrentThreadsBusy() { Executor executor = this.executor; if (executor != null) { if (executor instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor) executor).getActiveCount(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor) executor).getActiveCount(); } else { return -1; } } else { return -2; } }
public void setMinSpareThreads(int minSpareThreads) { this.minSpareThreads = minSpareThreads; if (running && executor!=null) { if (executor instanceof java.util.concurrent.ThreadPoolExecutor) { ((java.util.concurrent.ThreadPoolExecutor)executor).setCorePoolSize(minSpareThreads); } else if (executor instanceof ResizableExecutor) { ((ResizableExecutor)executor).resizePool(minSpareThreads, maxThreads); } } }
public int getMaxThreads() { if (running && executor!=null) { if (executor instanceof java.util.concurrent.ThreadPoolExecutor) { return ((java.util.concurrent.ThreadPoolExecutor)executor).getMaximumPoolSize(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor)executor).getMaxThreads(); } else { return -1; } } else { return maxThreads; } }
/** * Return the amount of threads that are managed by the pool. * * @return the amount of threads that are managed by the pool */ public int getCurrentThreadCount() { Executor executor = this.executor; if (executor != null) { if (executor instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor) executor).getPoolSize(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor) executor).getPoolSize(); } else { return -1; } } else { return -2; } }
@Override public int getBusyThreads() { Executor executor = this.connector.getProtocolHandler().getExecutor(); if (executor != null) { if (executor instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor) executor).getActiveCount(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor) executor).getActiveCount(); } } return 0; }
public void setMaxThreads(int maxThreads) { this.maxThreads = maxThreads; if (running && executor!=null) { if (executor instanceof java.util.concurrent.ThreadPoolExecutor) { ((java.util.concurrent.ThreadPoolExecutor)executor).setMaximumPoolSize(maxThreads); } else if (executor instanceof ResizableExecutor) { ((ResizableExecutor)executor).resizePool(minSpareThreads, maxThreads); } } } public int getMaxThreads() {