public void run() {
// Note: this cast is safe because an AuthorizationFailureException will never be thrown
// when subscribing to a non-private channel
ChannelEventListener eventListener = channel.getEventListener();
PrivateChannelEventListener privateChannelListener = (PrivateChannelEventListener) eventListener;
privateChannelListener.onAuthenticationFailure(e.getMessage(), e);
}
});
}
}