You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by "dschneider-pivotal (GitHub)" <gi...@apache.org> on 2018/12/05 01:31:12 UTC

[GitHub] [geode] dschneider-pivotal commented on pull request #2918: GEODE-6102: add gfsh destroy data-source

Another complication: when you call JNDIInvoker.getDataSource() it when return null for things that do exist (i.e. were created by create jndi-binding) but that can not be used as a "DataSource". It will also return null if it does not exist. In this context I think you need to know that the given name exists in the "dataSourceMap" but that it is not an instance of DataSource. If that is true then you can't destroy it but need to tell them to use destroy jndi-binding. No need to do the instanceof checks. You could add a method on JNDIInvoker like this:
public boolean existsInDataSourceMap(String name) {
  return dataSourceMap.containsKey(name);
}
You could then use this method to figure out if getting null back from getDataSource means it does not exist at all or if it exists but is not a "DataSource".

[ Full content available at: https://github.com/apache/geode/pull/2918 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org