out.println("  public NewPropertyGroup unlock(Object key) { return null; }"); out.println("  public PropertyGroup lock(Object key) { return null; }"); out.println("  public PropertyGroup lock() { return null; }"); out.println("  public PropertyGroup copy() { return null; }"); out.println("  public Class getPrimaryClass(){return primaryClass;}"); out.println("  public String getAssetGetMethod() {return assetGetter;}"); out.println("  public String getAssetSetMethod() {return assetSetter;}"); out.println("  public Class getIntrospectionClass() {\n"+
println(out,"  public NewPropertyGroup unlock(Object key) { return null; }"); println(out,"  public PropertyGroup lock(Object key) { return null; }"); println(out,"  public PropertyGroup lock() { return null; }"); println(out,"  public PropertyGroup copy() { return null; }"); println(out,"  public Class getPrimaryClass(){return primaryClass;}"); println(out,"  public String getAssetGetMethod() {return assetGetter;}"); println(out,"  public String getAssetSetMethod() {return assetSetter;}"); println(out,"  public Class getIntrospectionClass() {\n"+
    void writeFutureClass(PrintWriter out, String context, String className) {      out.println();      // null class implementation      out.println("/** Future PG implementation for "+className+" **/");      out.println("public final static class Future\n"+                  "  implements "+className+", Future_PG\n"+                  "{");      // declare the slots      Vector slotspecs = getAllSlotSpecs(context);      Enumeration se = slotspecs.elements();      while (se.hasMoreElements()) {        String slotspec = ((String)se.nextElement()).trim();        int s = slotspec.indexOf(" ");        String type = slotspec.substring(0,s);        String name = slotspec.substring(s+1);        ActiveSlot as = parseActiveSlot(slotspec);        if (as != null) {          name = as.name;        }        String etype = null;        CollectionType ct = parseCollectionType(type);        if (ct != null) {          type = ct.ctype;          etype = ct.etype;        }        String clname = toClassName(name);                String slotdoc = null;        String depp = (String)p.get(context,name+".deprecated");        if (depp != null) {          slotdoc="@deprecated "+depp;        }        if (slotdoc!=null)           out.println("  /** "+slotdoc+" **/");        if (as!=null) {          out.println("  public "+type+" "+as.getterSpec()+"{\n"+                      "    waitForFinalize();\n"+                      "    return _real."+as.getterCall()+";\n"+                      "  }");        } else {          out.println("  public "+type+" get"+clname+"() {\n"+                      "    waitForFinalize();\n"+                      "    return _real.get"+clname+"();\n"+                      "  }");        }        // extra collection type api        if (etype != null) {          out.println("  public boolean in"+clname+"("+etype+" element) {\n"+                      "    waitForFinalize();\n"+                      "    return _real.in"+clname+"(element);\n"+                      "  }");          out.println("  public "+etype+"[] get"+clname+"AsArray() {\n"+                      "    waitForFinalize();\n"+                      "    return _real.get"+clname+"AsArray();\n"+                      "  }");          out.println("  public "+etype+" getIndexed"+clname+"(int index) {\n"+                      "    waitForFinalize();\n"+                      "    return _real.getIndexed"+clname+"(index);\n"+                      "  }");        }      }            Vector v = getAllDelegateSpecs(context);      if (v != null) {        for (int i =0; i<v.size(); i++) {          Argument dv = (Argument) v.elementAt(i);          Vector dsv = parseDelegateSpecs(p.get(context, dv.name+".delegate"));          for (int j=0; j<dsv.size(); j++) {            DelegateSpec ds = (DelegateSpec) dsv.elementAt(j);            out.println("  public "+ds.type+" "+ds.name+                        "("+unparseArguments(ds.args,true)+") {\n"+                        "    waitForFinalize();\n"+                        "    "+ ("void".equals(ds.type)?"":"return ")+"_real."+ds.name+                        "("+unparseArguments(ds.args,false)+");\n"+                        "  }");          }        }      }      // TimePhased getters      if (p.get(context, PGParser.TIMEPHASED) != null) {        out.println("  public long getStartTime() {\n" +                     "    waitForFinalize();\n"+                    "    return _real.getStartTime();\n"+                    "  }");        out.println("  public long getEndTime() {\n" +                     "    waitForFinalize();\n"+                    "    return _real.getEndTime();\n"+                    "  }");      }            out.println("  public Object clone() throws CloneNotSupportedException {\n"+                  "    throw new CloneNotSupportedException();\n"+                  "  }");      out.println("  public NewPropertyGroup unlock(Object key) { return null; }");      out.println("  public PropertyGroup lock(Object key) { return null; }");      out.println("  public PropertyGroup lock() { return null; }");      out.println("  public PropertyGroup copy() { return null; }");      out.println("  public Class getPrimaryClass(){return primaryClass;}");      out.println("  public String getAssetGetMethod() {return assetGetter;}");      out.println("  public String getAssetSetMethod() {return assetSetter;}");      out.println("  public Class getIntrospectionClass() {\n"+                  "    return "+className+"Impl.class;\n"+                  "  }");      // Futures do not have data quality, though the replacement instance      // may.      out.println("  public synchronized boolean hasDataQuality() {\n"+                  "    return (_real!=null) && _real.hasDataQuality();\n"+                  "  }");      if (hasDQ(context)) {     // if the class has it, we need to implement the getter        out.println("  public synchronized org.cougaar.domain.planning.ldm.dq.DataQuality getDataQuality() {\n"+                    "    return (_real==null)?null:(_real.getDataQuality());\n"+                    "  }");      }      out.println();      out.println("  // Finalization support");      out.println("  private "+className+" _real = null;");      out.println("  public synchronized void finalize(PropertyGroup real) {\n"+                  "    if (real instanceof "+className+") {\n"+                  "      _real=("+className+") real;\n"+                  "      notifyAll();\n"+                  "    } else {\n"+                  "      throw new IllegalArgumentException(\"Finalization with wrong class: \"+real);\n"+                  "    }\n"+                  "  }");      out.println("  private synchronized void waitForFinalize() {\n"+                  "    while (_real == null) {\n"+                  "      try {\n"+                  "        wait();\n"+                  "      } catch (InterruptedException _ie) {}\n"+                  "    }\n"+                  "  }");      out.println("}");    }