ServiceCachingPolicyBuilder { public ServiceCachingPolicy build() { checkState(_maxNumServiceInstances == -1 || _maxNumServiceInstancesPerEndPoint <= _maxNumServiceInstances); final int maxNumServiceInstances = _maxNumServiceInstances; final int maxNumServiceInstancesPerEndPoint = _maxNumServiceInstancesPerEndPoint; final long maxServiceInstanceIdleTimeNanos = _maxServiceInstanceIdleTimeNanos; final ExhaustionAction cacheExhaustionAction = _cacheExhaustionAction; return new ServiceCachingPolicy() { @Override public int getMaxNumServiceInstances() { return maxNumServiceInstances; } @Override public int getMaxNumServiceInstancesPerEndPoint() { return maxNumServiceInstancesPerEndPoint; } @Override public long getMaxServiceInstanceIdleTime(TimeUnit unit) { return unit.convert(maxServiceInstanceIdleTimeNanos, TimeUnit.NANOSECONDS); } @Override public ExhaustionAction getCacheExhaustionAction() { return cacheExhaustionAction; } @Override public boolean useMultiThreadedClientPolicy() { return false; } }; }  static ServiceCachingPolicy getMultiThreadedClientPolicy(); ServiceCachingPolicyBuilder withMaxNumServiceInstances(int maxNumServiceInstances); ServiceCachingPolicyBuilder withMaxNumServiceInstancesPerEndPoint(int maxNumServiceInstancesPerEndPoint); ServiceCachingPolicyBuilder withMaxServiceInstanceIdleTime(int maxServiceInstanceIdleTime, TimeUnit unit); ServiceCachingPolicyBuilder withCacheExhaustionAction(ExhaustionAction action); ServiceCachingPolicy build(); static final ServiceCachingPolicy NO_CACHING; }
@Test public void testDefaultMultiThreadedClientPolicy() { ServiceCachingPolicyBuilder builder = new ServiceCachingPolicyBuilder(); assertEquals(false, builder.build().useMultiThreadedClientPolicy()); }