public final class LoopbackBus extends SmaObject
Modifier and Type | Class and Description |
---|---|
class |
LoopbackBus.Agent
Represents a messaging agent
|
class |
LoopbackBus.AgentParameters
Contains an agent's operating parameters
|
static class |
LoopbackBus.AgentQueueWaitStrategy
Enumerates a agent's queue wait strategy
|
class |
LoopbackBus.AgentTestController
Implements an agent's test controller.
|
class |
LoopbackBus.TestController
Implements an agent's test controller.
|
Modifier and Type | Method and Description |
---|---|
boolean |
agentHasSubscriptions(String name)
Return if an agent has active subscriptions
|
static void |
clearAllInstances()
Clear all loopback bus instances
|
void |
clearMessageDiscard()
Clear the discard message setting
|
void |
discardMessages()
Set the bus to discard all inbound messages
|
void |
dumpActivityTrackingInfo()
If Activity Tracking has been enabled for, will dump the current Activity Tracking
History for this bus.
|
void |
dumpPendingAck(StringBuilder builder)
Dumps diagnostic information about guaranteed messages pending
acknowledgement to the provide
StringBuilder |
void |
enableWaitForQuiescence(boolean val)
Enable a loopback bus's 'wait for quiescence" feature
|
LoopbackBus.Agent |
getAgent(String name)
Get a connected agent
|
LoopbackBus.AgentParameters |
getAgentParameters(String name)
Get an agent's operating parameters
|
LoopbackBus.AgentTestController |
getAgentTestController(String name)
Get an agent's test controller.
|
static LoopbackBus |
getInstance()
Return the default loopback bus instance
|
static LoopbackBus |
getInstance(String name)
Return a named loopback bus instance.
|
LoopbackBus.TestController |
getTestController()
Returns the overal
|
boolean |
isAgentConnected(String name)
Check if an agent is connected to the bus
|
LoopbackBus |
reset()
Reset a loopback bus.
|
boolean |
waitForPendingAcks(long timeout)
Waits for acknowledgements for guaranteed messages sent through this bus.
|
boolean |
waitForPendingAcks(long timeout,
TimeUnit timeUnit)
Equivalent to calling
waitForPendingAcks(long, TimeUnit) with TimeUnit.MILLISECONDS |
void |
waitForQuiescence()
Wait for quiescence with no timeout.
|
boolean |
waitForQuiescence(long timeout)
Wait for quiescence for a specified timeout (in milliseconds)
|
boolean |
waitForQuiescence(long timeout,
TimeUnit timeUnit)
Wait for quiescence for a specified time (in TimeUnits)
|
getChecked, getThreaded, getTracer, setChecked, setTracer
public static LoopbackBus getInstance(String name)
name
- The name of the bus to return.public static LoopbackBus getInstance()
public static void clearAllInstances()
public final LoopbackBus.AgentParameters getAgentParameters(String name)
name
- The agent's name.public final LoopbackBus.AgentTestController getAgentTestController(String name)
name
- The agent's name.public LoopbackBus.TestController getTestController()
public final LoopbackBus reset()
This method resets a bus. After returning from this method, the bus state is equivalent to a newly created bus.
public final boolean isAgentConnected(String name)
public final boolean agentHasSubscriptions(String name)
public final LoopbackBus.Agent getAgent(String name)
name
- The agent's namepublic final void enableWaitForQuiescence(boolean val)
public final boolean waitForPendingAcks(long timeout, TimeUnit timeUnit)
waitForPendingAcks(long, TimeUnit)
with TimeUnit.MILLISECONDS
timeout
- The amount of time to wait for pending acknowledgements.timeUnit
- The timeout used to waitwaitForPendingAcks(long)
public final boolean waitForPendingAcks(long timeout)
If a timeout of 0 or less is specified the calling thread will wait until either the count of messages pending acknowledgements reaches 0 or the calling thread is interrupted.
In the event that the caller is interrupted, an InterruptedException
is not thrown. Instead
the thread is re-interrupted and false
is returned
timeout
- The amount of time to wait for pending acknowledgementspublic final void dumpPendingAck(StringBuilder builder)
StringBuilder
builder
- The StringBuilder
into which to write the diagnosticspublic final void waitForQuiescence()
public final boolean waitForQuiescence(long timeout)
timeout
- The timeout to wait (in milliseconds). Specifying
a value of < 0 is equivalent to invoking waitForQuiescence()
public final boolean waitForQuiescence(long timeout, TimeUnit timeUnit)
timeout
- The timeout to wait (in units specified by timeUnit)timeUnit
- The time unit to use to interpret timeoutpublic final void dumpActivityTrackingInfo()
public final void discardMessages()
public final void clearMessageDiscard()
Copyright © 2019 Neeve Research, LLC. All Rights Reserved.