public class MessageSenderManager extends Object
Constructor and Description |
---|
MessageSenderManager() |
Modifier and Type | Method and Description |
---|---|
MessageSender |
acquireSender()
Gets a free sender from the pool.
|
void |
addMessageSenderProperties(Properties properties)
Copies properties to message sender properties.
|
void |
addSenderInstance(MessageSender sender)
Adds
MessageSender into available senders and initializes it. |
int |
availableSenderCount()
Gets the number of available senders in the pool.
|
void |
close()
Finalizes the message sender manager and disconnects all message senders from their target.
|
String |
getSenderClass()
Gets the name of the class implementing the message sender.
|
int |
getSenderPoolSize()
Gets the size of the pool of senders.
|
void |
init()
Initializes the message sender by creating all the message sender instances.
|
void |
releaseAllSenders()
Release all senders that has been acquired previously.
|
void |
releaseSender(MessageSender messageSender)
Returns a sender that has been already used to the pool of available senders for later reuse.
|
void |
setMessageSenderProperty(Object property,
Object value)
Sets a message sender property.
|
void |
setMessageSenderProperty(String property,
String value)
Sets a message sender property.
|
void |
setSenderClass(String senderClass)
Sets the name of the class implementing the message sender.
|
void |
setSenderPoolSize(int senderPoolSize)
Sets the size of the pool of senders.
|
public void setMessageSenderProperty(String property, String value)
property
- Property name to be set.value
- A new property string value.public void setMessageSenderProperty(Object property, Object value)
property
- Object referencing the property to be set.value
- A new property value.public void addMessageSenderProperties(Properties properties)
properties
- Properties to be added.public void init() throws PerfCakeException
PerfCakeException
- When it was not possible to create the instances.public void addSenderInstance(MessageSender sender) throws PerfCakeException
MessageSender
into available senders and initializes it.sender
- Sender to be registered with this manager.PerfCakeException
- When the initialization of the sender fails.public MessageSender acquireSender() throws PerfCakeException
PerfCakeException
- When the pool is empty.public void releaseSender(MessageSender messageSender)
messageSender
- The sender to be returned to the pool.public void releaseAllSenders()
public int availableSenderCount()
public void close() throws PerfCakeException
PerfCakeException
- When the disconnection operation failed.public int getSenderPoolSize()
public void setSenderPoolSize(int senderPoolSize)
senderPoolSize
- The size of the pool of senders.public String getSenderClass()
public void setSenderClass(String senderClass)
senderClass
- The name of the class implementing the message sender.Copyright © 2010–2017 PerfCake Community. All rights reserved.