001package org.javasimon.source; 002 003import org.javasimon.Manager; 004import org.javasimon.Split; 005import org.javasimon.Stopwatch; 006 007/** 008 * Disabled stopwatch source. 009 * 010 * @author <a href="mailto:virgo47@gmail.com">Richard "Virgo" Richter</a> 011 * @since 3.4 012 */ 013public class DisabledStopwatchSource<L> implements StopwatchSource<L> { 014 /** 015 * Singleton instance. 016 */ 017 private static final DisabledStopwatchSource INSTANCE = new DisabledStopwatchSource(); 018 019 /** 020 * Returns a singleton instance. 021 */ 022 @SuppressWarnings("unchecked") 023 public static <L> DisabledStopwatchSource<L> get() { 024 return (DisabledStopwatchSource<L>) INSTANCE; 025 } 026 027 @Override 028 public Split start(L location) { 029 return Split.DISABLED; 030 } 031 032 @Override 033 public boolean isMonitored(L location) { 034 return false; 035 } 036 037 @Override 038 public Stopwatch getMonitor(L location) { 039 return null; 040 } 041 042 @Override 043 public Manager getManager() { 044 return null; 045 } 046}