public static void dispose(final ConnectorPoolKey connectorPoolKey) { synchronized (POOLS) { ObjectPool<PoolableConnector> pool = POOLS.remove(connectorPoolKey); if (null != pool) { try { pool.shutdown(); } catch (Exception e) { LOG.warn(e, "Failed to close pool: {0}", pool); } } } }
public static void dispose(final ConnectorPoolKey connectorPoolKey) { synchronized (POOLS) { ObjectPool<PoolableConnector> pool = POOLS.remove(connectorPoolKey); if (null != pool) { try { pool.shutdown(); } catch (Exception e) { LOG.warn(e, "Failed to close pool: {0}", pool); } } } }
/** * Dispose of an object, but don't throw any exceptions * * @param object */ private void disposeNoException(final T object) { try { _handler.disposeObject(object); } catch (Exception e) { LOG.warn(e, "disposeObject() is not supposed to throw"); } } }
public static void dispose() { synchronized (POOLS) { // close each pool.. for (ObjectPool<PoolableConnector> pool : POOLS.values()) { try { pool.shutdown(); } catch (Exception e) { LOG.warn(e, "Failed to close pool: {0}", pool); } } // clear the map of all _pools.. POOLS.clear(); } } }
public static void dispose() { synchronized (POOLS) { // close each pool.. POOLS.values().forEach(pool -> { try { pool.shutdown(); } catch (Exception e) { LOG.warn(e, "Failed to close pool: {0}", pool); } }); // clear the map of all POOLS.. POOLS.clear(); } } }
public static void dispose() { synchronized (POOLS) { // close each pool.. POOLS.values().forEach(pool -> { try { pool.shutdown(); } catch (Exception e) { LOG.warn(e, "Failed to close pool: {0}", pool); } }); // clear the map of all POOLS.. POOLS.clear(); } } }
public void dispose() { if (configuration instanceof StatefulConfiguration) { // dispose it not supposed to throw, but just in case, // catch the exception and log it so we know about it // but don't let the exception prevent additional // cleanup that needs to happen try { StatefulConfiguration config = (StatefulConfiguration) configuration; configuration = null; config.release(); } catch (Exception e) { // log this though LOG.warn(e, null); } } } }
public void dispose() { if (configuration instanceof StatefulConfiguration) { // dispose it not supposed to throw, but just in case, // catch the exception and log it so we know about it // but don't let the exception prevent additional // cleanup that needs to happen try { StatefulConfiguration config = (StatefulConfiguration) configuration; configuration = null; config.release(); } catch (Exception e) { // log this though LOG.warn(e, null); } } } }
private void initSnapshot() { // get snapshot output file, if provided String pOut = System.getProperty(PARAM_PROPERTY_OUT_FILE); if (StringUtil.isNotBlank(pOut)) { try { _propertyOutFile = new File(pOut); if (!_propertyOutFile.exists()) { _propertyOutFile.createNewFile(); } if (!_propertyOutFile.canWrite()) { _propertyOutFile = null; LOG.warn("Unable to write to ''{0}'' file, the test parameters will not be stored", pOut); } else { LOG.info("Storing parameter values to ''{0}'', you can rerun the test with the same parameters later", pOut); } } catch (IOException iOException) { LOG.warn("Unable to create ''{0}'' file, the test parameters will not be stored", pOut); } } }
private static List<URL> buildBundleURLs(File dir) throws MalformedURLException { List<URL> rv = getJarFiles(dir); if (rv.isEmpty()) { getLog().warn("No bundles found in the bundles directory"); } return rv; }
private static List<URL> buildBundleURLs(File dir) throws MalformedURLException { List<URL> rv = getJarFiles(dir); if (rv.isEmpty()) { getLog().warn("No bundles found in the bundles directory"); } return rv; }
private static List<URL> buildBundleURLs(File dir) throws MalformedURLException { List<URL> rv = getJarFiles(dir); if (rv.isEmpty()) { getLog().warn("No bundles found in the bundles directory"); } return rv; }
/** * Dispose of all object pools and other resources associated with this * class. */ @Override public void dispose() { super.dispose(); for (ConnectorFacade facade : CACHE.values()) { if (facade instanceof LocalConnectorFacadeImpl) { try { ((LocalConnectorFacadeImpl) facade).dispose(); } catch (Exception e) { LOG.warn(e, "Failed to dispose facade: {0}", facade); } } } CACHE.clear(); }
/** * Dispose of all object pools and other resources associated with this * class. */ @Override public void dispose() { super.dispose(); for (ConnectorFacade facade : CACHE.values()) { if (facade instanceof LocalConnectorFacadeImpl) { try { ((LocalConnectorFacadeImpl) facade).dispose(); } catch (Exception e) { LOG.warn(e, "Failed to dispose facade: {0}", facade); } } } CACHE.clear(); }
@Override public void fillConfiguration(final Configuration config, final Map<String, ? extends Object> configData) { final Map<String, Object> configDataCopy = new HashMap<>(configData); final ConfigurationPropertiesImpl configProps = JavaClassProperties.createConfigurationProperties(config); configProps.getPropertyNames().forEach(propName -> { // Remove the entry from the config map, so that at the end // the map only contains entries that were not assigned to a config property. final Object value = configDataCopy.remove(propName); if (value != null) { configProps.setPropertyValue(propName, value); } }); // The config map now contains entries that were not assigned to a config property. configDataCopy.keySet().forEach((propName) -> { LOG.warn("Configuration property {0} does not exist!", propName); }); JavaClassProperties.mergeIntoBean(configProps, config); }
@Override public void fillConfiguration(final Configuration config, final Map<String, ? extends Object> configData) { final Map<String, Object> configDataCopy = new HashMap<>(configData); final ConfigurationPropertiesImpl configProps = JavaClassProperties.createConfigurationProperties(config); configProps.getPropertyNames().forEach(propName -> { // Remove the entry from the config map, so that at the end // the map only contains entries that were not assigned to a config property. final Object value = configDataCopy.remove(propName); if (value != null) { configProps.setPropertyValue(propName, value); } }); // The config map now contains entries that were not assigned to a config property. configDataCopy.keySet().forEach((propName) -> { LOG.warn("Configuration property {0} does not exist!", propName); }); JavaClassProperties.mergeIntoBean(configProps, config); }
public void fillConfiguration(Configuration config, Map<String, ? extends Object> configData) { Map<String, Object> configDataCopy = new HashMap<String, Object>(configData); ConfigurationPropertiesImpl configProps = JavaClassProperties.createConfigurationProperties(config); for (String propName : configProps.getPropertyNames()) { // Remove the entry from the config map, so that at the end // the map only contains entries that were not assigned to a config property. Object value = configDataCopy.remove(propName); if (value != null) { configProps.setPropertyValue(propName, value); } } // The config map now contains entries that were not assigned to a config property. for (String propName : configDataCopy.keySet()) { _log.warn("Configuration property {0} does not exist!", propName); } JavaClassProperties.mergeIntoBean(configProps, config); }
/** * Creates connector facade, initializes connector configuration from dataProvider and validates configuration * and/or tests connection. */ public static ConnectorFacade createConnectorFacade(DataProvider dataProvider) { ConnectorFacade connector = createConnectorFacade(dataProvider, null); // try to test connector configuration and established connection if (connector.getSupportedOperations().contains(TestApiOp.class)) { connector.test(); } else { LOG.warn("Unable to test validity of connection. Connector does not suport the Test API. " + "Trying at least to test validity of configuration."); connector.validate(); } return connector; }
/** * Creates connector facade, initializes connector configuration from * dataProvider and validates configuration and/or tests connection. */ public static ConnectorFacade createConnectorFacade(DataProvider dataProvider) { ConnectorFacade connector = createConnectorFacade(dataProvider, null); // try to test connector configuration and established connection if (connector.getSupportedOperations().contains(TestApiOp.class)) { connector.test(); } else { LOG.warn("Unable to test validity of connection. Connector does not suport the Test API. " + "Trying at least to test validity of configuration."); connector.validate(); } return connector; }
/** * Creates connector facade, initializes connector configuration from * dataProvider and validates configuration and/or tests connection. */ public static ConnectorFacade createConnectorFacade(DataProvider dataProvider) { ConnectorFacade connector = createConnectorFacade(dataProvider, null); // try to test connector configuration and established connection if (connector.getSupportedOperations().contains(TestApiOp.class)) { connector.test(); } else { LOG.warn("Unable to test validity of connection. Connector does not suport the Test API. " + "Trying at least to test validity of configuration."); connector.validate(); } return connector; }