private void _processMetadata ( HashMap < String , Object > result ) { // the collections in the result can be either an object[] or a HashSet<object>, depending on the serializer that is used Object methods = result . get ( "methods" ) ; Object attrs = result . get ( "attrs" ) ; Object oneways = result . get ( "oneways" ) ; if ( methods instanceof Object [ ] ) { Object [ ] methods_array = ( Object [ ] ) methods ; this . pyroMethods = new HashSet < String > ( ) ; for ( int i = 0 ; i < methods_array . length ; ++ i ) { this . pyroMethods . add ( ( String ) methods_array [ i ] ) ; } } else if ( methods != null ) { this . pyroMethods = getSetOfStrings ( methods ) ; } if ( attrs instanceof Object [ ] ) { Object [ ] attrs_array = ( Object [ ] ) attrs ; this . pyroAttrs = new HashSet < String > ( ) ; for ( int i = 0 ; i < attrs_array . length ; ++ i ) { this . pyroAttrs . add ( ( String ) attrs_array [ i ] ) ; } } else if ( attrs != null ) { this . pyroAttrs = getSetOfStrings ( attrs ) ; } if ( oneways instanceof Object [ ] ) { Object [ ] oneways_array = ( Object [ ] ) oneways ; this . pyroOneway = new HashSet < String > ( ) ; for ( int i = 0 ; i < oneways_array . length ; ++ i ) { this . pyroOneway . add ( ( String ) oneways_array [ i ] ) ; } } else if ( oneways != null ) { this . pyroOneway = getSetOfStrings ( oneways ) ; } if ( pyroMethods . isEmpty ( ) && pyroAttrs . isEmpty ( ) ) { throw new PyroException ( "remote object doesn't expose any methods or attributes" ) ; } }
Extract meta data and store it in the relevant properties on the proxy . If no attribute or method is exposed at all throw an exception .