本文整理汇总了Java中org.seasar.framework.util.DisposableUtil类的典型用法代码示例。如果您正苦于以下问题:Java DisposableUtil类的具体用法?Java DisposableUtil怎么用?Java DisposableUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DisposableUtil类属于org.seasar.framework.util包,在下文中一共展示了DisposableUtil类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAutoSelectSql
import org.seasar.framework.util.DisposableUtil; //导入依赖的package包/类
/**
* @see org.seasar.dao.Dbms#getAutoSelectSql(org.seasar.dao.BeanMetaData)
*/
public String getAutoSelectSql(BeanMetaData beanMetaData) {
if (!initialized) {
DisposableUtil.add(this);
initialized = true;
}
StringBuffer buf = new StringBuffer(100);
buf.append(beanMetaData.getAutoSelectList());
buf.append(" ");
String beanName = beanMetaData.getBeanClass().getName();
synchronized (autoSelectFromClauseCache) {
String fromClause = (String) autoSelectFromClauseCache
.get(beanName);
if (fromClause == null) {
fromClause = createAutoSelectFromClause(beanMetaData);
autoSelectFromClauseCache.put(beanName, fromClause);
}
buf.append(fromClause);
}
return buf.toString();
}
示例2: getDaoMetaData
import org.seasar.framework.util.DisposableUtil; //导入依赖的package包/类
public DaoMetaData getDaoMetaData(final Class daoClass) {
if (!initialized) {
DisposableUtil.add(this);
initialized = true;
}
final String key = daoClass.getName();
DaoMetaData dmd;
synchronized (daoMetaDataCache) {
dmd = (DaoMetaData) daoMetaDataCache.get(key);
}
if (dmd != null) {
return dmd;
}
final DaoMetaData dmdi = createDaoMetaData(daoClass);
synchronized (daoMetaDataCache) {
dmd = (DaoMetaData) daoMetaDataCache.get(daoClass);
if (dmd != null) {
return dmd;
} else {
daoMetaDataCache.put(key, dmdi);
}
}
return dmdi;
}
示例3: getDtoMetaData
import org.seasar.framework.util.DisposableUtil; //导入依赖的package包/类
public synchronized DtoMetaData getDtoMetaData(Class dtoClass) {
if (!initialized) {
DisposableUtil.add(this);
initialized = true;
}
String key = dtoClass.getName();
DtoMetaDataImpl dmd = (DtoMetaDataImpl) cache.get(key);
if (dmd != null) {
return dmd;
}
BeanAnnotationReader reader = annotationReaderFactory
.createBeanAnnotationReader(dtoClass);
PropertyTypeFactory propertyTypeFactory = createPropertyTypeFactory(
dtoClass, reader);
dmd = new DtoMetaDataImpl();
dmd.setBeanClass(dtoClass);
dmd.setBeanAnnotationReader(reader);
dmd.setPropertyTypeFactory(propertyTypeFactory);
dmd.initialize();
cache.put(key, dmd);
return dmd;
}
示例4: tearDownTestContext
import org.seasar.framework.util.DisposableUtil; //导入依赖的package包/类
/**
* テストコンテキストを解放します.
*/
protected void tearDownTestContext() {
TestContextRepository.remove();
DisposableUtil.dispose();
S2ContainerBehavior.setProvider(
new S2ContainerBehavior.DefaultProvider());
}
示例5: testDispose1
import org.seasar.framework.util.DisposableUtil; //导入依赖的package包/类
public void testDispose1() throws Exception {
// ## Arrange ##
assertEquals(0, daoMetaDataFactory.daoMetaDataCache.size());
// ## Act ##
final DaoMetaData dmd = daoMetaDataFactory.getDaoMetaData(FooDao.class);
assertNotNull(dmd);
// ## Assert ##
assertEquals(1, daoMetaDataFactory.daoMetaDataCache.size());
DisposableUtil.dispose();
assertEquals(0, daoMetaDataFactory.daoMetaDataCache.size());
}
示例6: initialize
import org.seasar.framework.util.DisposableUtil; //导入依赖的package包/类
/**
* 初期化します。
*/
public void initialize() {
DisposableUtil.add(this);
initialized = true;
}
示例7: initialize
import org.seasar.framework.util.DisposableUtil; //导入依赖的package包/类
/**
* 初期化を行ないます。
*/
public void initialize() {
DisposableUtil.add(this);
initialized = true;
}