{
throw (Error) t;
}
else
{
throw new JPOXException(t.getMessage(), t).setFatal();
}
}
catch (Exception ex)
{
throw new JPOXException(ex.getMessage(), ex).setFatal();
}
JPOXLogger.JDO.info(">> Found StoreManager " + storeMgrClassName);
}
}
}
if (srm == null)
{
// No StoreManager of the specified type exists, so check plugins in CLASSPATH
throw new JPOXUserException(LOCALISER.msg("008004", storeManagerType)).setFatal();
}
}
if (srm == null)
{
// Try using the URL of the data source
String url = getOMFContext().getPersistenceConfiguration().getStringProperty("org.jpox.ConnectionURL");
if (url != null)
{
int idx = url.indexOf(':');
if (idx > -1)
{
url = url.substring(0, idx);
}
}
for (int e=0; srm == null && e<exts.length; e++)
{
ConfigurationElement[] confElm = exts[e].getConfigurationElements();
for (int c=0; srm == null && c<confElm.length; c++)
{
String urlKey = confElm[c].getAttribute("url-key");
if (url == null || urlKey.equalsIgnoreCase(url))
{
// Either no URL, or url defined so take this StoreManager
Class[] ctrArgTypes = new Class[] {ClassLoaderResolver.class, OMFContext.class};
Object[] ctrArgs = new Object[] {clr, getOMFContext()};
try
{
srm = (StoreManager) getOMFContext().getPluginManager().createExecutableExtension(
"org.jpox.store_manager", "url-key", url, "class-name", ctrArgTypes, ctrArgs);
}
catch (InvocationTargetException ex)
{
Throwable t = ex.getTargetException();
if (t instanceof RuntimeException)
{
throw (RuntimeException) t;
}
else if (t instanceof Error)
{
throw (Error) t;
}
else
{
throw new JPOXException(t.getMessage(), t).setFatal();
}
}
catch (Exception ex)
{
throw new JPOXException(ex.getMessage(), ex).setFatal();
}
}
}
}