@ Override protected void processHeaders ( IoBuffer in ) { log . debug ( "RemotingClient processHeaders - buffer limit: {}" , ( in != null ? in . limit ( ) : 0 ) ) ; int version = in . getUnsignedShort ( ) ; // skip log . debug ( "Version: {}" , version ) ; // the version by now, AMF3 is not yet implemented int count = in . getUnsignedShort ( ) ; log . debug ( "Count: {}" , count ) ; Input input = new Input ( in ) ; for ( int i = 0 ; i < count ; i ++ ) { String name = input . getString ( ) ; log . debug ( "Name: {}" , name ) ; boolean required = ( in . get ( ) == 0x01 ) ; log . debug ( "Required: {}" , required ) ; Object value = null ; int len = in . getInt ( ) ; log . debug ( "Length: {}" , len ) ; // look for junk bytes ff,ff,ff,ff if ( len == - 1 ) { in . get ( ) ; //02 len = in . getShort ( ) ; log . debug ( "Corrected length: {}" , len ) ; value = input . readString ( len ) ; } else { value = Deserializer . deserialize ( input , Object . class ) ; } log . debug ( "Value: {}" , value ) ; // XXX: this is pretty much untested!!! if ( RemotingHeader . APPEND_TO_GATEWAY_URL . equals ( name ) ) { // Append string to gateway url appendToUrl = ( String ) value ; } else if ( RemotingHeader . REPLACE_GATEWAY_URL . equals ( name ) ) { // Replace complete gateway url url = ( String ) value ; // XXX: reset the <appendToUrl< here? } else if ( RemotingHeader . PERSISTENT_HEADER . equals ( name ) ) { // Send a new header with each following request if ( value instanceof Map < ? , ? > ) { @ SuppressWarnings ( "unchecked" ) Map < String , Object > valueMap = ( Map < String , Object > ) value ; RemotingHeader header = new RemotingHeader ( ( String ) valueMap . get ( "name" ) , ( Boolean ) valueMap . get ( "mustUnderstand" ) , valueMap . get ( "data" ) ) ; headers . put ( header . getName ( ) , header ) ; } else { log . error ( "Expected Map but received {}" , value ) ; } } else { log . warn ( "Unsupported remoting header \"{}\" received with value \"{}\"" , name , value ) ; } } }
Process any headers sent in the response .