public class InvocationRegistry extends Object implements Iterable<Invocation>, MetricsProvider
Using the InvocationRegistry the Invocation and its response(s) can be linked to each other.
When an invocation is registered, a callId is determined. Based on this call ID, when a
Response
comes in, the
appropriate invocation can be looked up.
Some ideas:
Constructor and Description |
---|
InvocationRegistry(ILogger logger,
CallIdSequence callIdSequence) |
Modifier and Type | Method and Description |
---|---|
boolean |
deregister(Invocation invocation)
Deregisters an invocation.
|
Set<Map.Entry<Long,Invocation>> |
entrySet()
Intention to expose the entry set is to mutate it.
|
Invocation |
get(long callId)
Gets the invocation for the given call ID.
|
Iterator<Invocation> |
iterator() |
void |
provideMetrics(MetricsRegistry registry) |
boolean |
register(Invocation invocation)
Registers an invocation.
|
void |
reset(Throwable cause) |
void |
shutdown() |
int |
size()
Returns the number of pending invocations.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public InvocationRegistry(ILogger logger, CallIdSequence callIdSequence)
public void provideMetrics(MetricsRegistry registry)
provideMetrics
in interface MetricsProvider
public boolean register(Invocation invocation)
invocation
- The invocation to register.false
when InvocationRegistry is not alive and registration is not successful, true
otherwisepublic boolean deregister(Invocation invocation)
false
.
This ensures the idempotency of deregistration.invocation
- The Invocation to deregister.true
if this call deregistered the invocation; false
if the invocation wasn't registeredpublic int size()
public Iterator<Invocation> iterator()
iterator
in interface Iterable<Invocation>
public Set<Map.Entry<Long,Invocation>> entrySet()
public Invocation get(long callId)
callId
- the call IDnull
if no invocation was found.public void reset(Throwable cause)
public void shutdown()
Copyright © 2022 Hazelcast, Inc.. All Rights Reserved.