Package org.jboss.remoting3.util
Class MessageTracker
- java.lang.Object
-
- org.jboss.remoting3.util.MessageTracker
-
public final class MessageTracker extends Object
An outbound message tracker, which can be used to easily avoid message overruns.- Author:
- David M. Lloyd
-
-
Constructor Summary
Constructors Constructor Description MessageTracker(Channel channel, int limit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageOutputStream
openMessage()
Open a message, blocking if necessary.MessageOutputStream
openMessageUninterruptibly()
Open a message, blocking if necessary, and deferring any interrupts which occur while blocking.
-
-
-
Constructor Detail
-
MessageTracker
public MessageTracker(Channel channel, int limit)
-
-
Method Detail
-
openMessage
public MessageOutputStream openMessage() throws IOException, InterruptedException
Open a message, blocking if necessary.- Returns:
- the message stream
- Throws:
IOException
- if the channel failed to open the messageInterruptedException
- if blocking was interrupted
-
openMessageUninterruptibly
public MessageOutputStream openMessageUninterruptibly() throws IOException
Open a message, blocking if necessary, and deferring any interrupts which occur while blocking.- Returns:
- the message stream
- Throws:
IOException
- if the channel failed to open the message
-
-