}
schemaLock.readLock().lock();
try
{
StoreData sd = storeDataMgr.get(className);
if (sd != null && sd instanceof MappedStoreData)
{
ct = (DatastoreClass) ((MappedStoreData)sd).getDatastoreContainerObject();
if (ct != null)
{
// Class known about
return ct;
}
}
}
finally
{
schemaLock.readLock().unlock();
}
// Class not known so consider adding it to our list of supported classes.
// Currently we only consider PC classes
boolean toBeAdded = false;
if (clr != null)
{
Class cls = clr.classForName(className);
ApiAdapter api = getApiAdapter();
if (cls != null && !cls.isInterface() && api.isPersistable(cls))
{
toBeAdded = true;
}
}
else
{
toBeAdded = true;
}
boolean classKnown = false;
if (toBeAdded)
{
// Add the class to our supported list
addClass(className, clr);
// Retry
schemaLock.readLock().lock();
try
{
StoreData sd = storeDataMgr.get(className);
if (sd != null && sd instanceof MappedStoreData)
{
classKnown = true;
ct = (DatastoreClass) ((MappedStoreData)sd).getDatastoreContainerObject();
}