Class ReflectionLongAdderCounter
java.lang.Object
io.grpc.internal.ReflectionLongAdderCounter
- All Implemented Interfaces:
LongCounter
A
. Instantiates the object
and invokes methods reflectively to avoid a compile time dependency on LongAdder.
LongCounter that is implemented with a JDK8
invalid reference
LongAdder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Methodprivate static final Constructor<?> private static final RuntimeExceptionprivate final Objectprivate static final Loggerprivate static final Object[]private static final Method -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
logger
-
defaultConstructor
-
addMethod
-
sumMethod
-
initializationException
-
instance
-
one
-
-
Constructor Details
-
ReflectionLongAdderCounter
ReflectionLongAdderCounter()
-
-
Method Details
-
isAvailable
static boolean isAvailable()Returns true if the environment supports LongAdder. In other words, we are running in >= JDK8. -
add
public void add(long delta) Description copied from interface:LongCounterAdds the delta to this counter.- Specified by:
addin interfaceLongCounter
-
value
public long value()Description copied from interface:LongCounterReturns the value of this counter.- Specified by:
valuein interfaceLongCounter
-