test_class.declarator: factory = new CacheFactory()
test_class.modifier: @InjectMocks
      private final
test_class.original_string: @InjectMocks
      private final CacheFactory factory = new CacheFactory();
test_class.type: CacheFactory
test_class.var_name: factory
test_class.declarator: cacheBase
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private CacheBase cacheBase;
test_class.type: CacheBase
test_class.var_name: cacheBase
test_class.declarator: cacheClientFactory
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private CacheClientFactory cacheClientFactory;
test_class.type: CacheClientFactory
test_class.var_name: cacheClientFactory
test_class.declarator: cacheClient
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private CacheClient cacheClient;
test_class.type: CacheClient
test_class.var_name: cacheClient
test_class.file: simple-spring-memcached/src/test/java/com/google/code/ssm/CacheFactoryTest.java
test_class.identifier: CacheFactoryTest
test_case.body: @Test
      public void changeAddresses() throws IOException, NamingException {
          final CacheConfiguration conf = new CacheConfiguration();
          conf.setConsistentHashing(false);
          AddressProvider addrsProvider = new DefaultAddressProvider("127.0.0.1:11211");
          factory.setConfiguration(conf);
          factory.setAddressProvider(addrsProvider);
  
          Cache cache = factory.createCache();
  
          List<InetSocketAddress> newAddrs = Arrays.asList(new InetSocketAddress("127.0.0.2", 11221));
          factory.changeAddresses(newAddrs);
          Collection<SocketAddress> c = cache.getAvailableServers();
  
          assertEquals(1, c.size());
          assertEquals(newAddrs, c);
          verify(cacheClientFactory).create(addrsProvider.getAddresses(), conf);
      }
