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 void stop() { for (RemotingConnection connection : connectionMap.values()) { connection.destroy(); } }
public void stop() { for (RemotingConnection connection : connectionMap.values()) { connection.destroy(); } }
public void stop() { for (RemotingConnection connection : connectionMap.values()) { connection.destroy(); } }
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; } }
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; } }
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; } }
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; } }
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; } }
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 void stop(boolean clearTokens) throws Exception { synchronized (this) { if (!started) { logger.trace("Stopping being ignored as it hasn't been started"); return; } started = false; } if (logger.isTraceEnabled()) { logger.trace("stop(clearTokens=" + clearTokens + ")", new Exception("Trace")); } // This is to avoid the write holding a lock while we are trying to close it if (replicatingChannel != null) { replicatingChannel.close(); replicatingChannel.getConnection().getTransportConnection().fireReady(true); } enabled = false; if (clearTokens) { clearReplicationTokens(); } RemotingConnection toStop = remotingConnection; if (toStop != null) { toStop.removeFailureListener(failureListener); toStop.destroy(); } remotingConnection = null; }
@Test public void testRestartWithTXPrepareDeletedQueue() throws Exception { ClientSession clientSession2 = sessionFactory.createSession(false, true, true); ClientProducer clientProducer = clientSession2.createProducer(atestq); ClientMessage m1 = createTextMessage(clientSession2, "m1"); clientProducer.send(m1); Xid xid = newXID(); clientSession.start(xid, XAResource.TMNOFLAGS); clientSession.start(); ClientConsumer clientConsumer = clientSession.createConsumer(atestq); ClientMessage message = clientConsumer.receive(5000); message.acknowledge(); clientSession.end(xid, XAResource.TMSUCCESS); clientSession.prepare(xid); clientSession.getSessionFactory().getConnection().destroy(); messagingService.destroyQueue(atestq); messagingService.stop(); messagingService.start(); messagingService.waitForActivation(10, TimeUnit.SECONDS); assertTrue(messagingService.isStarted()); }