public TesterItemsPersistenceListener(SessionImpl session) { this.dataManager = (PersistentDataManager) ((ManageableRepository) session.getRepository()) .getWorkspaceContainer(session.getWorkspace().getName()) .getComponent(PersistentDataManager.class); this.dataManager.addItemPersistenceListener(this); }
/** * Checks if this <code>QueryManagerImpl</code> instance is still usable, otherwise throws a * {@link javax.jcr.RepositoryException}. * * @throws RepositoryException if this query manager is not usable anymore, e.g. the corresponding * session is closed. */ private void sanityCheck() throws RepositoryException { if (!session.isLive()) { throw new RepositoryException("corresponding session has been closed"); } }