private void endCacheServer(){
  List groups=new ArrayList();
  ServerLoadProbe probe=null;
  ClientHaQueueCreation haCreation=null;
  if (stack.peek() instanceof ServerLoadProbe) {
    probe=(ServerLoadProbe)stack.pop();
  }
  if (stack.peek() instanceof ClientHaQueueCreation) {
    haCreation=(ClientHaQueueCreation)stack.pop();
  }
  while (stack.peek() instanceof String) {
    groups.add(stack.pop());
  }
  CacheServer bs=(CacheServer)stack.pop();
  if (groups.size() > 0) {
    Collections.reverse(groups);
    String[] groupArray=new String[groups.size()];
    groups.toArray(groupArray);
    bs.setGroups(groupArray);
  }
  if (probe != null) {
    bs.setLoadProbe(probe);
  }
  if (haCreation != null) {
    ClientSubscriptionConfig csc=bs.getClientSubscriptionConfig();
    String diskStoreName=haCreation.getDiskStoreName();
    if (diskStoreName != null) {
      csc.setDiskStoreName(diskStoreName);
    }
 else {
      csc.setOverflowDirectory(haCreation.getOverflowDirectory() == null ? ClientSubscriptionConfig.DEFAULT_OVERFLOW_DIRECTORY : haCreation.getOverflowDirectory());
    }
    csc.setCapacity(haCreation.getCapacity());
    csc.setEvictionPolicy(haCreation.getEvictionPolicy());
  }
}

private void endCacheServer ( ) { List groups = new ArrayList ( ) ; ServerLoadProbe probe = null ; ClientHaQueueCreation haCreation = null ; if ( stack . peek ( ) instanceof ServerLoadProbe ) { probe = ( ServerLoadProbe ) stack . pop ( ) ; } if ( stack . peek ( ) instanceof ClientHaQueueCreation ) { haCreation = ( ClientHaQueueCreation ) stack . pop ( ) ; } while ( stack . peek ( ) instanceof String ) { groups . add ( stack . pop ( ) ) ; } CacheServer bs = ( CacheServer ) stack . pop ( ) ; if ( groups . size ( ) > 0 ) { Collections . reverse ( groups ) ; String [ ] groupArray = new String [ groups . size ( ) ] ; groups . toArray ( groupArray ) ; bs . setGroups ( groupArray ) ; } if ( probe != null ) { bs . setLoadProbe ( probe ) ; } if ( haCreation != null ) { ClientSubscriptionConfig csc = bs . getClientSubscriptionConfig ( ) ; String diskStoreName = haCreation . getDiskStoreName ( ) ; if ( diskStoreName != null ) { csc . setDiskStoreName ( diskStoreName ) ; } else { csc . setOverflowDirectory ( haCreation . getOverflowDirectory ( ) == null ? ClientSubscriptionConfig . DEFAULT_OVERFLOW_DIRECTORY : haCreation . getOverflowDirectory ( ) ) ; } csc . setCapacity ( haCreation . getCapacity ( ) ) ; csc . setEvictionPolicy ( haCreation . getEvictionPolicy ( ) ) ; } }
set attributes from clienthaqueue when we finish a cache server
