* able to consume it). Otherwise {@link #doCreateConnectionParameters(Object)} will be called.
*/
@SuppressWarnings("unchecked")
@Override
public final Map<String, Serializable> createConnectionParameters( Object context ) {
ServiceExtension2 serviceExtension = getServiceExtension();
if( context instanceof URL){
URL url=(URL) context;
if( canProcess(serviceExtension, url) )
return serviceExtension.createParams(url);
}
if( context instanceof String){
// if the string cannot be processed we want to fall through so
// that doOtherChecks() can be called.
String string=(String) context;
try{
URL url=new URL(string);
if ( canProcess(serviceExtension, url) )
return serviceExtension.createParams(url);;
}catch (MalformedURLException e) {
// continue.
}
}
if (context instanceof Map) {
Map params = (Map) context;
if( canProcess(serviceExtension, params) )
return params;
}
URL locateURL = CatalogPlugin.locateURL(context);
if( locateURL!=null ){
if( canProcess(serviceExtension, locateURL))
return serviceExtension.createParams(locateURL);
}
return doCreateConnectionParameters(context);
}