code: public static IConnection getConnectionLocal() {
          WeakReference<IConnection> ref = connThreadLocal.get();
          if (ref != null) {
              IConnection connection = ref.get();
              log.debug("Get connection: {} on thread: {}", (connection != null ? connection.getSessionId() : null), Thread.currentThread().getName());
              return connection;
          } else {
              return null;
          }
      }
docs: Get the connection associated with the current thread. This method allows you to get connection object local to current thread. When you need to get a connection associated with event handler and so forth, this method provides you with it.
  
  @return Connection object