*
* @return a {@link eu.etaxonomy.taxeditor.store.CdmStore} object.
*/
- protected static CdmStore getDefault() {
+ protected static CdmStore getDefault(boolean connecting){
if (instance != null && instance.isConnected) {
return instance;
} else{// if (instance == null || !instance.isConnected) {
-
- MessagingUtils.dataSourceNotAvailableWarningDialog(instance);
+ if (connecting){
+ MessagingUtils.dataSourceNotAvailableWarningDialog(instance);
+ }else{
+ MessagingUtils.noDataSourceWarningDialog(instance);
+ }
return null;
}
}
+ /**
+ * <p>
+ * getDefault
+ * </p>
+ *
+ * @return a {@link eu.etaxonomy.taxeditor.store.CdmStore} object.
+ */
+ protected static CdmStore getDefault(){
+ return getDefault(false);
+ }
/**
* Initialize the with the last edited datasource
if(isActive()) {
// before we connect we clear the entity caches and the sessions
CdmRemoteCacheManager.removeEntityCaches();
- if(getCurrentSessionManager() != null) {
- getCurrentSessionManager().disposeAll();
+ if(getCurrentSessionManager(true) != null) {
+ getCurrentSessionManager(true).disposeAll();
}
}
MessagingUtils.info("Connecting to datasource: " + cdmSource);
return mockCdmEntitySessionManager;
}
}
-
public static ICdmEntitySessionManager getCurrentSessionManager() {
- if (getDefault() != null) {
- return getDefault().getSessionManager();
+ return getCurrentSessionManager(false);
+ }
+
+
+ public static ICdmEntitySessionManager getCurrentSessionManager(boolean connecting) {
+ if (getDefault(connecting) != null) {
+ return getDefault(connecting).getSessionManager();
}
return null;