}
protected void integratePersistentState(ObjectInputStream in, Fqn targetFqn) throws Exception
{
CacheLoaderManager loaderManager = cache.getCacheLoaderManager();
CacheLoader loader = loaderManager == null ? null : loaderManager.getCacheLoader();
if (loader == null)
{
if (trace)
{
log.trace("cache loader is null, will not attempt to integrate persistent state");
}
}
else
{
if (trace)
{
log.trace("integrating persistent state using " + loader.getClass().getName());
}
boolean persistentSet = false;
try
{
if (targetFqn.isRoot())
{
loader.storeEntireState(in);
}
else
{
loader.storeState(targetFqn, in);
}
persistentSet = true;
}
catch (ClassCastException cce)
{
log.error("Failed integrating persistent state. One of cacheloaders is not"
+ " adhering to state stream format. See JBCACHE-738.");
throw cce;
}
finally
{
if (!persistentSet)
{
log.warn("persistent state integration failed, removing all nodes from loader");
loader.remove(targetFqn);
}
else
{
if (trace)
{