Search in sources :

Example 1 with ServerNetworkConnection

use of org.apache.qpid.server.transport.ServerNetworkConnection 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();
    }
}
Also used : ServerNetworkConnection(org.apache.qpid.server.transport.ServerNetworkConnection) AtomicLong(java.util.concurrent.atomic.AtomicLong) ConnectionClosingTicker(org.apache.qpid.server.protocol.ConnectionClosingTicker)

Aggregations

AtomicLong (java.util.concurrent.atomic.AtomicLong)1 ConnectionClosingTicker (org.apache.qpid.server.protocol.ConnectionClosingTicker)1 ServerNetworkConnection (org.apache.qpid.server.transport.ServerNetworkConnection)1