Add cache object type check.

setNamespace() is a method of CacheProvider.