scheduledcollectionaction.java

来自「用Java实现的23个常用设计模式源代码」· Java 代码 · 共 56 行

JAVA
56
字号
//$Id: ScheduledCollectionAction.java,v 1.7.2.7 2003/11/27 16:09:59 oneovthafew Exp $package net.sf.hibernate.impl;import java.io.Serializable;import net.sf.hibernate.cache.CacheException;import net.sf.hibernate.cache.CacheConcurrencyStrategy.SoftLock;import net.sf.hibernate.collection.CollectionPersister;import net.sf.hibernate.engine.SessionImplementor;import net.sf.hibernate.impl.SessionImpl.Executable;abstract class ScheduledCollectionAction implements Executable {		private final CollectionPersister persister;	private final Serializable id;	private final SessionImplementor session;	private SoftLock lock;		protected void setLock(SoftLock lock) {		this.lock = lock;	}		public ScheduledCollectionAction(CollectionPersister persister, Serializable id, SessionImplementor session) {		this.persister = persister;		this.session = session;		this.id = id;	}		public void afterTransactionCompletion(boolean success) throws CacheException {		if ( persister.hasCache() ) persister.getCache().release(id, lock);	}		public Serializable[] getPropertySpaces() {		return new Serializable[] { persister.getCollectionSpace() };	}	protected final CollectionPersister getPersister() {		return persister;	}	protected final Serializable getId() {		return id;	}	protected final SessionImplementor getSession() {		return session;	}	}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?