@Override public void close() { _datastoreConnection.close(); }
@Override public void close() { if (_datastoreConnection != null) { _datastoreConnection.close(); } }
@Override public void close() { _datastoreConnection.close(); }
@Override public void close() { final boolean changed = _closed.compareAndSet(false, true); if (changed) { _delegate.close(); } else { logger.warn("Connection is already closed, but close() was invoked!", new Throwable()); } }
private DatastoreConnection setDatastoreConnection(final DatastoreConnection datastoreConnection) { if (_datastoreConnection != null) { // close the previous data context provider _datastoreConnection.close(); } _datastoreConnection = datastoreConnection; setIndentation(); return _datastoreConnection; }
@Override public void removeNotify() { super.removeNotify(); if (_datastoreConnection != null) { // close the data context provider when the widget is removed _datastoreConnection.close(); } } }
@Close public void close() { if (lookupQuery != null) { lookupQuery.close(); lookupQuery = null; } if (datastore != null) { datastoreConnection.close(); datastoreConnection = null; } cache.invalidateAll(); queryOutputColumns = null; queryConditionColumns = null; }
private void openConnection(final Datastore datastore) { if (_connection != null && _connection.getDatastore() == datastore) { return; } if (_connection != null) { _connection.close(); _connection = null; } if (datastore != null) { try { _connection = datastore.openConnection(); } catch (final Exception e) { logger.warn("Could not open connection to datastore: {}", datastore); } } }
public AnalysisJobBuilder setDatastoreConnection(final DatastoreConnection datastoreConnection) { if (_datastoreConnection != null) { _datastoreConnection.close(); } _datastoreConnection = datastoreConnection; if (datastoreConnection != null && _datastore == null) { final Datastore datastore = datastoreConnection.getDatastore(); if (datastore != null) { setDatastore(datastore); } } return this; }
public Column getColumn(final DatastoreConnection datastoreConnection) { try { final Column column = datastoreConnection.getDataContext().getColumnByQualifiedLabel(_qualifiedColumnName); if (column == null) { throw new NoSuchColumnException(_qualifiedColumnName); } return column; } catch (final RuntimeException e) { datastoreConnection.close(); throw e; } }
@Override public void removeNotify() { super.removeNotify(); _configuration.getEnvironment().getDescriptorProvider().removeListener(this); final MouseListener[] mouseListeners = getMouseListeners(); for (final MouseListener mouseListener : mouseListeners) { removeMouseListener(mouseListener); } _datastoreConnection.close(); }
private void printSchemas(final DataCleanerConfiguration configuration) { final String datastoreName = _arguments.getDatastoreName(); if (datastoreName == null) { System.err.println("You need to specify the datastore name!"); } else { final Datastore ds = configuration.getDatastoreCatalog().getDatastore(datastoreName); if (ds == null) { System.err.println("No such datastore: " + datastoreName); } else { final DatastoreConnection con = ds.openConnection(); final List<String> schemaNames = con.getDataContext().getSchemaNames(); if (schemaNames == null || schemaNames.isEmpty()) { write("No schemas in datastore!"); } else { write("Schemas:"); write("--------"); for (final String schemaName : schemaNames) { write(schemaName); } } con.close(); } } }
private void cleanupForWindowClose() { _analysisJobChangeListener.onDeactivation(_analysisJobBuilder); _analysisJobBuilder.close(); if (_datastoreConnection != null) { _datastoreConnection.close(); } //Remove the reference data listener _mutableReferenceCatalog.removeStringPatternListener(_stringPatternChangeListener); _mutableReferenceCatalog.removeDictionaryListener(_dictionaryChangeListener); _mutableReferenceCatalog.removeSynonymCatalogListener(_synonymCatalogListener); getContentPane().removeAll(); }
@Override public SynonymCatalogConnection openConnection(final DataCleanerConfiguration configuration) { final Datastore datastore = configuration.getDatastoreCatalog().getDatastore(_datastoreName); if (datastore == null) { throw new NoSuchDatastoreException(_datastoreName); } final DatastoreConnection datastoreConnection = datastore.openConnection(); if (_loadIntoMemory) { final SimpleSynonymCatalog simpleSynonymCatalog = loadIntoMemory(datastoreConnection); // no need for the connection anymore datastoreConnection.close(); return simpleSynonymCatalog.openConnection(configuration); } return new DatastoreSynonymCatalogConnection(this, datastoreConnection); }
@Override public DictionaryConnection openConnection(final DataCleanerConfiguration configuration) { final Datastore datastore = configuration.getDatastoreCatalog().getDatastore(_datastoreName); if (datastore == null) { throw new NoSuchDatastoreException(_datastoreName); } final DatastoreConnection datastoreConnection = datastore.openConnection(); if (_loadIntoMemory) { final SimpleDictionary simpleDictionary = loadIntoMemory(datastoreConnection); // no need for the connection anymore datastoreConnection.close(); return simpleDictionary.openConnection(configuration); } return new DatastoreDictionaryConnection(this, datastoreConnection); }
_datastoreConnection.close();
datastoreConnection.close();