@Override public Object visitGetDataMapCommand(InvocationContext ctx, GetDataMapCommand command) throws Throwable { Object retVal = invokeNextInterceptor(ctx, command); if (retVal instanceof Map) { if (trace) log.trace("Return value is a Map and we're retrieving data. Wrapping as a MarshalledValueMap."); Map retValMap = (Map) retVal; if (!ctx.isBypassUnmarshalling() && !retValMap.isEmpty()) retVal = new MarshalledValueMap(retValMap); } return retVal; }
@Override public Object visitGetNodeCommand(InvocationContext ctx, GetNodeCommand command) throws Throwable { Object retVal = invokeNextInterceptor(ctx, command); return ctx.isBypassUnmarshalling() ? retVal : processRetVal(retVal); }
@Override public Object visitClearDataCommand(InvocationContext ctx, ClearDataCommand command) throws Throwable { Object retVal = invokeNextInterceptor(ctx, command); return ctx.isBypassUnmarshalling() ? retVal : processRetVal(retVal); }
@Override public Object visitGetKeysCommand(InvocationContext ctx, GetKeysCommand command) throws Throwable { Object retVal = invokeNextInterceptor(ctx, command); return ctx.isBypassUnmarshalling() ? retVal : processRetVal(retVal); }
@Override public Object visitGetChildrenNamesCommand(InvocationContext ctx, GetChildrenNamesCommand command) throws Throwable { Object retVal = invokeNextInterceptor(ctx, command); return ctx.isBypassUnmarshalling() ? retVal : processRetVal(retVal); }
@Override public Object visitRemoveKeyCommand(InvocationContext ctx, RemoveKeyCommand command) throws Throwable { Set<MarshalledValue> marshalledValues = new HashSet<MarshalledValue>(); if (!MarshalledValueHelper.isTypeExcluded(command.getKey().getClass())) { Object value = createAndAddMarshalledValue(command.getKey(), marshalledValues, ctx); command.setKey(value); } Object retVal = invokeNextInterceptor(ctx, command); return ctx.isBypassUnmarshalling() ? retVal : compactAndProcessRetVal(marshalledValues, retVal); }
@Override public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command) throws Throwable { Set<MarshalledValue> marshalledValues = new HashSet<MarshalledValue>(); if (!MarshalledValueHelper.isTypeExcluded(command.getKey().getClass())) { Object value = createAndAddMarshalledValue(command.getKey(), marshalledValues, ctx); command.setKey(value); } Object retVal = invokeNextInterceptor(ctx, command); return ctx.isBypassUnmarshalling() ? retVal : compactAndProcessRetVal(marshalledValues, retVal); }
@Override public Object visitPutDataMapCommand(InvocationContext ctx, PutDataMapCommand command) throws Throwable { if (command.getDataVersion() != null) { return invokeNextInterceptor(ctx, command); } Set<MarshalledValue> marshalledValues = new HashSet<MarshalledValue>(); command.setData(wrapMap(command.getData(), marshalledValues, ctx)); Object retVal = invokeNextInterceptor(ctx, command); return ctx.isBypassUnmarshalling() ? retVal : compactAndProcessRetVal(marshalledValues, retVal); }
@Override public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable { Set<MarshalledValue> marshalledValues = new HashSet<MarshalledValue>(); if (!MarshalledValueHelper.isTypeExcluded(command.getKey().getClass())) { Object newKey = createAndAddMarshalledValue(command.getKey(), marshalledValues, ctx); command.setKey(newKey); } if (!MarshalledValueHelper.isTypeExcluded(command.getValue().getClass())) { Object value = createAndAddMarshalledValue(command.getValue(), marshalledValues, ctx); command.setValue(value); } Object retVal = invokeNextInterceptor(ctx, command); return ctx.isBypassUnmarshalling() ? retVal : compactAndProcessRetVal(marshalledValues, retVal); }