@Override public void connectionCreated(final ActiveMQComponent component, final Connection connection, final ProtocolManager protocol) { if (server == null) { throw new IllegalStateException("Unable to create connection, server hasn't finished starting up"); } ConnectionEntry entry = protocol.createConnectionEntry((Acceptor) component, connection); try { if (server.hasBrokerConnectionPlugins()) { server.callBrokerConnectionPlugins(plugin -> plugin.afterCreateConnection(entry.connection)); } } catch (ActiveMQException t) { logger.warn("Error executing afterCreateConnection plugin method: {}", t.getMessage(), t); throw new IllegalStateException(t.getMessage(), t.getCause()); } if (logger.isTraceEnabled()) { logger.trace("Connection created " + connection); } connections.put(connection.getID(), entry); connectionCountLatch.countUp(); totalConnectionCount.incrementAndGet(); }