I'd use \OCP\Util::connectHook and the same for emit. Unfortunately there is no public implementation for clear, so just change those two. Reason: I heard that at some point apps wont be permitted to be activated if they use internal classes.
https://github.com/owncloud/core/blob/master/lib/public/util.php#L311