@Override
            public void onComplete(AsyncEvent asyncEvent) {
                Log.trace("Session {} Request ID {}, event complete: {}", streamID, rid, asyncEvent);
                synchronized (connectionQueue) {
                    if (connectionQueue.remove(connection) || !connection.isClosed()) {
                        Log.warn("Discovered a 'complete' event for a BOSH connection that has not been consumed (for session {} with Request ID {}, was closed: {}). This likely is a bug in Openfire.", streamID, rid, connection.isClosed());
                    }
                }
                lastActivity = Instant.now();
                SessionEventDispatcher.dispatchEvent( HttpSession.this, SessionEventDispatcher.EventType.connection_closed, connection, context );
            }
Creates a new connection on this session.

@param body the body element that was sent containing the request for a new session.
@param context the context of the asynchronous servlet call leading up to this method call.
@return the created {@link HttpConnection} which represents the connection.
xmppserver/src/main/java/org/jivesoftware/openfire/http/HttpSession.java