private com . datastax . driver . core . policies . RetryPolicy getCustomRetryPolicy ( Properties props ) { String customRetryPolicy = ( String ) props . get ( CUSTOM_RETRY_POLICY ) ; Class < ? > clazz = null ; Method getter = null ; try { clazz = Class . forName ( customRetryPolicy ) ; com . datastax . driver . core . policies . RetryPolicy retryPolicy = ( com . datastax . driver . core . policies . RetryPolicy ) KunderaCoreUtils . createNewInstance ( clazz ) ; if ( retryPolicy != null ) { return retryPolicy ; } getter = clazz . getDeclaredMethod ( GET_INSTANCE ) ; return ( com . datastax . driver . core . policies . RetryPolicy ) getter . invoke ( null , ( Object [ ] ) null ) ; } catch ( ClassNotFoundException e ) { logger . error ( e . getMessage ( ) ) ; throw new KunderaException ( "Please make sure class " + customRetryPolicy + " set in property file exists in classpath " + e . getMessage ( ) ) ; } catch ( IllegalAccessException e ) { logger . error ( e . getMessage ( ) ) ; throw new KunderaException ( "Method " + getter . getName ( ) + " must be declared public " + e . getMessage ( ) ) ; } catch ( NoSuchMethodException e ) { logger . error ( e . getMessage ( ) ) ; throw new KunderaException ( "Please make sure getter method of " + clazz . getSimpleName ( ) + " is named \"getInstance()\"" ) ; } catch ( InvocationTargetException e ) { logger . error ( e . getMessage ( ) ) ; throw new KunderaException ( "Error while executing \"getInstance()\" method of Class " + clazz . getSimpleName ( ) + ": " + e . getMessage ( ) ) ; } }
Gets the custom retry policy .