@Override protected void updateTicket(final Ticket ticket) { try { this.cache.put(FQN_TICKET, ticket.getId(), ticket); } catch (final CacheException e) { throw new RuntimeException(e); } }
@Override public void addTicket(final Ticket ticket) { try { logger.debug("Adding ticket to registry for: {}", ticket.getId()); this.cache.put(FQN_TICKET, ticket.getId(), ticket); } catch (final CacheException e) { logger.error(e.getMessage(), e); throw new RuntimeException(e); } }
public static void sendEvictNotification(Cache cache, Fqn region, Object member, Object key, Option option) { setInvocationOption(cache, option); Fqn f = Fqn.fromRelativeElements(region, Internal.NODE, member == null ? Internal.LOCAL : member, key); cache.put(f, ITEM, DUMMY); }
public static void sendEvictAllNotification(Cache cache, Fqn region, Object member, Option option) { setInvocationOption(cache, option); Fqn f = Fqn.fromRelativeElements(region, Internal.NODE, member == null ? Internal.LOCAL : member); cache.put(f, ITEM, DUMMY); } }
@Override public void save(V value) { K key = value.getKey(); getCache().put(getFqn(key), key.toString(), value); }
/** * Builds an {@link Fqn} from <code>region</code> and <code>key</code> * and performs a JBoss Cache <code>put(Object, Object)</code>, wrapping * any exception in a {@link CacheException}. * * @param cache * the cache to invoke on * @param region * base Fqn for the cache region * @param key * specific key to append to the <code>region</code> to form * the full Fqn * @param value * data to store in the cache node * @param option * invocation Option to set for this invocation. May be * <code>null</code>. */ public static void put(Cache cache, Fqn region, Object key, Object value, Option option) throws CacheException { try { setInvocationOption(cache, option); cache.put(new Fqn(region, key), ITEM, value); } catch (Exception e) { throw new CacheException(e); } }
/** * Builds an {@link Fqn} from <code>region</code> and <code>key</code> * and performs a JBoss Cache <code>put(Object, Object)</code>, ignoring any * {@link TimeoutException} and wrapping any other exception in a {@link CacheException}. * * @param cache * the cache to invoke on * @param region * base Fqn for the cache region * @param key * specific key to append to the <code>region</code> to form * the full Fqn * @param value * data to store in the cache node * @param option * invocation Option to set for this invocation. May be * <code>null</code>. */ public static void putAllowingTimeout(Cache cache, Fqn region, Object key, Object value, Option option) throws CacheException { try { setInvocationOption(cache, option); cache.put(new Fqn(region, key), ITEM, value); } catch (TimeoutException allowed) { // ignore it } catch (Exception e) { throw new CacheException(e); } }
/** * Builds an {@link Fqn} from <code>region</code> and <code>key</code> * and performs a JBoss Cache <code>put(Object, Object)</code>, wrapping * any exception in a {@link CacheException}. * * @param cache * the cache to invoke on * @param region * base Fqn for the cache region * @param key * specific key to append to the <code>region</code> to form * the full Fqn * @param value * data to store in the cache node * @param option * invocation Option to set for this invocation. May be * <code>null</code>. */ public static void put(Cache cache, Fqn region, Object key, Object value, Option option) throws CacheException { try { setInvocationOption(cache, option); cache.put(new Fqn(region, key), ITEM, value); } catch (Exception e) { throw new CacheException(e); } }
/** * Builds an {@link Fqn} from <code>region</code> and <code>key</code> * and performs a JBoss Cache <code>put(Object, Object)</code>, ignoring any * {@link TimeoutException} and wrapping any other exception in a {@link CacheException}. * * @param cache * the cache to invoke on * @param region * base Fqn for the cache region * @param key * specific key to append to the <code>region</code> to form * the full Fqn * @param value * data to store in the cache node * @param option * invocation Option to set for this invocation. May be * <code>null</code>. */ public static void putAllowingTimeout(Cache cache, Fqn region, Object key, Object value, Option option) throws CacheException { try { setInvocationOption(cache, option); cache.put(new Fqn(region, key), ITEM, value); } catch (TimeoutException allowed) { // ignore it } catch (Exception e) { throw new CacheException(e); } }
public void put(Object key, Object value, Date expired) { Map<String, Object> map = new HashMap<String, Object>(3); map.put(RESOURCE, value); if (expired != null) { map.put(ExpirationAlgorithmConfig.EXPIRATION_KEY, expired.getTime()); } cache.put(createFqn(key), map); Transaction transaction = cache.getInvocationContext().getTransaction(); try { // TODO: to review if ((transaction != null) && (transaction.getStatus() == Status.STATUS_ACTIVE)) { transaction.commit(); } } catch (SystemException e) { LOGGER.error(e.getMessage(), e); } catch (SecurityException e) { LOGGER.error(e.getMessage(), e); } catch (IllegalStateException e) { LOGGER.error(e.getMessage(), e); } catch (RollbackException e) { LOGGER.error(e.getMessage(), e); } catch (HeuristicMixedException e) { LOGGER.error(e.getMessage(), e); } catch (HeuristicRollbackException e) { LOGGER.error(e.getMessage(), e); } }
cache.put(fqn, DUMMY, DUMMY); added = root.getChild(fqn);
cache.put(fqn, DUMMY, DUMMY); added = root.getChild(fqn);