Class FederationConsumerEntry
- java.lang.Object
-
- org.apache.activemq.artemis.protocol.amqp.federation.internal.FederationConsumerEntry
-
public class FederationConsumerEntry extends Object
Am entry type class used to hold aFederationConsumerInternaland any other state data needed by the manager that is creating them based on the policy configuration for the federation instance. The entry can be extended by federation implementation to hold additional state data for the federation consumer and the managing of its lifetime. This entry type provides a reference counter that can be used to register demand on a federation resource such that it is not torn down until all demand has been removed from the local resource.
-
-
Constructor Summary
Constructors Constructor Description FederationConsumerEntry(FederationConsumerInternal consumer)Creates a new consumer entry with a single reference
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDemand()Add additional demand on the resource associated with this entries consumer.FederationConsumerInternalgetConsumer()booleanreduceDemand()Reduce the known demand on the resource this entries consumer is associated with and returns true when demand reaches zero which indicates the consumer should be closed and the entry cleaned up.
-
-
-
Constructor Detail
-
FederationConsumerEntry
public FederationConsumerEntry(FederationConsumerInternal consumer)
Creates a new consumer entry with a single reference- Parameters:
consumer- The federation consumer that will be carried in this entry.
-
-
Method Detail
-
getConsumer
public FederationConsumerInternal getConsumer()
- Returns:
- the consumer managed by this entry
-
addDemand
public void addDemand()
Add additional demand on the resource associated with this entries consumer.
-
reduceDemand
public boolean reduceDemand()
Reduce the known demand on the resource this entries consumer is associated with and returns true when demand reaches zero which indicates the consumer should be closed and the entry cleaned up.- Returns:
- true if demand has fallen to zero on the resource associated with the consumer.
-
-