class L2CacheEvictingInstanceLifecycleListener implements DeleteLifecycleListener, StoreLifecycleListener {

    private final QueryManager qm;

    public L2CacheEvictingInstanceLifecycleListener(final QueryManager qm) {
        this.qm = qm;
    }

    @Override
    public void preDelete(final InstanceLifecycleEvent event) {
    }

    @Override
    public void postDelete(final InstanceLifecycleEvent event) {
        evictFromL2Cache(qm, event.getPersistentInstance());
    }

    @Override
    public void preStore(final InstanceLifecycleEvent event) {
    }

    @Override
    public void postStore(final InstanceLifecycleEvent event) {<FILL_FUNCTION_BODY>}

}

        final Object instance = event.getPersistentInstance();
        if (JDOHelper.isDirty(instance)) {
            evictFromL2Cache(qm, instance);
        }
    
<no_super_class>