class ConnectionDisposeListener implements CacheEventListener {

    @Override
    public void notifyElementRemoved(final Ehcache cache, final Element element) throws CacheException {
        close(element);
    }

}