package com.gemstone.gemfire.cache.query.dunit;

import java.security.Principal;

import junit.framework.TestCase;

import com.gemstone.gemfire.LogWriter;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.CacheClosedException;
import com.gemstone.gemfire.cache.operations.ExecuteCQOperationContext;
import com.gemstone.gemfire.cache.operations.OperationContext;
import com.gemstone.gemfire.distributed.DistributedMember;
import com.gemstone.gemfire.security.AccessControl;
import com.gemstone.gemfire.security.NotAuthorizedException;

public class CloseCacheAuthorization extends TestCase implements AccessControl {
  private DistributedMember remoteDistributedMember;
  private Cache cache;
  private LogWriter logger;

  public static AccessControl create() {
    return new CloseCacheAuthorization();
  }

  @Override
  public void close() {
  }

  @Override
  public void init(Principal principal, DistributedMember remoteMember,
      Cache cache) throws NotAuthorizedException {
    this.remoteDistributedMember = remoteMember;
    this.cache = cache;
    this.logger = cache.getSecurityLogger();
  }

  @Override
  public boolean authorizeOperation(String regionName, OperationContext context) {
    this.logger.info(" JASON Authorizing request " + context.getOperationCode() + " class:" + context.getClass().getName());
    new Exception("JASON authz stack").printStackTrace();
    if (context instanceof ExecuteCQOperationContext) {
      cache.close();
      //return false;
      throw new CacheClosedException("cache is closed");
    }
    return true;
  }
}

@@ -1225,191 +1225,8 @@
 ) %7B%0A
-    this.logger.info(%22 JASON Authorizing request %22 + context.getOperationCode() + %22 class:%22 + context.getClass().getName());%0A    new Exception(%22JASON authz stack%22).printStackTrace();%0A
     

Remove debug logging from CloseCacheAuthorization