This post has NOT been accepted by the mailing list yet.
According to the most type safe suggestion, I should use the cracker for the logon message I recieved. But I got into problem as I would like to check the username and password in the message and when they doesn't match, I need to throw the RejectLogon exception.
I can see there is no problem throwing the RejectLogon in fromAdmin function. However, if I use the message cracker as suggested. I only have this signature:
public void onMessage(Logon message, SessionID sessionID) throws FieldNotFound, UnsupportedMessageType, IncorrectTagValue
And it doesn't allow to throw the RejectLogon exception. Any idea why? And any way to walk around?