/*
 * JBoss, Home of Professional Open Source
 * Copyright 2009, Red Hat Middleware LLC, and individual contributors
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.jboss.managed.plugins.jmx;

import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;

import org.jboss.managed.api.annotation.ManagementComponent;
import org.jboss.managed.api.annotation.ManagementObject;
import org.jboss.managed.api.annotation.ManagementOperation;
import org.jboss.managed.api.annotation.ManagementProperty;

/**
 * Stub class for the ThreadMXBean interface that is marked up with
 * management annotations.
 * 
 * @author Scott.Stark@jboss.org
 * @version $Revision:$
 */
@ManagementObject(name=ManagementFactory.THREAD_MXBEAN_NAME,
      isRuntime=true,
      componentType=@ManagementComponent(type="MBean", subtype="Platform"),
      targetInterface=ThreadMXBean.class)
public class ThreadMXBeanMO implements ThreadMXBean
{
   @ManagementOperation(description="an array of IDs of the threads that are monitor deadlocked, if any; null otherwise.")
   public long[] findMonitorDeadlockedThreads()
   {
      return null;
   }

   @ManagementProperty(description="an array of long, each is a thread ID.")
   public long[] getAllThreadIds()
   {
      return null;
   }

   @ManagementProperty(description="the user-level CPU time for the current thread if CPU time measurement is enabled; -1 otherwise")
   public long getCurrentThreadCpuTime()
   {
      return 0;
   }

   @ManagementProperty(description="the total CPU time for the current thread if CPU time measurement is enabled; -1 otherwise")
   public long getCurrentThreadUserTime()
   {
      return 0;
   }

   @ManagementProperty(description="the current number of live daemon threads.")
   public int getDaemonThreadCount()
   {
      return 0;
   }

   @ManagementProperty(description="the peak live thread count.")
   public int getPeakThreadCount()
   {
      return 0;
   }

   @ManagementProperty(description="the current number of live threads.")
   public int getThreadCount()
   {
      return 0;
   }

   @ManagementOperation(description="the total CPU time for a thread of the"
      + "specified ID if the thread of the specified ID exists, the thread is "
      + " alive, and CPU time measurement is enabled; -1</tt> otherwise.")
   public long getThreadCpuTime(long id)
   {
      return 0;
   }

   @ManagementOperation(description="a ThreadInfo object for the thread "
      + "of the given ID with no stack trace; null</tt> if the thread of the "
      + "given ID is not alive or it does not exist.")
   public ThreadInfo getThreadInfo(long id)
   {
      return null;
   }

   @ManagementOperation(description="an array of the ThreadInfo objects, "
      + "each containing information about a thread whose ID is in the "
      + "corresponding element of the input array of IDs.")
   public ThreadInfo[] getThreadInfo(long[] ids)
   {
      return null;
   }

   @ManagementOperation(description="a ThreadInfo of the thread of the given ID. "
     + "null if the thread of the given ID is not alive or it does not exist.")
   public ThreadInfo getThreadInfo(long id, int maxDepth)
   {
      return null;
   }

   @ManagementOperation(description="an array of the ThreadInfo objects, each "
      +"containing information about a thread whose ID is in the corresponding"
      +"element of the input array of IDs.")
   public ThreadInfo[] getThreadInfo(long[] ids, int maxDepth)
   {
      return null;
   }

   @ManagementOperation(description="the user-level CPU time for a thread of the "
      +"specified ID if the thread of the specified ID exists, the thread is "
      +"alive, and CPU time measurement is enabled; -1</tt> otherwise.")
   public long getThreadUserTime(long id)
   {
      return 0;
   }

   @ManagementProperty(description="the total number of threads started.")
   public long getTotalStartedThreadCount()
   {
      return 0;
   }

   @ManagementProperty(description="true if the Java virtual machine supports "
      +"CPU time measurement for current thread; false</tt> otherwise.")
   public boolean isCurrentThreadCpuTimeSupported()
   {
      return false;
   }

   @ManagementProperty(description="true if thread contention monitoring is enabled; false</tt> otherwise.")
   public boolean isThreadContentionMonitoringEnabled()
   {
      return false;
   }

   @ManagementProperty(description="true if the Java virtual machine supports thread contention monitoring; false</tt> otherwise.")
   public boolean isThreadContentionMonitoringSupported()
   {
      return false;
   }

   @ManagementProperty(description="true if thread CPU time measurement is enabled; false</tt> otherwise.")
   public boolean isThreadCpuTimeEnabled()
   {
      return false;
   }

   @ManagementProperty(description="true if the Java virtual machine supports CPU time measurement for any thread;; false</tt> otherwise.")
   public boolean isThreadCpuTimeSupported()
   {
      return false;
   }

   @ManagementOperation(description="Resets the peak thread count to the current number of live threads.")
   public void resetPeakThreadCount()
   {
   }

   public void setThreadContentionMonitoringEnabled(boolean enable)
   {
   }

   public void setThreadCpuTimeEnabled(boolean enable)
   {
   }

   @ManagementOperation(description="an array of IDs of the threads that are deadlocked, if any; null otherwise.")
   public long[] findDeadlockedThreads()
   {
      return null;
   }

   @ManagementProperty(description="true if the object monitor usage is supported; false</tt> otherwise.")
   public boolean isObjectMonitorUsageSupported()
   {
      return false;
   }

   @ManagementProperty(description="true if the synchronizer usage is supported; false</tt> otherwise.")
   public boolean isSynchronizerUsageSupported()
   {
      return false;
   }

   @ManagementOperation(description="TODO - description")
   public ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers)
   {
      return null;
   }

   @ManagementOperation(description="TODO - description")
   public ThreadInfo[] dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers)
   {
      return null;
   }
}
