Search in sources :

Example 1 with HystrixThreadPool

use of com.netflix.hystrix.HystrixThreadPool in project Hystrix by Netflix.

the class BasicHystrixTest method getThreadPoolProperties.

protected final HystrixThreadPoolProperties getThreadPoolProperties(HystrixInvokableInfo<?> command) {
    try {
        Field field = command.getClass().getSuperclass().getSuperclass().getSuperclass().getDeclaredField("threadPool");
        field.setAccessible(true);
        HystrixThreadPool threadPool = (HystrixThreadPool) field.get(command);
        Field field2 = HystrixThreadPool.HystrixThreadPoolDefault.class.getDeclaredField("properties");
        field2.setAccessible(true);
        return (HystrixThreadPoolProperties) field2.get(threadPool);
    } catch (NoSuchFieldException e) {
        throw Throwables.propagate(e);
    } catch (IllegalAccessException e) {
        throw Throwables.propagate(e);
    }
}
Also used : Field(java.lang.reflect.Field) HystrixThreadPool(com.netflix.hystrix.HystrixThreadPool) HystrixThreadPoolProperties(com.netflix.hystrix.HystrixThreadPoolProperties)

Aggregations

HystrixThreadPool (com.netflix.hystrix.HystrixThreadPool)1 HystrixThreadPoolProperties (com.netflix.hystrix.HystrixThreadPoolProperties)1 Field (java.lang.reflect.Field)1