本文整理了Java中org.apache.activemq.broker.Broker.removeConnection()
方法的一些代码示例,展示了Broker.removeConnection()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Broker.removeConnection()
方法的具体详情如下:
包路径:org.apache.activemq.broker.Broker
类名称:Broker
方法名:removeConnection
[英]A client is disconnecting from the broker.
[中]客户端正在断开与代理的连接。
代码示例来源:origin: apache/activemq
@Override
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
next.removeConnection(context, info, error);
Broker brokers[] = getListeners();
for (int i = 0; i < brokers.length; i++) {
brokers[i].removeConnection(context, info, error);
}
}
代码示例来源:origin: apache/activemq
@Override
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
getNext().removeConnection(context, info, error);
}
代码示例来源:origin: apache/activemq
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
for (Iterator<Transaction> iter = context.getTransactions().values().iterator(); iter.hasNext();) {
try {
Transaction transaction = iter.next();
transaction.rollback();
} catch (Exception e) {
LOG.warn("ERROR Rolling back disconnected client's transactions: ", e);
}
iter.remove();
}
synchronized (xaTransactions) {
// first find all txs that belongs to the connection
ArrayList<XATransaction> txs = new ArrayList<XATransaction>();
for (XATransaction tx : xaTransactions.values()) {
if (tx.getConnectionId() != null && tx.getConnectionId().equals(info.getConnectionId()) && !tx.isPrepared()) {
txs.add(tx);
}
}
// then remove them
// two steps needed to avoid ConcurrentModificationException, from removeTransaction()
for (XATransaction tx : txs) {
try {
tx.rollback();
} catch (Exception e) {
LOG.warn("ERROR Rolling back disconnected client's xa transactions: ", e);
}
}
}
next.removeConnection(context, info, error);
}
代码示例来源:origin: apache/activemq
broker.removeConnection(cs.getContext(), cs.getInfo(), transportException.get());
} catch (Throwable e) {
SERVICELOG.warn("Failed to remove connection {}", cs.getInfo(), e);
代码示例来源:origin: pierre/meteo
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
next.removeConnection(context, info, error);
}
代码示例来源:origin: org.apache.activemq/activemq-all
@Override
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
next.removeConnection(context, info, error);
Broker brokers[] = getListeners();
for (int i = 0; i < brokers.length; i++) {
brokers[i].removeConnection(context, info, error);
}
}
代码示例来源:origin: org.apache.activemq/activemq-broker
@Override
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
next.removeConnection(context, info, error);
Broker brokers[] = getListeners();
for (int i = 0; i < brokers.length; i++) {
brokers[i].removeConnection(context, info, error);
}
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
@Override
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
next.removeConnection(context, info, error);
Broker brokers[] = getListeners();
for (int i = 0; i < brokers.length; i++) {
brokers[i].removeConnection(context, info, error);
}
}
代码示例来源:origin: pierre/meteo
@Override
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
next.removeConnection(context, info, error);
Broker brokers[] = getListeners();
for (int i = 0; i < brokers.length; i++) {
brokers[i].removeConnection(context, info, error);
}
}
代码示例来源:origin: org.apache.activemq/activemq-broker
@Override
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
getNext().removeConnection(context, info, error);
}
代码示例来源:origin: org.apache.activemq/activemq-all
@Override
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
getNext().removeConnection(context, info, error);
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
@Override
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
getNext().removeConnection(context, info, error);
}
代码示例来源:origin: pierre/meteo
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
getNext().removeConnection(context, info, error);
}
代码示例来源:origin: org.apache.activemq/activemq-broker
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
for (Iterator<Transaction> iter = context.getTransactions().values().iterator(); iter.hasNext();) {
try {
Transaction transaction = iter.next();
transaction.rollback();
} catch (Exception e) {
LOG.warn("ERROR Rolling back disconnected client's transactions: ", e);
}
iter.remove();
}
synchronized (xaTransactions) {
// first find all txs that belongs to the connection
ArrayList<XATransaction> txs = new ArrayList<XATransaction>();
for (XATransaction tx : xaTransactions.values()) {
if (tx.getConnectionId() != null && tx.getConnectionId().equals(info.getConnectionId()) && !tx.isPrepared()) {
txs.add(tx);
}
}
// then remove them
// two steps needed to avoid ConcurrentModificationException, from removeTransaction()
for (XATransaction tx : txs) {
try {
tx.rollback();
} catch (Exception e) {
LOG.warn("ERROR Rolling back disconnected client's xa transactions: ", e);
}
}
}
next.removeConnection(context, info, error);
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
for (Iterator<Transaction> iter = context.getTransactions().values().iterator(); iter.hasNext();) {
try {
Transaction transaction = iter.next();
transaction.rollback();
} catch (Exception e) {
LOG.warn("ERROR Rolling back disconnected client's transactions: ", e);
}
iter.remove();
}
synchronized (xaTransactions) {
// first find all txs that belongs to the connection
ArrayList<XATransaction> txs = new ArrayList<XATransaction>();
for (XATransaction tx : xaTransactions.values()) {
if (tx.getConnectionId() != null && tx.getConnectionId().equals(info.getConnectionId()) && !tx.isPrepared()) {
txs.add(tx);
}
}
// then remove them
// two steps needed to avoid ConcurrentModificationException, from removeTransaction()
for (XATransaction tx : txs) {
try {
tx.rollback();
} catch (Exception e) {
LOG.warn("ERROR Rolling back disconnected client's xa transactions: ", e);
}
}
}
next.removeConnection(context, info, error);
}
代码示例来源:origin: pierre/meteo
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
for (Iterator<Transaction> iter = context.getTransactions().values().iterator(); iter.hasNext();) {
try {
Transaction transaction = iter.next();
transaction.rollback();
} catch (Exception e) {
LOG.warn("ERROR Rolling back disconnected client's transactions: ", e);
}
iter.remove();
}
synchronized (xaTransactions) {
// first find all txs that belongs to the connection
ArrayList<XATransaction> txs = new ArrayList<XATransaction>();
for (XATransaction tx : xaTransactions.values()) {
if (tx.getConnectionId().equals(info.getConnectionId()) && !tx.isPrepared()) {
txs.add(tx);
}
}
// then remove them
// two steps needed to avoid ConcurrentModificationException, from removeTransaction()
for (XATransaction tx : txs) {
try {
tx.rollback();
} catch (Exception e) {
LOG.warn("ERROR Rolling back disconnected client's xa transactions: ", e);
}
}
}
next.removeConnection(context, info, error);
}
代码示例来源:origin: org.apache.activemq/activemq-all
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
for (Iterator<Transaction> iter = context.getTransactions().values().iterator(); iter.hasNext();) {
try {
Transaction transaction = iter.next();
transaction.rollback();
} catch (Exception e) {
LOG.warn("ERROR Rolling back disconnected client's transactions: ", e);
}
iter.remove();
}
synchronized (xaTransactions) {
// first find all txs that belongs to the connection
ArrayList<XATransaction> txs = new ArrayList<XATransaction>();
for (XATransaction tx : xaTransactions.values()) {
if (tx.getConnectionId() != null && tx.getConnectionId().equals(info.getConnectionId()) && !tx.isPrepared()) {
txs.add(tx);
}
}
// then remove them
// two steps needed to avoid ConcurrentModificationException, from removeTransaction()
for (XATransaction tx : txs) {
try {
tx.rollback();
} catch (Exception e) {
LOG.warn("ERROR Rolling back disconnected client's xa transactions: ", e);
}
}
}
next.removeConnection(context, info, error);
}
代码示例来源:origin: org.apache.activemq/activemq-broker
broker.removeConnection(cs.getContext(), cs.getInfo(), transportException.get());
} catch (Throwable e) {
SERVICELOG.warn("Failed to remove connection {}", cs.getInfo(), e);
代码示例来源:origin: org.apache.activemq/activemq-all
broker.removeConnection(cs.getContext(), cs.getInfo(), transportException.get());
} catch (Throwable e) {
SERVICELOG.warn("Failed to remove connection {}", cs.getInfo(), e);
代码示例来源:origin: org.apache.activemq/activemq-osgi
broker.removeConnection(cs.getContext(), cs.getInfo(), transportException.get());
} catch (Throwable e) {
SERVICELOG.warn("Failed to remove connection {}", cs.getInfo(), e);
内容来源于网络,如有侵权,请联系作者删除!