public int handleMessage ( BaseMessage message ) { try { int iMessageType = Integer . parseInt ( ( String ) message . get ( MessageConstants . MESSAGE_TYPE_PARAM ) ) ; if ( ( iMessageType == Constants . AFTER_UPDATE_TYPE ) || ( iMessageType == Constants . CACHE_UPDATE_TYPE ) ) { // Record updated - be very careful, you are running in an independent thread. SwingUtilities . invokeLater ( new UpdateScreenRecord ( iMessageType ) ) ; } } catch ( NumberFormatException ex ) { // Ignore } return super . handleMessage ( message ) ; }
Handle this message . Basically if I get a message that the current record changed I re - read the record .