public synchronized AbstractMessage getMEMEMessage ( ) throws Exception { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getMEMEMessage" ) ; // GRRRRRRRRRRRR Read the FAP Clifford int messageLength = getInt ( ) ; boolean isControlMessage = get ( ) == CommsConstants . MEME_CONTROLMESSAGE ; AbstractMessage message = null ; if ( tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "Message Length" , messageLength ) ; SibTr . debug ( tc , "Control Message" , "" + isControlMessage ) ; } if ( isControlMessage ) { ControlMessageFactory fac = ControlMessageFactory . getInstance ( ) ; if ( receivedBuffer . hasArray ( ) ) { message = fac . createInboundControlMessage ( receivedBuffer . array ( ) , receivedBuffer . position ( ) + receivedBuffer . arrayOffset ( ) , messageLength ) ; } else { byte [ ] messageArray = get ( messageLength ) ; message = fac . createInboundControlMessage ( messageArray , 0 , messageLength ) ; } } else { JsMessageFactory fac = JsMessageFactory . getInstance ( ) ; if ( receivedBuffer . hasArray ( ) ) { message = fac . createInboundJsMessage ( receivedBuffer . array ( ) , receivedBuffer . position ( ) + receivedBuffer . arrayOffset ( ) , messageLength ) ; } else { byte [ ] messageArray = get ( messageLength ) ; message = fac . createInboundJsMessage ( messageArray , 0 , messageLength ) ; } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getMEMEMessage" , message ) ; return message ; }
This method will retrieve an ME - ME message from the buffer . A JsMessage or ControlMessage may be returned from this method .