* needing to provide only
*
* @param <M> Protocol message type
- * @param <S> Protocol session type, has to extend ProtocolSession<M>
+ * @param <S> Protocol session type, has to extend {@code ProtocolSession<M>}
*/
+@Deprecated
public abstract class AbstractSessionNegotiator<M, S extends AbstractProtocolSession<?>> extends ChannelInboundHandlerAdapter implements SessionNegotiator<S> {
private final Logger LOG = LoggerFactory.getLogger(AbstractSessionNegotiator.class);
private final Promise<S> promise;
promise.setSuccess(session);
}
- protected final void negotiationFailed(final Throwable cause) {
+ protected void negotiationFailed(final Throwable cause) {
LOG.debug("Negotiation on channel {} failed", channel, cause);
channel.close();
promise.setFailure(cause);
LOG.debug("Starting session negotiation on channel {}", channel);
try {
startNegotiation();
- } catch (Exception e) {
+ } catch (final Exception e) {
LOG.warn("Unexpected negotiation failure", e);
negotiationFailed(e);
}
LOG.debug("Negotiation read invoked on channel {}", channel);
try {
handleMessage((M)msg);
- } catch (Exception e) {
+ } catch (final Exception e) {
LOG.debug("Unexpected error while handling negotiation message {}", msg, e);
negotiationFailed(e);
}