Define 'getListeners' function as static method on path.