Constructor and Description |
---|
FanOutStreamSender(int numberOfThreads)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(OutputStream stream)
Add a stream.
|
protected Address |
getAddress(ResourcePool.Resource resource)
We don't support addressing individual streams.
|
protected net.grinder.communication.ResourcePool |
getResourcePool()
Allow subclasses to access the resource pool.
|
boolean |
isShutdown()
Return whether we are shutdown.
|
protected OutputStream |
resourceToOutputStream(ResourcePool.Resource resource)
Return an output stream from a resource.
|
void |
send(Message message)
Send the given message.
|
void |
shutdown()
Shut down this sender.
|
protected void |
writeAddressedMessage(Address address,
Message message)
Send a message.
|
protected void |
writeMessage(Message message)
Send a message.
|
protected static void |
writeMessageToStream(Message message,
OutputStream stream) |
public FanOutStreamSender(int numberOfThreads)
numberOfThreads
- Number of sender threads to use.public void add(OutputStream stream)
stream
- The stream.protected OutputStream resourceToOutputStream(ResourcePool.Resource resource)
resource
- The resource.protected Address getAddress(ResourcePool.Resource resource)
resource
- The resource.null
if the resource has no address.protected final void writeMessage(Message message) throws CommunicationException
message
- The message.IOException
- If an error occurs.CommunicationException
protected final void writeAddressedMessage(Address address, Message message) throws CommunicationException
message
- The message.IOException
- If an error occurs.CommunicationException
protected final net.grinder.communication.ResourcePool getResourcePool()
public final void send(Message message) throws CommunicationException
send
in interface Sender
message
- A Message
.CommunicationException
- If an error occurs.protected static final void writeMessageToStream(Message message, OutputStream stream) throws IOException
IOException
public boolean isShutdown()
true
if and only if we are shut down.Copyright © 2000-2014. All Rights Reserved.