private MarshalledValue<E, C> marshalEntry(E value) { try { return this.valueFactory.createMarshalledValue(value); } catch (IOException e) { throw InfinispanEjbMessages.MESSAGES.serializationFailure(e, value.getId()); } }
private K unmarshalKey(MarshalledValue<K, C> key) { try { return key.get(this.context); } catch (Exception e) { throw InfinispanEjbMessages.MESSAGES.deserializationFailure(e, key); } }
private E unmarshalEntry(K id, MarshalledValue<E, C> value) { if (value == null) return null; try { return value.get(this.context); } catch (Exception e) { throw InfinispanEjbMessages.MESSAGES.deserializationFailure(e, id); } }
private LockResult acquireSessionOwnership(K key, boolean newLock) { if (this.lockManager == null) return null; Serializable lockKey = this.lockKeyFactory.createLockKey(key); this.trace("Acquiring %slock on %s", newLock ? "new " : "", lockKey); long timeout = this.cache.getCacheConfiguration().locking().lockAcquisitionTimeout(); try { LockResult result = this.lockManager.lock(lockKey, timeout, newLock); this.trace("Lock acquired (%s) on %s", result, lockKey); return result; } catch (TimeoutException e) { throw InfinispanEjbMessages.MESSAGES.lockAcquisitionTimeout(lockKey, timeout); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw InfinispanEjbMessages.MESSAGES.lockAcquisitionInterruption(e, lockKey); } }