protected Connection openTransportConnection(final Connector connector) { connector.start(); Connection transportConnection = connector.createConnection(); if (transportConnection == null) { if (logger.isDebugEnabled()) { logger.debug("Connector towards " + connector + " failed"); } try { connector.close(); } catch (Throwable t) { } } return transportConnection; }
public TransportConfiguration getBackupForConnector(final Connector connector) { for (TopologyMemberImpl member : topology.values()) { if (member.getLive() != null && connector.isEquivalent(member.getLive().getParams())) { return member.getBackup(); } } return null; }
private void checkCloseConnection() { RemotingConnection connectionInUse = connection; Connector connectorInUse = connector; if (connectionInUse != null && sessions.size() == 0) { cancelScheduledTasks(); try { connectionInUse.destroy(); } catch (Throwable ignore) { } connection = null; try { if (connectorInUse != null) { connectorInUse.close(); } } catch (Throwable ignore) { } connector = null; } }
connector.close(); } catch (Throwable t) {
protected Connection openTransportConnection(final Connector connector) { connector.start(); Connection transportConnection = connector.createConnection(); if (transportConnection == null) { if (logger.isDebugEnabled()) { logger.debug("Connector towards " + connector + " failed"); } try { connector.close(); } catch (Throwable t) { } } return transportConnection; }
if (localConnector != null) { try { localConnector.close(); } catch (Exception ignore) {
@Override public void setBackupConnector(final TransportConfiguration live, final TransportConfiguration backUp) { Connector localConnector = connector; // if the connector has never been used (i.e. the getConnection hasn't been called yet), we will need // to create a connector just to validate if the parameters are ok. // so this will create the instance to be used on the isEquivalent check if (localConnector == null) { localConnector = connectorFactory.createConnector(currentConnectorConfig.getParams(), new DelegatingBufferHandler(), this, closeExecutor, threadPool, scheduledThreadPool, clientProtocolManager); } if (localConnector.isEquivalent(live.getParams()) && backUp != null && !localConnector.isEquivalent(backUp.getParams())) { if (logger.isDebugEnabled()) { logger.debug("Setting up backup config = " + backUp + " for live = " + live); } backupConfig = backUp; } else { if (logger.isDebugEnabled()) { logger.debug("ClientSessionFactoryImpl received backup update for live/backup pair = " + live + " / " + backUp + " but it didn't belong to " + currentConnectorConfig); } } }
protected Connection openTransportConnection(final Connector connector) { connector.start(); Connection transportConnection = connector.createConnection(); if (transportConnection == null) { if (logger.isDebugEnabled()) { logger.debug("Connector towards " + connector + " failed"); } try { connector.close(); } catch (Throwable t) { } } return transportConnection; }
private void checkCloseConnection() { RemotingConnection connectionInUse = connection; Connector connectorInUse = connector; if (connectionInUse != null && sessions.size() == 0) { cancelScheduledTasks(); try { connectionInUse.destroy(); } catch (Throwable ignore) { } connection = null; try { if (connectorInUse != null) { connectorInUse.close(); } } catch (Throwable ignore) { } connector = null; } }
public TransportConfiguration getBackupForConnector(final Connector connector) { for (TopologyMemberImpl member : topology.values()) { if (member.getLive() != null && connector.isEquivalent(member.getLive().getParams())) { return member.getBackup(); } } return null; }
protected Connection openTransportConnection(final Connector connector) { connector.start(); Connection transportConnection = connector.createConnection(); if (transportConnection == null) { if (logger.isDebugEnabled()) { logger.debug("Connector towards " + connector + " failed"); } try { connector.close(); } catch (Throwable t) { } } return transportConnection; }
private void checkCloseConnection() { RemotingConnection connectionInUse = connection; Connector connectorInUse = connector; if (connectionInUse != null && sessions.size() == 0) { cancelScheduledTasks(); try { connectionInUse.destroy(); } catch (Throwable ignore) { } connection = null; try { if (connectorInUse != null) { connectorInUse.close(); } } catch (Throwable ignore) { } connector = null; } }
public TransportConfiguration getBackupForConnector(final Connector connector) { for (TopologyMemberImpl member : topology.values()) { if (member.getLive() != null && connector.isEquivalent(member.getLive().getParams())) { return member.getBackup(); } } return null; }
protected Connection openTransportConnection(final Connector connector) { connector.start(); Connection transportConnection = connector.createConnection(); if (transportConnection == null) { if (logger.isDebugEnabled()) { logger.debug("Connector towards " + connector + " failed"); } try { connector.close(); } catch (Throwable t) { } } return transportConnection; }
private void checkCloseConnection() { RemotingConnection connectionInUse = connection; Connector connectorInUse = connector; if (connectionInUse != null && sessions.size() == 0) { cancelScheduledTasks(); try { connectionInUse.destroy(); } catch (Throwable ignore) { } connection = null; try { if (connectorInUse != null) { connectorInUse.close(); } } catch (Throwable ignore) { } connector = null; } }
public TransportConfiguration getBackupForConnector(final Connector connector) { for (TopologyMemberImpl member : topology.values()) { if (member.getLive() != null && connector.isEquivalent(member.getLive().getParams())) { return member.getBackup(); } } return null; }
protected Connection openTransportConnection(final Connector connector) { connector.start(); Connection transportConnection = connector.createConnection(); if (transportConnection == null) { if (logger.isDebugEnabled()) { logger.debug("Connector towards " + connector + " failed"); } try { connector.close(); } catch (Throwable t) { } } return transportConnection; }
private void checkCloseConnection() { RemotingConnection connectionInUse = connection; Connector connectorInUse = connector; if (connectionInUse != null && sessions.size() == 0) { cancelScheduledTasks(); try { connectionInUse.destroy(); } catch (Throwable ignore) { } connection = null; try { if (connectorInUse != null) { connectorInUse.close(); } } catch (Throwable ignore) { } connector = null; } }
public TransportConfiguration getBackupForConnector(final Connector connector) { for (TopologyMemberImpl member : topology.values()) { if (member.getLive() != null && connector.isEquivalent(member.getLive().getParams())) { return member.getBackup(); } } return null; }
protected Connection openTransportConnection(final Connector connector) { connector.start(); Connection transportConnection = connector.createConnection(); if (transportConnection == null) { if (logger.isDebugEnabled()) { logger.debug("Connector towards " + connector + " failed"); } try { connector.close(); } catch (Throwable t) { } } return transportConnection; }