/** * 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 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 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 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 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; } }
@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; }