'Adapt a :class:`.PoolListener` to individual
:class:`event.Dispatch` events.'

@classmethod
def _adapt_listener(cls, self, listener):

    listener = util.as_interface(listener, methods=('connect', 'first_connect', 'checkout', 'checkin'))
    if hasattr(listener, 'connect'):
        event.listen(self, 'connect', listener.connect)
    if hasattr(listener, 'first_connect'):
        event.listen(self, 'first_connect', listener.first_connect)
    if hasattr(listener, 'checkout'):
        event.listen(self, 'checkout', listener.checkout)
    if hasattr(listener, 'checkin'):
        event.listen(self, 'checkin', listener.checkin)
