001package org.javasimon.source;
002
003import org.javasimon.Manager;
004import org.javasimon.Simon;
005
006/**
007 * Disabled monitor source.
008 *
009 * @author gquintana
010 */
011public class DisabledMonitorSource<L, M extends Simon> implements MonitorSource<L, M> {
012        /**
013         * Singleton instance.
014         */
015        private static final DisabledMonitorSource INSTANCE = new DisabledMonitorSource();
016
017        /**
018         * Returns a singleton instance.
019         */
020        @SuppressWarnings("unchecked")
021        public static <L, M extends Simon> DisabledMonitorSource<L, M> get() {
022                return (DisabledMonitorSource<L, M>) INSTANCE;
023        }
024
025        /**
026         * Always returns null.
027         */
028        public M getMonitor(L location) {
029                return null;
030        }
031
032        /**
033         * Always returns false.
034         */
035        public boolean isMonitored(L location) {
036                return false;
037        }
038
039        @Override
040        public Manager getManager() {
041                return null;
042        }
043}