public class DelegatingSendPort<T> extends java.lang.Object implements SendPort<T>, DelegatingEquals
| Constructor and Description |
|---|
DelegatingSendPort(SendPort<T> target) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the channel so that no more messages could be sent to it.
|
void |
close(java.lang.Throwable t)
Closes the channel so that no more messages could be sent to it, and signifies an exception occurred in the producer.
|
boolean |
equals(java.lang.Object obj)
The
equals method of a DelegatingEquals object, will usually be implemented thus: |
int |
hashCode() |
void |
send(T message)
Sends a message to the channel, possibly blocking until there's room available in the channel.
|
boolean |
send(T message,
long timeout,
java.util.concurrent.TimeUnit unit)
Sends a message to the channel, possibly blocking until there's room available in the channel, but never longer than the
specified timeout.
|
boolean |
send(T message,
Timeout timeout)
Sends a message to the channel, possibly blocking until there's room available in the channel, but never longer than the
specified timeout.
|
java.lang.String |
toString() |
boolean |
trySend(T message)
Sends a message to the channel if the channel has room available.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitisClosedpublic void send(T message) throws SuspendExecution, java.lang.InterruptedException
SendPortOverflowPolicy, set at construction time.send in interface SendPort<T>java.lang.InterruptedExceptionSuspendExecutionpublic boolean send(T message, long timeout, java.util.concurrent.TimeUnit unit) throws SuspendExecution, java.lang.InterruptedException
SendPortOverflowPolicy, set at construction time.send in interface SendPort<T>timeout - the maximum duration this method is allowed to wait.unit - the timeout's time unittrue if the message has been sent successfully; false if the timeout has expired.SuspendExecutionjava.lang.InterruptedExceptionpublic boolean send(T message, Timeout timeout) throws SuspendExecution, java.lang.InterruptedException
SendPortOverflowPolicy, set at construction time.send in interface SendPort<T>timeout - the method will not block for longer than the amount remaining in the Timeouttrue if the message has been sent successfully; false if the timeout has expired.SuspendExecutionjava.lang.InterruptedExceptionpublic boolean trySend(T message)
SendPortpublic void close(java.lang.Throwable t)
SendPortReceivePort's receive or tryReceive,
wrapped by a ProducerException.
Messages already sent to the channel prior to calling this method will still be received.public void close()
PortAutoCloseableclose in interface PortAutoCloseableclose in interface java.lang.AutoCloseablepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
DelegatingEqualsequals method of a DelegatingEquals object, will usually be implemented thus:
boolean equals(Object o) {
if (o instanceof DelegatingEquals)
return o.equals(delegate);
else
return delegate.equals(o);
}equals in interface DelegatingEqualsequals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object