protected ClassMapping createClassMapping ( short code , String cname ) throws IOException , ClassNotFoundException { // resolve the class and streamer ClassLoader loader = ( _loader != null ) ? _loader : Thread . currentThread ( ) . getContextClassLoader ( ) ; Class < ? > sclass = Class . forName ( cname , true , loader ) ; Streamer streamer = Streamer . getStreamer ( sclass ) ; if ( STREAM_DEBUG ) { log . info ( hashCode ( ) + ": New class '" + cname + "'" , "code" , code ) ; } // sanity check if ( streamer == null ) { String errmsg = "Aiya! Unable to create streamer for newly seen class " + "[code=" + code + ", class=" + cname + "]" ; throw new RuntimeException ( errmsg ) ; } return new ClassMapping ( code , sclass , streamer ) ; }
Creates and returns a class mapping for the specified code and class name .