/** * Send a message on this channel. If the channel is at capacity, this * method will block until either the timeout occurs or the sending thread * is interrupted. If the specified timeout is 0, the method will return * immediately. If less than zero, it will block indefinitely (see * {@link #send(Message)}). * * @param message the Message to send * @param timeout the timeout in milliseconds * * @return <code>true</code> if the message is sent successfully, * <code>false</code> if the message cannot be sent within the allotted * time or the sending thread is interrupted. */ public final boolean send(Message<?> message, long timeout) { message = this.interceptors.preSend(message, this); if (message == null) { return false; } boolean sent = this.doSend(message, timeout); this.interceptors.postSend(message, this, sent); return sent; }