本文整理汇总了Java中org.apache.activemq.store.PersistenceAdapterFactory类的典型用法代码示例。如果您正苦于以下问题:Java PersistenceAdapterFactory类的具体用法?Java PersistenceAdapterFactory怎么用?Java PersistenceAdapterFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PersistenceAdapterFactory类属于org.apache.activemq.store包,在下文中一共展示了PersistenceAdapterFactory类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPersistenceAdapter
import org.apache.activemq.store.PersistenceAdapterFactory; //导入依赖的package包/类
protected PersistenceAdapter createPersistenceAdapter() throws IOException {
if (isPersistent()) {
PersistenceAdapterFactory fac = getPersistenceFactory();
if (fac != null) {
return fac.createPersistenceAdapter();
} else {
try {
String clazz = "org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter";
PersistenceAdapter adaptor = (PersistenceAdapter)getClass().getClassLoader().loadClass(clazz).newInstance();
File dir = new File(getBrokerDataDirectory(),"KahaDB");
adaptor.setDirectory(dir);
return adaptor;
} catch (Throwable e) {
throw IOExceptionSupport.create(e);
}
}
} else {
return new MemoryPersistenceAdapter();
}
}
示例2: getPersistenceFactory
import org.apache.activemq.store.PersistenceAdapterFactory; //导入依赖的package包/类
public PersistenceAdapterFactory getPersistenceFactory() {
return persistenceFactory;
}
示例3: setPersistenceFactory
import org.apache.activemq.store.PersistenceAdapterFactory; //导入依赖的package包/类
public void setPersistenceFactory(PersistenceAdapterFactory persistenceFactory) {
this.persistenceFactory = persistenceFactory;
}
示例4: setPersistenceFactory
import org.apache.activemq.store.PersistenceAdapterFactory; //导入依赖的package包/类
public void setPersistenceFactory(PersistenceAdapterFactory persistenceFactory) {
}