diff options
Diffstat (limited to 'container-disc/src/main/java/com/yahoo/container/jdisc/metric/DisableGuiceMetric.java')
-rw-r--r-- | container-disc/src/main/java/com/yahoo/container/jdisc/metric/DisableGuiceMetric.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/metric/DisableGuiceMetric.java b/container-disc/src/main/java/com/yahoo/container/jdisc/metric/DisableGuiceMetric.java new file mode 100644 index 00000000000..09cad401bc1 --- /dev/null +++ b/container-disc/src/main/java/com/yahoo/container/jdisc/metric/DisableGuiceMetric.java @@ -0,0 +1,31 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.container.jdisc.metric; + +import com.yahoo.jdisc.Metric; + +import java.util.Map; + +/** + * @author tonytv + */ +public class DisableGuiceMetric implements Metric { + + @Override + public void set(String s, Number number, Context context) { + throw newException(); + } + + @Override + public void add(String s, Number number, Context context) { + throw newException(); + } + + @Override + public Context createContext(Map<String, ?> stringMap) { + throw newException(); + } + + private static RuntimeException newException() { + return new UnsupportedOperationException("The Metric framework is only available to components."); + } +} |