test_case.class_method_signature: CacheFactoryTest.changeAddresses()
test_case.full_signature: @Test public void changeAddresses()
test_case.identifier: changeAddresses
test_case.invocations: setConsistentHashing setConfiguration setAddressProvider createCache asList changeAddresses getAvailableServers assertEquals size assertEquals create verify getAddresses
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void changeAddresses()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(CacheFactory.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(CacheFactory.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: configuration = new CacheConfiguration()
focal_class.modifier: @Setter
      private
focal_class.original_string: @Setter
      private CacheConfiguration configuration = new CacheConfiguration();
focal_class.type: CacheConfiguration
focal_class.var_name: configuration
focal_class.declarator: addressProvider
focal_class.modifier: @Setter
      private
focal_class.original_string: @Setter
      private AddressProvider addressProvider;
focal_class.type: AddressProvider
focal_class.var_name: addressProvider
focal_class.declarator: cacheClientFactory
focal_class.modifier: @Setter
      private
focal_class.original_string: @Setter
      private CacheClientFactory cacheClientFactory;
focal_class.type: CacheClientFactory
focal_class.var_name: cacheClientFactory
focal_class.declarator: cacheName = AnnotationConstants.DEFAULT_CACHE_NAME
focal_class.modifier: @Setter
      private
focal_class.original_string: @Setter
      private String cacheName = AnnotationConstants.DEFAULT_CACHE_NAME;
focal_class.type: String
focal_class.var_name: cacheName
focal_class.declarator: cacheAliases = Collections.emptyList()
focal_class.modifier: @Setter
      private
focal_class.original_string: @Setter
      private Collection<String> cacheAliases = Collections.emptyList();
focal_class.type: Collection<String>
focal_class.var_name: cacheAliases
focal_class.declarator: cache
focal_class.modifier: private
focal_class.original_string: private Cache cache;
focal_class.type: Cache
focal_class.var_name: cache
focal_class.declarator: addressChangeNotifier
focal_class.modifier: @Setter
      private
focal_class.original_string: @Setter
      private AddressChangeNotifier addressChangeNotifier;
focal_class.type: AddressChangeNotifier
focal_class.var_name: addressChangeNotifier
focal_class.declarator: defaultSerializationType = SerializationType.PROVIDER
focal_class.modifier: @Setter
      private
focal_class.original_string: @Setter
      private SerializationType defaultSerializationType = SerializationType.PROVIDER;
focal_class.type: SerializationType
focal_class.var_name: defaultSerializationType
focal_class.declarator: jsonTranscoder
focal_class.modifier: @Setter
      private
focal_class.original_string: @Setter
      private JsonTranscoder jsonTranscoder;
focal_class.type: JsonTranscoder
focal_class.var_name: jsonTranscoder
focal_class.declarator: javaTranscoder
focal_class.modifier: @Setter
      private
focal_class.original_string: @Setter
      private JavaTranscoder javaTranscoder;
focal_class.type: JavaTranscoder
focal_class.var_name: javaTranscoder
focal_class.declarator: customTranscoder
focal_class.modifier: @Setter
      private
focal_class.original_string: @Setter
      private CacheTranscoder customTranscoder;
focal_class.type: CacheTranscoder
focal_class.var_name: customTranscoder
focal_class.declarator: initializeTranscoders = true
focal_class.modifier: @Setter
      private
focal_class.original_string: @Setter
      private boolean initializeTranscoders = true;
focal_class.type: boolean
focal_class.var_name: initializeTranscoders
focal_class.declarator: cacheBase
focal_class.modifier: @Autowired(required = false)
      private
focal_class.original_string: @Autowired(required = false)
      private CacheBase cacheBase;
focal_class.type: CacheBase
focal_class.var_name: cacheBase
focal_class.file: simple-spring-memcached/src/main/java/com/google/code/ssm/CacheFactory.java
focal_class.identifier: CacheFactory
focal_class.interfaces: implements AddressChangeListener, FactoryBean<Cache>, InitializingBean, DisposableBean
focal_class.class_method_signature: CacheFactory.afterPropertiesSet()
focal_class.full_signature: @Override public void afterPropertiesSet()
focal_class.identifier: afterPropertiesSet
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void afterPropertiesSet()
focal_class.class_method_signature: CacheFactory.getObject()
focal_class.full_signature: @Override public Cache getObject()
focal_class.identifier: getObject
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Cache
focal_class.signature: Cache getObject()
focal_class.class_method_signature: CacheFactory.getObjectType()
focal_class.full_signature: @Override public Class<?> getObjectType()
focal_class.identifier: getObjectType
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Class<?>
focal_class.signature: Class<?> getObjectType()
focal_class.class_method_signature: CacheFactory.isSingleton()
focal_class.full_signature: @Override public boolean isSingleton()
focal_class.identifier: isSingleton
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isSingleton()
focal_class.class_method_signature: CacheFactory.destroy()
focal_class.full_signature: @Override public void destroy()
focal_class.identifier: destroy
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void destroy()
focal_class.class_method_signature: CacheFactory.changeAddresses(final List<InetSocketAddress> addresses)
focal_class.full_signature: @Override public void changeAddresses(final List<InetSocketAddress> addresses)
focal_class.identifier: changeAddresses
focal_class.modifiers: @Override public
focal_class.parameters: (final List<InetSocketAddress> addresses)
focal_class.return: void
focal_class.signature: void changeAddresses(final List<InetSocketAddress> addresses)
focal_class.class_method_signature: CacheFactory.createCache()
focal_class.full_signature: protected Cache createCache()
focal_class.identifier: createCache
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: Cache
focal_class.signature: Cache createCache()
focal_class.class_method_signature: CacheFactory.isCacheDisabled()
focal_class.full_signature:  boolean isCacheDisabled()
focal_class.identifier: isCacheDisabled
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isCacheDisabled()
focal_class.class_method_signature: CacheFactory.createClient(final List<InetSocketAddress> addrs)
focal_class.full_signature: private CacheClient createClient(final List<InetSocketAddress> addrs)
focal_class.identifier: createClient
focal_class.modifiers: private
focal_class.parameters: (final List<InetSocketAddress> addrs)
focal_class.return: CacheClient
focal_class.signature: CacheClient createClient(final List<InetSocketAddress> addrs)
focal_class.class_method_signature: CacheFactory.validateTranscoder(final SerializationType serializationType, final CacheTranscoder cacheTranscoder,
              final String transcoderName)
focal_class.full_signature: private void validateTranscoder(final SerializationType serializationType, final CacheTranscoder cacheTranscoder,
              final String transcoderName)
focal_class.identifier: validateTranscoder
focal_class.modifiers: private
focal_class.parameters: (final SerializationType serializationType, final CacheTranscoder cacheTranscoder,
              final String transcoderName)
focal_class.return: void
focal_class.signature: void validateTranscoder(final SerializationType serializationType, final CacheTranscoder cacheTranscoder,
              final String transcoderName)
focal_method.body: @Override
      public void changeAddresses(final List<InetSocketAddress> addresses) {
          if (isCacheDisabled()) {
              LOGGER.warn("Cache {} is disabled", cacheName);
              return;
          }
  
          if (!(cache instanceof CacheImpl)) {
              LOGGER.warn("This client doesn't support changing memcached addresses on the fly");
              return;
          }
  
          try {
              LOGGER.info("Creating new memcached client for cache {} with new addresses: {}", cacheName, addresses);
              CacheClient memcacheClient = createClient(addresses);
              LOGGER.info("New memcached client for cache {} was created with addresses: {}", cacheName, addresses);
              ((CacheImpl)cache).changeCacheClient(memcacheClient);
          } catch (IOException e) {
              if (LOGGER.isErrorEnabled()) {
                  LOGGER.error(String.format("Cannot change memcached client to new one with addresses %s", addresses), e);
              }
          }
      }
focal_method.class_method_signature: CacheFactory.changeAddresses(final List<InetSocketAddress> addresses)
focal_method.full_signature: @Override public void changeAddresses(final List<InetSocketAddress> addresses)
focal_method.identifier: changeAddresses
focal_method.invocations: isCacheDisabled warn warn info createClient info changeCacheClient isErrorEnabled error format
focal_method.modifiers: @Override public
focal_method.parameters: (final List<InetSocketAddress> addresses)
focal_method.return: void
focal_method.signature: void changeAddresses(final List<InetSocketAddress> addresses)