public interface ReceiveConsumerOperationsInterface
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_ALL_CONSUMERS_CONNECTED
The string name of the bound property that is used to indicate if the bean and all
individual named consumers are connected
(typically "allConsumersConnected", but this constant should be used to be sure).
|
Modifier and Type | Method and Description |
---|---|
ConsumerOperationsInterface |
addAsyncConsumer(java.lang.String uniqueName,
java.lang.String... channels)
Add a new uniquely-named asynchronous consumer that listens on a specified set of channels.
|
ConsumerOperationsInterface |
addConsumer(java.lang.String uniqueName,
java.lang.String... channels)
Add a new uniquely-named consumer that listens on a specified set of channels.
|
ConsumerOperationsInterface |
addConsumer(java.lang.String uniqueName,
java.lang.String[] channels,
boolean disconnectSlow)
Deprecated.
use
addConsumer(String, String[]) instead |
ConsumerOperationsInterface |
addConsumer(java.lang.String uniqueName,
java.lang.String[] channels,
boolean disconnectSlow,
boolean async)
Deprecated.
use
addConsumer(String, String[]) or addAsyncConsumer(String, String[]) to create an asynchronous consumer |
ConsumerOperationsInterface[] |
getAllConsumers()
Get all existing uniquely-named consumers.
|
ConsumerOperationsInterface |
getConsumer(java.lang.String uniqueName)
Get an existing uniquely-named consumer.
|
boolean |
isAllConsumersConnected()
Determine if the bean and existing uniquely-named consumers are connected.
|
boolean |
isDisconnectIfSlowReceiver()
Whether any receiver will disconnect if it is slow
|
void |
removeAllConsumers()
Remove and disconnect all existing uniquely-named consumers.
|
void |
removeConsumer(java.lang.String uniqueName)
Remove and disconnect any existing uniquely-named consumer.
|
static final java.lang.String PROPERTY_ALL_CONSUMERS_CONNECTED
Note that this property applies only to individual named consumers, and NOT to the single receiver. From 5.0 onwards this property also takes into account whether the bean itself is connected, and will always be false when the bean is not connected, even if no consumers were added.
ConsumerOperationsInterface addConsumer(java.lang.String uniqueName, java.lang.String... channels) throws EngineException
uniqueName
- the unique name for the new consumer.channels
- The list of channels on which the consumer should receive events. Must be non-null, and contain
no null elements.EngineException
- if the consumer cannot be added (e.g. if the name is not unique), or if the channels parameter is invalid.ConsumerOperationsInterface addAsyncConsumer(java.lang.String uniqueName, java.lang.String... channels) throws EngineException
uniqueName
- the unique name for the new consumer.channels
- The list of channels on which the consumer should receive events. Must be non-null, and contain
no null elements.EngineException
- if the consumer cannot be added (e.g. if the name is not unique), or if the channels parameter is invalid.@Deprecated ConsumerOperationsInterface addConsumer(java.lang.String uniqueName, java.lang.String[] channels, boolean disconnectSlow) throws EngineException
addConsumer(String, String[])
insteaduniqueName
- the unique name for the new consumer.channels
- the list of channels on which the consumer should receive events. Must be non-null, and contain no null elements.disconnectSlow
- Whether we should be disconnected if we don't keep up.
Only the first consumer's disconnectSlow value is used; subsequent consumers
to the same correlator (even if via different EngineManagement objects) share
the connection and thus the disconnect behaviour.EngineException
- if the consumer cannot be added (e.g. if the name is not unique), or if the channels parameter is invalid.@Deprecated ConsumerOperationsInterface addConsumer(java.lang.String uniqueName, java.lang.String[] channels, boolean disconnectSlow, boolean async) throws EngineException
addConsumer(String, String[])
or addAsyncConsumer(String, String[])
to create an asynchronous consumeruniqueName
- the unique name for the new consumer.channels
- the list of channels on which the consumer should receive events. Must be non-null, and contain no null elements.disconnectSlow
- Whether we should be disconnected if we don't keep up.
Only the first consumer's disconnectSlow value is used; subsequent consumers
to the same correlator (even if via different EngineManagement objects) share
the connection and thus the disconnect behaviour.async
- Whether the consumer is asynchronous. If it is, events are queued
and delivered in a separate thread, and EventListeners of the consumer can
perform re-entrant calls to the bean. EventListeners of asynchronous consumers
may be called after having been disconnected.EngineException
- if the consumer cannot be added (e.g. if the name is not unique), or if the channels parameter is invalid.ConsumerOperationsInterface getConsumer(java.lang.String uniqueName)
uniqueName
- the unique-name of an existing consumer.ConsumerOperationsInterface[] getAllConsumers()
boolean isAllConsumersConnected()
This is a bound property, so clients may also listen for property changes to ReceiveConsumerOperationsInterface.PROPERTY_ALL_CONSUMERS_CONNECTED. If no named consumers have been added, this property is identical to isBeanConnected.
The method name may sound odd, but "is" is the accepted method-name prefix for testing boolean properties.
void removeConsumer(java.lang.String uniqueName) throws EngineException
uniqueName
- the unique-name of an existing consumer.EngineException
- if there are problems with removing the consumer.void removeAllConsumers() throws EngineException
EngineException
- if there are problems while removing any of the consumers.boolean isDisconnectIfSlowReceiver()
Submit a bug or feature
Copyright (c) 2013-2017 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.