dustin/java-memcached-client — pull request #29 by mattbertolini (2014-12-08 21:09:03+00:00)
Title: Update Spring FactoryBean to property support isSingleton property and add shutdown method

According to the Spring ```FactoryBean``` documentation the ```isSingleton()``` method specifies that the bean should return the same reference every time. As per Spring javadoc:

> Is the object managed by this factory a singleton? That is, will getObject() always return the same object (a reference that can be cached)?

> NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The ```MemcachedClientFactoryBean``` was creating a new instance with every call to ```getObject()```. I have changed the implementation to hold an instance so the same reference is always returned.

This also allows the class to expose a shutdown method that will cleanly shut down the client. This wasn't possible beforehand which made it much more difficult to shut down a Spring-managed ```MemcachedClient```.