001/*
002 * jPOS Project [http://jpos.org]
003 * Copyright (C) 2000-2026 jPOS Software SRL
004 *
005 * This program is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU Affero General Public License as
007 * published by the Free Software Foundation, either version 3 of the
008 * License, or (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013 * GNU Affero General Public License for more details.
014 *
015 * You should have received a copy of the GNU Affero General Public License
016 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
017 */
018
019package org.jpos.q2.qbean;
020
021import org.jpos.util.NameRegistrar.NotFoundException;
022
023/**
024 * @author dgrandemange
025 * 
026 */
027public interface QThreadPoolExecutorMBean extends org.jpos.q2.QBeanSupportMBean {
028    /**
029     * @return executor service type
030     */
031    String getExecSrvType();
032
033    /**
034     * @return await termination delay
035     */
036    int getTerminationTimer();
037
038    /**
039     * @return approximate number of threads that are actively executing tasks
040     */
041    int getActiveCount() throws NotFoundException;
042
043    /**
044     * @return the approximate total number of tasks that have completed
045     *         execution.
046     */
047    long getCompletedTaskCount() throws NotFoundException;
048
049    /**
050     * @return returns the core number of threads.
051     */
052    int getCorePoolSize() throws NotFoundException;
053
054    /**
055     * @return the thread keep-alive time, which is the amount of time (in
056     *         milliseconds) which threads in excess of the core pool size may
057     *         remain idle before being terminated
058     */
059    long getKeepAliveTimeMS() throws NotFoundException;
060
061    /**
062     * @return the largest number of threads that have ever simultaneously been
063     *         in the pool.
064     */
065    int getLargestPoolSize() throws NotFoundException;
066
067    /**
068     * @return the maximum allowed number of threads.
069     */
070    int getMaximumPoolSize() throws NotFoundException;
071
072    /**
073     * @return the current number of threads in the pool.
074     */
075    int getPoolSize() throws NotFoundException;
076
077    /**
078     * @return the approximate total number of tasks that have been scheduled
079     *         for execution
080     */
081    long getTaskCount() throws NotFoundException;
082
083    /**
084     * @return true if this executor has been shut down.
085     * @throws NotFoundException
086     */
087    boolean isShutdown() throws NotFoundException;
088
089    /**
090     * @return true if all tasks have completed following shut down
091     * @throws NotFoundException
092     */
093    boolean isTerminated() throws NotFoundException;
094
095    /**
096     * @return true if this executor is in the process of terminating after
097     *         shutdown or shutdownNow but has not completely terminated.
098     */
099    boolean isTerminating() throws NotFoundException;
100}