Example #1
0
 final NotifyingFuture<Void> putAllAsync(
     Map<? extends K, ? extends V> data,
     long lifespan,
     TimeUnit lifespanUnit,
     long maxIdle,
     TimeUnit maxIdleUnit,
     EnumSet<Flag> explicitFlags,
     ClassLoader explicitClassLoader) {
   assertKeysNotNull(data);
   InvocationContext ctx =
       getInvocationContextWithImplicitTransaction(explicitFlags, explicitClassLoader);
   ctx.setUseFutureReturnType(true);
   PutMapCommand command =
       commandsFactory.buildPutMapCommand(
           data, lifespanUnit.toMillis(lifespan), maxIdleUnit.toMillis(maxIdle), ctx.getFlags());
   return wrapInFuture(executeCommandAndCommitIfNeeded(ctx, command));
 }
Example #2
0
 final void putAll(
     Map<? extends K, ? extends V> map,
     long lifespan,
     TimeUnit lifespanUnit,
     long maxIdleTime,
     TimeUnit idleTimeUnit,
     EnumSet<Flag> explicitFlags,
     ClassLoader explicitClassLoader) {
   assertKeysNotNull(map);
   InvocationContext ctx =
       getInvocationContextWithImplicitTransaction(explicitFlags, explicitClassLoader);
   PutMapCommand command =
       commandsFactory.buildPutMapCommand(
           map,
           lifespanUnit.toMillis(lifespan),
           idleTimeUnit.toMillis(maxIdleTime),
           ctx.getFlags());
   executeCommandAndCommitIfNeeded(ctx, command);
 }
 @Override
 public PutMapCommand buildPutMapCommand(
     Map<?, ?> map, long lifespanMillis, long maxIdleTimeMillis, Set<Flag> flags) {
   return actual.buildPutMapCommand(map, lifespanMillis, maxIdleTimeMillis, flags);
 }