Package io.grpc.internal
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 Method
private static final Constructor
<?> private static final RuntimeException
private final Object
private static final Logger
private 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:LongCounter
Adds the delta to this counter.- Specified by:
add
in interfaceLongCounter
-
value
public long value()Description copied from interface:LongCounter
Returns the value of this counter.- Specified by:
value
in interfaceLongCounter
-