use of org.apache.qpid.server.protocol.ConnectionClosingTicker in project qpid-broker-j by apache.
the class ServerConnection method setState.
protected void setState(State state) {
synchronized (lock) {
this.state = state;
lock.notifyAll();
}
if (state == State.CLOSING) {
long timeoutTime = System.currentTimeMillis() + getAmqpConnection().getContextValue(Long.class, org.apache.qpid.server.model.Connection.CLOSE_RESPONSE_TIMEOUT);
getAmqpConnection().getAggregateTicker().addTicker(new ConnectionClosingTicker(timeoutTime, (ServerNetworkConnection) getNetworkConnection()));
// trigger a wakeup to ensure the ticker will be taken into account
getAmqpConnection().notifyWork();
}
}
use of org.apache.qpid.server.protocol.ConnectionClosingTicker in project qpid-broker-j by apache.
the class AMQPConnection_1_0Impl method addCloseTicker.
private void addCloseTicker() {
long timeoutTime = System.currentTimeMillis() + getContextValue(Long.class, Connection.CLOSE_RESPONSE_TIMEOUT);
getAggregateTicker().addTicker(new ConnectionClosingTicker(timeoutTime, getNetwork()));
// trigger a wakeup to ensure the ticker will be taken into account
notifyWork();
}
use of org.apache.qpid.server.protocol.ConnectionClosingTicker in project qpid-broker-j by apache.
the class AMQPConnection_0_8Impl method sendConnectionClose.
private void sendConnectionClose(int channelId, AMQFrame frame) {
if (_orderlyClose.compareAndSet(false, true)) {
try {
markChannelAwaitingCloseOk(channelId);
completeAndCloseAllChannels();
} finally {
try {
writeFrame(frame);
} finally {
final long timeoutTime = System.currentTimeMillis() + getContextValue(Long.class, Connection.CLOSE_RESPONSE_TIMEOUT);
getAggregateTicker().addTicker(new ConnectionClosingTicker(timeoutTime, getNetwork()));
// trigger a wakeup to ensure the ticker will be taken into account
notifyWork();
}
}
}
}
Aggregations