|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.grinder.communication.FanOutServerSender
public final class FanOutServerSender
Manages the sending of messages to many TCP clients.
| Constructor Summary | |
|---|---|
FanOutServerSender(Acceptor acceptor,
ConnectionType connectionType,
int numberOfThreads)
Constructor. |
|
| Method Summary | |
|---|---|
protected Address |
getAddress(ResourcePool.Resource resource)
Return the address of a socket. |
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 socket resource. |
void |
send(Address address,
Message message)
Send a message to a particular address. |
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FanOutServerSender(Acceptor acceptor,
ConnectionType connectionType,
int numberOfThreads)
throws Acceptor.ShutdownException
acceptor - Acceptor.connectionType - Connection type.numberOfThreads - Number of sender threads to use.
Acceptor.ShutdownException - If the acceptor has been shutdown.| Method Detail |
|---|
public void send(Address address,
Message message)
throws CommunicationException
address - Address to send message to.message - The message.
CommunicationException - If an error occurs.
protected OutputStream resourceToOutputStream(ResourcePool.Resource resource)
throws CommunicationException
resource - The resource.
CommunicationException - If the output stream could not be
obtained from the socket.protected Address getAddress(ResourcePool.Resource resource)
resource - The resource.
null if the socket 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.
CommunicationExceptionprotected final net.grinder.communication.ResourcePool getResourcePool()
public void shutdown()
shutdown in interface Sender
public final void send(Message message)
throws CommunicationException
send in interface Sendermessage - A Message.
CommunicationException - If an error occurs.
protected static final void writeMessageToStream(Message message,
OutputStream stream)
throws IOException
IOExceptionpublic boolean isShutdown()
true if and only if we are shut down.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||