本文整理汇总了Java中org.jboss.cache.Fqn类的典型用法代码示例。如果您正苦于以下问题:Java Fqn类的具体用法?Java Fqn怎么用?Java Fqn使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Fqn类属于org.jboss.cache包,在下文中一共展示了Fqn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeLoad
import org.jboss.cache.Fqn; //导入依赖的package包/类
public void writeLoad(Object key, Object value, Object currentVersion) {
try {
Option option = new Option();
option.setFailSilently( true );
option.setDataVersion( NonLockingDataVersion.INSTANCE );
cache.remove( new Fqn( regionFqn, key ), "ITEM", option );
option = new Option();
option.setFailSilently( true );
DataVersion dv = ( source != null && source.isVersioned() )
? new DataVersionAdapter( currentVersion, currentVersion, source.getVersionComparator(), source.toString() )
: NonLockingDataVersion.INSTANCE;
option.setDataVersion( dv );
cache.put( new Fqn( regionFqn, key ), ITEM, value, option );
}
catch (Exception e) {
throw new CacheException(e);
}
}
示例2: put
import org.jboss.cache.Fqn; //导入依赖的package包/类
public void put(Object key, Object value) throws CacheException {
try {
log.trace( "performing put() into region [" + regionName + "]" );
// do the put outside the scope of the JTA txn
Option option = new Option();
option.setFailSilently( true );
option.setDataVersion( NonLockingDataVersion.INSTANCE );
cache.put( new Fqn( regionFqn, key ), ITEM, value, option );
}
catch (TimeoutException te) {
//ignore!
log.debug("ignoring write lock acquisition failure");
}
catch (Exception e) {
throw new CacheException(e);
}
}
示例3: remove
import org.jboss.cache.Fqn; //导入依赖的package包/类
public void remove(Object key) throws CacheException {
try {
// tree cache in optimistic mode seems to have as very difficult
// time with remove calls on non-existent nodes (NPEs)...
if ( cache.get( new Fqn( regionFqn, key ), ITEM ) != null ) {
Option option = new Option();
option.setDataVersion( NonLockingDataVersion.INSTANCE );
cache.remove( new Fqn( regionFqn, key ), option );
}
else {
log.trace( "skipping remove() call as the underlying node did not seem to exist" );
}
}
catch (Exception e) {
throw new CacheException(e);
}
}
示例4: toMap
import org.jboss.cache.Fqn; //导入依赖的package包/类
public Map toMap() {
try {
Map result = new HashMap();
Set childrenNames = cache.getChildrenNames( regionFqn );
if (childrenNames != null) {
Iterator iter = childrenNames.iterator();
while ( iter.hasNext() ) {
Object key = iter.next();
result.put(
key,
cache.get( new Fqn( regionFqn, key ), ITEM )
);
}
}
return result;
}
catch (Exception e) {
throw new CacheException(e);
}
}
示例5: put
import org.jboss.cache.Fqn; //导入依赖的package包/类
public void put(Object key, Object value) throws CacheException {
Transaction tx = suspend();
try {
//do the failfast put outside the scope of the JTA txn
cache.putFailFast( new Fqn( regionFqn, key ), ITEM, value, 0 );
}
catch (TimeoutException te) {
//ignore!
log.debug("ignoring write lock acquisition failure");
}
catch (Exception e) {
throw new CacheException(e);
}
finally {
resume( tx );
}
}
示例6: toMap
import org.jboss.cache.Fqn; //导入依赖的package包/类
public Map toMap() {
try {
Map result = new HashMap();
Set childrenNames = cache.getChildrenNames( regionFqn );
if (childrenNames != null) {
Iterator iter = childrenNames.iterator();
while ( iter.hasNext() ) {
Object key = iter.next();
result.put(
key,
cache.get( new Fqn( regionFqn, key ), ITEM )
);
}
}
return result;
}
catch (Exception e) {
throw new CacheException(e);
}
}
示例7: get
import org.jboss.cache.Fqn; //导入依赖的package包/类
public Object get(Object key) throws CacheException {
try {
return cache.get( new Fqn( new Object[] { regionName, key } ), ITEM );
}
catch (Exception e) {
throw new CacheException(e);
}
}
示例8: put
import org.jboss.cache.Fqn; //导入依赖的package包/类
public void put(Object key, Object value) throws CacheException {
try {
cache.put( new Fqn( new Object[] { regionName, key } ), ITEM, value );
}
catch (Exception e) {
throw new CacheException(e);
}
}
示例9: remove
import org.jboss.cache.Fqn; //导入依赖的package包/类
public void remove(Object key) throws CacheException {
try {
cache.remove( new Fqn( new Object[] { regionName, key } ) );
}
catch (Exception e) {
throw new CacheException(e);
}
}
示例10: clear
import org.jboss.cache.Fqn; //导入依赖的package包/类
public void clear() throws CacheException {
try {
cache.remove( new Fqn(regionName) );
}
catch (Exception e) {
throw new CacheException(e);
}
}
示例11: writeUpdate
import org.jboss.cache.Fqn; //导入依赖的package包/类
public void writeUpdate(Object key, Object value, Object currentVersion, Object previousVersion) {
try {
Option option = new Option();
DataVersion dv = ( source != null && source.isVersioned() )
? new DataVersionAdapter( currentVersion, previousVersion, source.getVersionComparator(), source.toString() )
: NonLockingDataVersion.INSTANCE;
option.setDataVersion( dv );
cache.put( new Fqn( regionFqn, key ), ITEM, value, option );
}
catch ( Exception e ) {
throw new CacheException( e );
}
}
示例12: get
import org.jboss.cache.Fqn; //导入依赖的package包/类
public Object get(Object key) throws CacheException {
try {
Option option = new Option();
option.setFailSilently( true );
// option.setDataVersion( NonLockingDataVersion.INSTANCE );
return cache.get( new Fqn( regionFqn, key ), ITEM, option );
}
catch (Exception e) {
throw new CacheException(e);
}
}
示例13: read
import org.jboss.cache.Fqn; //导入依赖的package包/类
public Object read(Object key) throws CacheException {
try {
return cache.get( new Fqn( regionFqn, key ), ITEM );
}
catch (Exception e) {
throw new CacheException(e);
}
}
示例14: update
import org.jboss.cache.Fqn; //导入依赖的package包/类
public void update(Object key, Object value) throws CacheException {
try {
Option option = new Option();
option.setDataVersion( NonLockingDataVersion.INSTANCE );
cache.put( new Fqn( regionFqn, key ), ITEM, value, option );
}
catch (Exception e) {
throw new CacheException(e);
}
}
示例15: TreeCache
import org.jboss.cache.Fqn; //导入依赖的package包/类
public TreeCache(org.jboss.cache.TreeCache cache, String regionName, TransactionManager transactionManager)
throws CacheException {
this.cache = cache;
this.regionName = regionName;
this.regionFqn = Fqn.fromString( regionName.replace( '.', '/' ) );
this.transactionManager = transactionManager;
}