[llvm-commits] [llvm-gcc-4.2] r43913 [47/80] - in /llvm-gcc-4.2/trunk: boehm-gc/ boehm-gc/Mac_files/ boehm-gc/cord/ boehm-gc/doc/ boehm-gc/include/ boehm-gc/include/private/ boehm-gc/tests/ libffi/ libffi/include/ libffi/src/ libffi/src/alpha/ libffi/src/arm/ libffi/src/cris/ libffi/src/frv/ libffi/src/ia64/ libffi/src/m32r/ libffi/src/m68k/ libffi/src/mips/ libffi/src/pa/ libffi/src/powerpc/ libffi/src/s390/ libffi/src/sh/ libffi/src/sh64/ libffi/src/sparc/ libffi/src/x86/ libffi/testsuite/ libffi/testsuite/config/ li...

Bill Wendling isanbard at gmail.com
Thu Nov 8 14:57:11 PST 2007


Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Compression.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Compression.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Compression.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Compression.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,129 @@
+/* Compression.java --
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.EnumSyntax;
+
+
+/**
+ * The <code>Compression</code> printing attribute specifies if and how the
+ * supplied print data is compressed.
+ * <p>
+ * If this attribute is ommitted from the attributes set of the print
+ * data it is assumed that no compression is done.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> Compression is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public class Compression extends EnumSyntax
+  implements DocAttribute
+{
+  private static final long serialVersionUID = -5716748913324997674L;
+
+  /** The print data is not compressed. */
+  public static final Compression NONE = new Compression(0);
+  
+  /** The print data is ZIP compressed. */
+  public static final Compression DEFLATE = new Compression(1);
+  
+  /** The print data is GNU Zip compressed. */
+  public static final Compression GZIP = new Compression(2);
+  
+  /** The print data is UNIX compressed. */
+  public static final Compression COMPRESS = new Compression(3);
+  
+  private static final String[] stringTable = { "none", "deflate", 
+                                                "gzip", "compress" };
+  private static final Compression[] enumValueTable = { NONE, DEFLATE, 
+                                                        GZIP, COMPRESS };
+
+  /**
+   * Constructs a <code>Compression</code> object.
+   * 
+   * @param value the enum value
+   */
+  protected Compression(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>Compression</code> itself.
+   */
+  public final Class getCategory()
+  {
+    return Compression.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "compression".
+   */
+  public final String getName()
+  {
+    return "compression";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Copies.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Copies.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Copies.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Copies.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,114 @@
+/* Copies.java -- 
+   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version.  */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+/**
+ * The <code>Copies</code> printing attribute specifies the number
+ * of copies to be printed.
+ * <p>
+ * <b>Note:</b> The effect of this attribute on jobs with multiple documents 
+ * is controlled by the job attribute 
+ * {@link javax.print.attribute.standard.MultipleDocumentHandling}.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> Copies is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.MultipleDocumentHandling
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class Copies extends IntegerSyntax
+  implements PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = -6426631521680023833L;
+  
+  /**
+   * Creates a <code>Copies</code> object.
+   *
+   * @param value the number of copies
+   *
+   * @exception IllegalArgumentException if value < 1
+   */
+  public Copies(int value)
+  {
+    super(value);
+
+    if (value < 1)
+      throw new IllegalArgumentException("value may not be less than 1");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof Copies))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>Copies</code> itself.
+   */
+  public Class getCategory()
+  {
+    return Copies.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "copies".
+   */
+  public String getName()
+  {
+    return "copies";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/CopiesSupported.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/CopiesSupported.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/CopiesSupported.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/CopiesSupported.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,129 @@
+/* CopiesSupported.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.SetOfIntegerSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+
+
+/**
+ * The <code>CopiesSupported</code> attribute specifies the supported
+ * value or range of values for the 
+ * {@link javax.print.attribute.standard.Copies} attribute. 
+ * <p>
+ * <b>IPP Compatibility:</b> CopiesSupported is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class CopiesSupported extends SetOfIntegerSyntax
+  implements SupportedValuesAttribute
+{
+  private static final long serialVersionUID = 6927711687034846001L;
+
+  /**
+   * Constructs a <code>CopiesSupported</code> object with
+   * the given value. This means that only this value is 
+   * supported for copies.
+   * 
+   * @param member the member value
+   * @exception IllegalArgumentException if member is < 1
+   */
+  public CopiesSupported(int member)
+  {
+    super(member);
+    
+    if (member < 1)
+      throw new IllegalArgumentException("member may not be less than 1");
+  }
+
+  /**
+   * Constructs a <code>CopiesSupported</code> object with
+   * the given range of values. This means that values for 
+   * copies are supported inside the specified range.
+   * 
+   * @param lowerBound the lower bound value
+   * @param upperBound the upper bound value
+   *
+   * @exception IllegalArgumentException if lowerBound < 1
+   */
+  public CopiesSupported(int lowerBound, int upperBound)
+  {
+    super(lowerBound, upperBound);
+    
+    if (lowerBound < 1)
+      throw new IllegalArgumentException("lowerBound may not be less than 1");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof CopiesSupported))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>CopiesSupported</code> itself.
+   */
+  public Class getCategory()
+  {
+    return CopiesSupported.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "copies-supported".
+   */
+  public String getName()
+  {
+    return "copies-supported";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DateTimeAtCompleted.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DateTimeAtCompleted.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DateTimeAtCompleted.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DateTimeAtCompleted.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,109 @@
+/* DateTimeAtCompleted.java -- 
+   Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Date;
+
+import javax.print.attribute.DateTimeSyntax;
+import javax.print.attribute.PrintJobAttribute;
+
+/**
+ * The <code>DateTimeAtCompleted</code> attribute specifies the date and 
+ * the time at which a print job completed (or was canceled or aborted).
+ * <p>
+ * <b>IPP Compatibility:</b> DateTimeAtCompleted is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.DateTimeAtCreation
+ * @see javax.print.attribute.standard.DateTimeAtProcessing
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class DateTimeAtCompleted extends DateTimeSyntax
+  implements PrintJobAttribute
+{
+  private static final long serialVersionUID = 6497399708058490000L;
+
+  /**
+   * Creates a <code>DateTimeAtCompleted</code> object.
+   *
+   * @param value the date at completion time
+   *
+   * @exception NullPointerException if value is null
+   */
+  public DateTimeAtCompleted(Date value)
+  {
+    super(value);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof DateTimeAtCompleted))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>DateTimeAtCompleted</code> itself.
+   */
+  public Class getCategory()
+  {
+    return DateTimeAtCompleted.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "date-time-at-completed".
+   */
+  public String getName()
+  {
+    return "date-time-at-completed";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DateTimeAtCreation.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DateTimeAtCreation.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DateTimeAtCreation.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DateTimeAtCreation.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,109 @@
+/* DateTimeAtCreation.java -- 
+   Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Date;
+
+import javax.print.attribute.DateTimeSyntax;
+import javax.print.attribute.PrintJobAttribute;
+
+/**
+ * The <code>DateTimeAtCreation</code> attribute specifies the 
+ * date and the time at which a print job was created.
+ * <p>
+ * <b>IPP Compatibility:</b> DateTimeAtCreation is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.DateTimeAtCompleted
+ * @see javax.print.attribute.standard.DateTimeAtProcessing
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class DateTimeAtCreation extends DateTimeSyntax
+  implements PrintJobAttribute
+{
+  private static final long serialVersionUID = -2923732231056647903L;
+
+  /**
+   * Creates a <code>DateTimeAtCreation</code> object.
+   *
+   * @param value the date at creation time
+   *
+   * @exception NullPointerException if value is null
+   */
+  public DateTimeAtCreation(Date value)
+  {
+    super(value);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof DateTimeAtCreation))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>DateTimeAtCreation</code> itself.
+   */
+  public Class getCategory()
+  {
+    return DateTimeAtCreation.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "date-time-at-creation".
+   */
+  public String getName()
+  {
+    return "date-time-at-creation";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DateTimeAtProcessing.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DateTimeAtProcessing.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DateTimeAtProcessing.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DateTimeAtProcessing.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,109 @@
+/* DateTimeAtProcessing.java -- 
+   Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Date;
+
+import javax.print.attribute.DateTimeSyntax;
+import javax.print.attribute.PrintJobAttribute;
+
+/**
+ * The <code>DateTimeAtProcessing</code> attribute specifies the date
+ * and the time at which a print job started processing.
+ * <p>
+ * <b>IPP Compatibility:</b> DateTimeAtProcessing is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.DateTimeAtCompleted
+ * @see javax.print.attribute.standard.DateTimeAtCreation
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class DateTimeAtProcessing extends DateTimeSyntax
+  implements PrintJobAttribute
+{
+  private static final long serialVersionUID = -3710068197278263244L;
+
+  /**
+   * Creates a <code>DateTimeAtProcessing</code> object.
+   *
+   * @param value the date at processing time
+   *
+   * @exception NullPointerException if value is null
+   */
+  public DateTimeAtProcessing(Date value)
+  {
+    super(value);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof DateTimeAtProcessing))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>DateTimeAtProcessing</code> itself.
+   */
+  public Class getCategory()
+  {
+    return DateTimeAtProcessing.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "date-time-at-processing".
+   */
+  public String getName()
+  {
+    return "date-time-at-processing";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Destination.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Destination.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Destination.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Destination.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,121 @@
+/* Destination.java --
+   Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.net.URI;
+
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+import javax.print.attribute.URISyntax;
+
+/**
+ * The <code>Destination</code> attribute provides a URI for an alternate
+ * destination of the printing output.
+ * <p>
+ * As not an IPP attribute many print services will not support this 
+ * attribute and only provide the printer device as a destination.
+ * An alternate output destination would be a file on the local harddisk
+ * given as a file scheme URI.
+ * </p>
+ * <p> 
+ * If a print service does not support the destination attributes URI it 
+ * will throw a PrintException. This exception may further implement the
+ * interface {@link javax.print.URIException}. 
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> Destination is not an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.PrintException
+ * @see javax.print.URIException
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class Destination extends URISyntax
+  implements PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = 6776739171700415321L;
+
+  /**
+   * Constructs a <code>Destination</code> object.
+   * 
+   * @param uri the URI of the output destination.
+   * @throws NullPointerException if the given uri is null.
+   */
+  public Destination(URI uri)
+  {
+    super(uri);
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof Destination))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>Destination</code> itself.
+   */
+  public Class getCategory()
+  {
+    return Destination.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "spool-data-destination"
+   */
+  public String getName()
+  {
+    return "spool-data-destination";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DocumentName.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DocumentName.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DocumentName.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/DocumentName.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,115 @@
+/* DocumentName.java -- 
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Locale;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * The <code>DocumentName</code> printing attribute specifies a document name.
+ * <p>
+ * The document name may be different than the name of the job. It must not be
+ * unique across multiple documents in the same print job. Normally, an 
+ * application provides the document name for the user by using e.g. the file 
+ * name or a name generated automatically by the application.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> DocumentName is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.JobName
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class DocumentName extends TextSyntax
+  implements DocAttribute
+{
+  private static final long serialVersionUID = 7883105848533280430L;
+
+  /**
+   * Creates a <code>DocumentName</code> object.
+   *
+   * @param documentName the document name
+   * @param locale the locale to use, if <code>null</code> the default
+   * locale is used.
+   *
+   * @exception NullPointerException if documentName is null
+   */
+  public DocumentName(String documentName, Locale locale)
+  {
+    super(documentName, locale);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof DocumentName))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>DocumentName</code> itself.
+   */
+  public Class getCategory()
+  {
+    return DocumentName.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "document-name".
+   */
+  public String getName()
+  {
+    return "document-name";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Fidelity.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Fidelity.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Fidelity.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Fidelity.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,145 @@
+/* Fidelity.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version.  */
+
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+
+/**
+ * The <code>Fidelity</code> attribute specifies how a print job is handled
+ * if the supplied attributes are not fully supported.
+ * <p>
+ * There may be conflicts between the client requested attributes and the
+ * attributes supported by the printer object. Such situations are controlled
+ * through the client by providing this attribute to indicate the wanted
+ * conflict handling mechanism:
+ * <ul>
+ * <li>{@link #FIDELITY_TRUE}: Reject the job since the job can not be 
+ * processed exactly as specified by the attributes of the client.</li>
+ * <li>{@link #FIDELITY_FALSE}: The Printer may make any changes necessary 
+ * to proceed with processing the Job as good as possible.</li>
+ * </ul>
+ * </p> 
+ * <p>
+ * <b>IPP Compatibility:</b> Fidelity is an IPP 1.1 attribute. The IPP name
+ * is "ipp-attribute-fidelity". The IPP specification treats Fidelity as a 
+ * boolean type which is not available in the Java Print Service API. The IPP
+ * boolean value "true" corresponds to <code>FIDELITY_TRUE</code> and "false" 
+ * to <code>FIDELITY_FALSE</code>.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class Fidelity extends EnumSyntax
+  implements PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = 6320827847329172308L;
+
+  /** 
+   * Requests that the job is printed exactly as specified, 
+   * or rejected otherwise.
+   */
+  public static final Fidelity FIDELITY_TRUE = new Fidelity(0);
+  
+  /** 
+   * Requests that the job is printed as exactly as reasonable. This means
+   * that the print service may choose to substitute the default value 
+   * associated with that attribute, or use some other supported value that 
+   * is similar to the unsupported requested value. 
+   */
+  public static final Fidelity FIDELITY_FALSE = new Fidelity(1);
+  
+  private static final String[] stringTable = { "true", "false" };
+  private static final Fidelity[] enumValueTable = { FIDELITY_TRUE,
+                                                     FIDELITY_FALSE };
+
+  /**
+   * Constructs a <code>Fidelity</code> object.
+   * 
+   * @param value the value
+   */
+  protected Fidelity(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>Fidelity</code> itself.
+   */
+  public Class getCategory()
+  {
+    return Fidelity.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "ipp-attribute-fidelity".
+   */
+  public String getName()
+  {
+    return "ipp-attribute-fidelity";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Finishings.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Finishings.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Finishings.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Finishings.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,286 @@
+/* Finishings.java --
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version.  */
+
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+
+/**
+ * The <code>Finishings</code> attribute specifies the finishing operations
+ * that the Printer applies to every copy of each printed document in the Job.
+ * <p>
+ * Standard enum values are: <code>NONE</code>, <code>STAPLE</code>, 
+ * <code>COVER</code>, <code>BIND</code>, <code>SADDLE_STITCH</code>,
+ * <code>EDGE_STITCH</code>.
+ * <br><br>
+ * The following values are more specific: 
+ * <code>STAPLE_TOP_LEFT</code>, <code>STAPLE_BOTTOM_LEFT</code>, 
+ * <code>STAPLE_TOP_RIGHT</code>, <code>STAPLE_BOTTOM_RIGHT</code>, 
+ * <code>EDGE_STITCH_LEFT</code>, <code>EDGE_STITCH_TOP</code>, 
+ * <code>EDGE_STITCH_RIGHT</code>, <code>EDGE_STITCH_BOTTOM</code>, 
+ * <code>STAPLE_DUAL_LEFT</code>, <code>STAPLE_DUAL_TOP</code>, 
+ * <code>STAPLE_DUAL_RIGHT</code>, <code>STAPLE_DUAL_BOTTOM</code>.
+ * </p> 
+ * <p>
+ * <b>Note:</b> The effect of this attribute on jobs with multiple documents 
+ * is controlled by the job attribute 
+ * {@link javax.print.attribute.standard.MultipleDocumentHandling}.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> Finishings is an IPP 1.1 attribute. Differences 
+ * to the IPP specification are that in the Java Print Service API only one 
+ * enum value is supported (in IPP a set of enums). Further the enum 
+ * <code>punch</code> is not supported.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public class Finishings extends EnumSyntax
+  implements DocAttribute, PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = -627840419548391754L;
+
+  /** 
+   * Perform no finishings of the documents.
+   */
+  public static final Finishings NONE = new Finishings(3);
+  
+  /** 
+   * Selects binding of the documents with one or more staples.  
+   */
+  public static final Finishings STAPLE = new Finishings(4);
+  
+  /**
+   * Selects the use of a non-printed (or pre-printed) cover for 
+   * the document.
+   */
+  public static final Finishings COVER = new Finishings(6);
+  
+  /**
+   * Selects that a binding is to be applied to the document.
+   * The type and placement of the binding is site-defined.
+   */
+  public static final Finishings BIND = new Finishings(7);
+  
+  /**
+   * Selects binding of the documents with one or more staples
+   * along the middle fold.  
+   */
+  public static final Finishings SADDLE_STITCH = new Finishings(8);
+  
+  /**
+   * Selects binding of the documents with one or more staples 
+   * along one edge. 
+   */
+  public static final Finishings EDGE_STITCH = new Finishings(9);
+  
+  /** 
+   * Selects binding of the documents with one or more staples 
+   * in the top left corner. 
+   */
+  public static final Finishings STAPLE_TOP_LEFT = new Finishings(20);
+  
+  /** 
+   * Selects binding of the documents with one or more staples in the bottom 
+   * left corner. 
+   */
+  public static final Finishings STAPLE_BOTTOM_LEFT = new Finishings(21);
+  
+  /**
+   * Selects binding of the documents with one or more staples in 
+   * the top right corner.
+   */
+  public static final Finishings STAPLE_TOP_RIGHT = new Finishings(22);
+  
+  /**
+   * Selects binding of the documents with one or more staples in 
+   * the bottom right corner.
+   */
+  public static final Finishings STAPLE_BOTTOM_RIGHT = new Finishings(23);
+  
+  /**
+   * Selects binding of the documents with one or more staples
+   * along the left edge.
+   */
+  public static final Finishings EDGE_STITCH_LEFT = new Finishings(24);
+  
+  /**
+   * Selects binding of the documents with one or more staples along 
+   * the top edge.
+   */
+  public static final Finishings EDGE_STITCH_TOP = new Finishings(25);
+  
+  /**
+   * Selects binding of the documents with one or more staples along 
+   * the right edge.
+   */
+  public static final Finishings EDGE_STITCH_RIGHT = new Finishings(26);
+  
+  /**
+   * Selects binding of the documents with one or more staples along
+   * the bottom edge. 
+   */
+  public static final Finishings EDGE_STITCH_BOTTOM = new Finishings(27);
+  
+  /**
+   * Selects binding of the documents with two staples along the 
+   * left edge assuming a portrait document.
+   */
+  public static final Finishings STAPLE_DUAL_LEFT = new Finishings(28);
+  
+  /**
+   * Selects binding of the documents with two staples along the 
+   * top edge assuming a portrait document.
+   */
+  public static final Finishings STAPLE_DUAL_TOP = new Finishings(29);
+  
+  /**
+   * Selects binding of the documents with two staples along the 
+   * right edge assuming a portrait document.
+   */
+  public static final Finishings STAPLE_DUAL_RIGHT = new Finishings(30);
+  
+  /**
+   * Selects binding of the documents with two staples along the 
+   * bottom edge assuming a portrait document.
+   */
+  public static final Finishings STAPLE_DUAL_BOTTOM = new Finishings(31);
+
+  private static final String[] stringTable = { "none", "staple", null, 
+                                                "cover", "bind", "saddle-stitch",
+                                                "edge-stitch", null, null, null,
+                                                null, null, null, null, null,
+                                                null, null, "staple-top-left",
+                                                "staple-bottom-left", 
+                                                "staple-top-right", 
+                                                "staple-bottom-right",
+                                                "edge-stitch-left",
+                                                "edge-stitch-top",
+                                                "edge-stitch-right",
+                                                "edge-stitch-bottom",
+                                                "staple-dual-left",
+                                                "staple-dual-top",
+                                                "staple-dual-right",
+                                                "staple-dual-bottom" };
+  
+  private static final Finishings[] enumValueTable = { NONE, STAPLE, null, 
+                                                       COVER, BIND, 
+                                                       SADDLE_STITCH,
+                                                       EDGE_STITCH, null, 
+                                                       null, null, null, 
+                                                       null, null, null, 
+                                                       null, null, null, 
+                                                       STAPLE_TOP_LEFT,
+                                                       STAPLE_BOTTOM_LEFT,
+                                                       STAPLE_TOP_RIGHT,
+                                                       STAPLE_BOTTOM_RIGHT,
+                                                       EDGE_STITCH_LEFT,
+                                                       EDGE_STITCH_TOP,
+                                                       EDGE_STITCH_RIGHT,
+                                                       EDGE_STITCH_BOTTOM,
+                                                       STAPLE_DUAL_LEFT,
+                                                       STAPLE_DUAL_TOP,
+                                                       STAPLE_DUAL_RIGHT,
+                                                       STAPLE_DUAL_BOTTOM };
+  
+  /**
+   * Constructs a <code>Finishings</code> object.
+   * 
+   * @param value the value
+   */
+  protected Finishings(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return the class <code>Finishings</code> itself
+   */
+  public final Class getCategory()
+  {
+    return Finishings.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "finishings".
+   */
+  public final String getName()
+  {
+    return "finishings";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+
+  /**
+   * Returns the lowest used value by the enumerations of this class.
+   * .
+   * @return The lowest value used.
+   */
+  protected int getOffset()
+  {
+    return 3;
+  }  
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobHoldUntil.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobHoldUntil.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobHoldUntil.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobHoldUntil.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,115 @@
+/* JobHoldUntil.java -- 
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Date;
+
+import javax.print.attribute.DateTimeSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+/**
+ * The <code>JobHoldUntil</code> attribute specifies the date
+ * and the time at which a print job must become a candidate
+ * for printing. 
+ * <p>
+ * <b>IPP Compatibility:</b> JobHoldUntil is an IPP 1.1 attribute.
+ * However the attribute in IPP is based on keywords of named
+ * time periods like day-time or evening. It will depend on the
+ * concrete implementation of a print service how a mapping of the 
+ * detailed provided date and time of this attribute to the named
+ * keyword or an alternate extension attribute will be done. E.g.
+ * CUPS supports also a HH:MM format as extension to the keywords.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class JobHoldUntil extends DateTimeSyntax
+  implements PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = -1664471048860415024L;
+
+  /**
+   * Creates a <code>JobHoldUntil</code> object.
+   *
+   * @param value the date to hold the job until
+   *
+   * @exception NullPointerException if value is null
+   */
+  public JobHoldUntil(Date value)
+  {
+    super(value);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof JobHoldUntil))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobHoldUntil</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobHoldUntil.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-hold-until".
+   */
+  public String getName()
+  {
+    return "job-hold-until";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobImpressions.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobImpressions.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobImpressions.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobImpressions.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,127 @@
+/* JobImpressions.java -- 
+   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+/**
+ * The <code>JobImpressions</code> printing attribute specifies
+ * the total size in number of impressions of the documents
+ * of a a print job. 
+ * <p>
+ * An impression is specified by the IPP specification as the image 
+ * (possibly many print-stream pages in different configurations) 
+ * imposed onto a single media sheet. This attribute must not include
+ * a multiplication factor from the number of copies which maybe specified
+ * in a Copies attribute.
+ * </p>
+ * <p>
+ * This attribute belongs to a group of job size attributes which are 
+ * describing the size of a job to be printed. The values supplied by
+ * these attributes are intended to be used for routing and scheduling
+ * of jobs on the print service. A client may specify these attributes.
+ * If a clients supplies these attributes a print service may change
+ * the values if its be able to compute a more accurate value at the
+ * time of the job submission or also later.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> JobImpressions is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.JobKOctets
+ * @see javax.print.attribute.standard.JobMediaSheets
+ * 
+ * @author Michael Koch
+ */
+public final class JobImpressions extends IntegerSyntax
+  implements PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = 8225537206784322464L;
+  
+  /**
+   * Creates a <code>JobImpressions</code> object.
+   *
+   * @param value the number of impressions
+   *
+   * @exception IllegalArgumentException if value < 0
+   */
+  public JobImpressions(int value)
+  {
+    super(value);
+
+    if (value < 0)
+      throw new IllegalArgumentException("value may not be less than 0");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof JobImpressions))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobImpressions</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobImpressions.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-impressions".
+   */
+  public String getName()
+  {
+    return "job-impressions";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobImpressionsCompleted.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobImpressionsCompleted.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobImpressionsCompleted.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobImpressionsCompleted.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,118 @@
+/* JobImpressionsCompleted.java -- 
+   Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
+
+/**
+ * The <code>JobImpressionsCompleted</code> printing attribute reports
+ * the number of impressions already processed.
+ * <p>
+ * An impression is specified by the IPP specification as the image imposed 
+ * onto a single media sheet. This attribute will not include a multiplication 
+ * factor from the number of copies.
+ * </p>
+ * <p>
+ * This attribute belongs to a group of job progress attributes which are 
+ * reporting on the progress of a print job.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> JobImpressionsCompleted is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.JobMediaSheetsCompleted
+ * @see javax.print.attribute.standard.JobKOctetsProcessed
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class JobImpressionsCompleted extends IntegerSyntax
+  implements PrintJobAttribute
+{
+  private static final long serialVersionUID = 6722648442432393294L;
+  
+  /**
+   * Creates a <code>JobImpressionsCompleted</code> object.
+   *
+   * @param value the number of completed impressions
+   *
+   * @exception IllegalArgumentException if value < 0
+   */
+  public JobImpressionsCompleted(int value)
+  {
+    super(value);
+
+    if (value < 0)
+      throw new IllegalArgumentException("value may not be less than 0");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof JobImpressionsCompleted))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobImpressionsCompleted</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobImpressionsCompleted.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-impressions-completed".
+   */
+  public String getName()
+  {
+    return "job-impressions-completed";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobImpressionsSupported.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobImpressionsSupported.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobImpressionsSupported.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobImpressionsSupported.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,113 @@
+/* JobImpressionsSupported.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.SetOfIntegerSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+
+
+/**
+ * The <code>JobImpressionsSupported</code> printing attribute specifies the 
+ * supported range of values for the 
+ * {@link javax.print.attribute.standard.JobImpressions} attribute.
+ * <p>
+ * <b>IPP Compatibility:</b> JobImpressionsSupported is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class JobImpressionsSupported extends SetOfIntegerSyntax
+  implements SupportedValuesAttribute
+{
+  private static final long serialVersionUID = -4887354803843173692L;
+
+  /**
+   * Constructs a <code>JobImpressionsSupported</code> object with the 
+   * given range of supported job impressions values.
+   *
+   * @param lowerBound the lower bound value
+   * @param upperBound the upper bound value
+   *
+   * @exception IllegalArgumentException if lowerBound <= upperbound
+   * and lowerBound < 1
+   */
+  public JobImpressionsSupported(int lowerBound, int upperBound)
+  {
+    super(lowerBound, upperBound);
+    
+    if (lowerBound < 1)
+      throw new IllegalArgumentException("lowerBound may not be less than 1");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if (! (obj instanceof JobImpressionsSupported))
+      return false;
+   
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobImpressionsSupported</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobImpressionsSupported.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-impressions-supported".
+   */
+  public String getName()
+  {
+    return "job-impressions-supported";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobKOctets.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobKOctets.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobKOctets.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobKOctets.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,127 @@
+/* JobKOctets.java -- 
+   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+/**
+ * The <code>JobKOctets</code> printing attribute specifies
+ * the total size of all the documents of a print job in K octets.
+ * <p>
+ * The supplied value has to be rounded up, so that a range between
+ * 1 and 1024 octects is specified as 1 and a range between 1025 and
+ * 2048 octects as 2, etc.  This attribute must not include a multiplication 
+ * factor from the number of copies which maybe specified in a Copies 
+ * attribute.
+ * </p>
+ * <p>
+ * This attribute belongs to a group of job size attributes which are 
+ * describing the size of a job to be printed. The values supplied by
+ * these attributes are intended to be used for routing and scheduling
+ * of jobs on the print service. A client may specify these attributes.
+ * If a clients supplies these attributes a print service may change
+ * the values if its be able to compute a more accurate value at the
+ * time of the job submission or also later.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> JobKOctets is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.JobMediaSheets
+ * @see javax.print.attribute.standard.JobImpressions
+ * 
+ * @author Michael Koch
+ */
+public final class JobKOctets extends IntegerSyntax
+  implements PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = -8959710146498202869L;
+  
+  /**
+   * Creates a <code>JobKOctets</code> object.
+   * The value is in units of K (1024) octets rounded up to the next highest K. 
+   *
+   * @param value the number of K octets
+   *
+   * @exception IllegalArgumentException if value < 0
+   */
+  public JobKOctets(int value)
+  {
+    super(value);
+
+    if (value < 0)
+      throw new IllegalArgumentException("value may not be less than 0");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof JobKOctets))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobKOctets</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobKOctets.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-k-octets".
+   */
+  public String getName()
+  {
+    return "job-k-octets";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobKOctetsProcessed.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobKOctetsProcessed.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobKOctetsProcessed.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobKOctetsProcessed.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,119 @@
+/* JobKOctetsProcessed.java -- 
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
+
+/**
+ * The <code>JobKOctetsProcessed</code> printing attribute reports
+ * the total number of octets already processed in K octets units.
+ * <p>
+ * The supplied value will be rounded up to the next highest K octets.
+ * This attribute will not include a multiplication factor from the number 
+ * of copies.
+ * </p>
+ * <p>
+ * This attribute belongs to a group of job progress attributes which are 
+ * reporting on the progress of a print job.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> JobKOctetsProcessed is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.JobMediaSheetsCompleted
+ * @see javax.print.attribute.standard.JobImpressionsCompleted
+ * 
+ * @author Michael Koch
+ */
+public final class JobKOctetsProcessed extends IntegerSyntax
+  implements PrintJobAttribute
+{
+  private static final long serialVersionUID = -6265238509657881806L;
+  
+  /**
+   * Creates a <code>JobKOctetsProcessed</code> object.
+   * The value is in units of K (1024) octets rounded up to the next highest K. 
+   *
+   * @param value the number of processed K octets
+   *
+   * @exception IllegalArgumentException if value < 0
+   */
+  public JobKOctetsProcessed(int value)
+  {
+    super(value);
+
+    if (value < 0)
+      throw new IllegalArgumentException("value may not be less than 0");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof JobKOctetsProcessed))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobKOctetsProcessed</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobKOctetsProcessed.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-k-octets-processed".
+   */
+  public String getName()
+  {
+    return "job-k-octets-processed";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobKOctetsSupported.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobKOctetsSupported.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobKOctetsSupported.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobKOctetsSupported.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,113 @@
+/* JobKOctetsSupported.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.SetOfIntegerSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+
+
+/**
+ * The <code>JobKOctetsSupported</code> printing attribute specifies the 
+ * supported range of values for the 
+ * {@link javax.print.attribute.standard.JobKOctets} attribute.
+ * <p>
+ * <b>IPP Compatibility:</b> JobKOctetsSupported is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class JobKOctetsSupported extends SetOfIntegerSyntax
+  implements SupportedValuesAttribute
+{
+  private static final long serialVersionUID = -2867871140549897443L;
+
+  /**
+   * Constructs a <code>JobKOctetsSupported</code> object with the
+   * given range for supported K octets.
+   *
+   * @param lowerBound the lower bound value
+   * @param upperBound the upper bound value
+   *
+   * @exception IllegalArgumentException if lowerBound <= upperbound
+   * and lowerBound < 1
+   */
+  public JobKOctetsSupported(int lowerBound, int upperBound)
+  {
+    super(lowerBound, upperBound);
+    
+    if (lowerBound < 1)
+      throw new IllegalArgumentException("lowerBound may not be less than 1");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if (! (obj instanceof JobKOctetsSupported))
+      return false;
+   
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobKOctetsSupported</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobKOctetsSupported.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-k-octets-supported".
+   */
+  public String getName()
+  {
+    return "job-k-octets-supported";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMediaSheets.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMediaSheets.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMediaSheets.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMediaSheets.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,124 @@
+/* JobMediaSheets.java -- 
+   Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+/**
+ * The <code>JobMediaSheets</code> printing attribute specifies
+ * the total number of media sheets needed by a job.
+ * <p>
+ * In contrary to the other job size attributes this attribute must include
+ * the multiplication factor from the number of copies if a Copies attribute
+ * was specified for the job.
+ * </p>
+ * <p>
+ * This attribute belongs to a group of job size attributes which are 
+ * describing the size of a job to be printed. The values supplied by
+ * these attributes are intended to be used for routing and scheduling
+ * of jobs on the print service. A client may specify these attributes.
+ * If a clients supplies these attributes a print service may change
+ * the values if its be able to compute a more accurate value at the
+ * time of the job submission or also later.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> JobMediaSheets is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.JobKOctets
+ * @see javax.print.attribute.standard.JobImpressions
+ * 
+ * @author Michael Koch
+ */
+public class JobMediaSheets extends IntegerSyntax
+  implements PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = 408871131531979741L;
+  
+  /**
+   * Creates a <code>JobMediaSheets</code> object.
+   *
+   * @param value the number of media sheets for a print job
+   *
+   * @exception IllegalArgumentException if value < 0
+   */
+  public JobMediaSheets(int value)
+  {
+    super(value);
+
+    if (value < 0)
+      throw new IllegalArgumentException("value may not be less than 0");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof JobMediaSheets))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobMediaSheets</code> itself.
+   */
+  public final Class getCategory()
+  {
+    return JobMediaSheets.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-media-sheets".
+   */
+  public final String getName()
+  {
+    return "job-media-sheets";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsCompleted.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsCompleted.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsCompleted.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsCompleted.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,113 @@
+/* JobMediaSheetsCompleted.java -- 
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
+
+/**
+ * The <code>JobMediaSheetsCompleted</code> printing attribute reports
+ * the number of media sheets already processed. 
+ * <p>
+ * This attribute belongs to a group of job progress attributes which are 
+ * reporting on the progress of a print job.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> JobMediaSheetsCompleted is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.JobImpressionsCompleted
+ * @see javax.print.attribute.standard.JobKOctetsProcessed
+ * 
+ * @author Michael Koch
+ */
+public final class JobMediaSheetsCompleted extends IntegerSyntax
+  implements PrintJobAttribute
+{
+  private static final long serialVersionUID = 1739595973810840475L;
+  
+  /**
+   * Creates a <code>JobMediaSheetsCompleted</code> object.
+   *
+   * @param value the number of completed media sheets
+   *
+   * @exception IllegalArgumentException if value < 0
+   */
+  public JobMediaSheetsCompleted(int value)
+  {
+    super(value);
+
+    if (value < 0)
+      throw new IllegalArgumentException("value may not be less than 0");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof JobMediaSheetsCompleted))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobMediaSheetsCompleted</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobMediaSheetsCompleted.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-media-sheets-completed".
+   */
+  public String getName()
+  {
+    return "job-media-sheets-completed";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsSupported.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsSupported.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsSupported.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsSupported.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,113 @@
+/* JobMediaSheetsSupported.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.SetOfIntegerSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+
+
+/**
+ * The <code>JobMediaSheetsSupported</code> printing attribute specifies the 
+ * supported range of values for the 
+ * {@link javax.print.attribute.standard.JobMediaSheets} attribute.
+ * <p>
+ * <b>IPP Compatibility:</b> JobMediaSheetsSupported is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class JobMediaSheetsSupported extends SetOfIntegerSyntax
+  implements SupportedValuesAttribute
+{
+  private static final long serialVersionUID = 2953685470388672940L;
+
+  /**
+   * Constructs a <code>JobMediaSheetsSupported</code> object with the 
+   * given range of supported job media sheets values.
+   *
+   * @param lowerBound the lower bound value
+   * @param upperBound the upper bound value
+   *
+   * @exception IllegalArgumentException if lowerBound <= upperbound
+   * and lowerBound < 1
+   */
+  public JobMediaSheetsSupported(int lowerBound, int upperBound)
+  {
+    super(lowerBound, upperBound);
+    
+    if (lowerBound < 1)
+      throw new IllegalArgumentException("lowerBound may not be less than 1");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if (! (obj instanceof JobMediaSheetsSupported))
+      return false;
+   
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobMediaSheetsSupported</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobMediaSheetsSupported.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-media-sheets-supported".
+   */
+  public String getName()
+  {
+    return "job-media-sheets-supported";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMessageFromOperator.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMessageFromOperator.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMessageFromOperator.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobMessageFromOperator.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,112 @@
+/* JobMessageFromOperator.java -- 
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Locale;
+
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * The <code>JobMessageFromOperator</code> printing attribute provides 
+ * a message from an operator or a system administrator related to the
+ * print job. This may include information why a certain action has been
+ * taken on the print job like a modification.
+ * <p>
+ * <b>IPP Compatibility:</b> JobMessageFromOperator is an IPP 1.1 
+ * attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class JobMessageFromOperator extends TextSyntax
+  implements PrintJobAttribute
+{
+  private static final long serialVersionUID = -4620751846003142047L;
+
+  /**
+   * Creates a <code>JobMessageFromOperator</code> object.
+   *
+   * @param message the message
+   * @param locale the locale to use, if <code>null</code> the default
+   * locale is used.
+   *
+   * @exception NullPointerException if message is <code>null</code>.
+   */
+  public JobMessageFromOperator(String message, Locale locale)
+  {
+    super(message, locale);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof JobMessageFromOperator))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobMessageFromOperator</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobMessageFromOperator.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-message-from-operator".
+   */
+  public String getName()
+  {
+    return "job-message-from-operator";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobName.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobName.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobName.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobName.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,110 @@
+/* JobName.java -- 
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Locale;
+
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * The <code>JobName</code> printing attribute provides the name of a 
+ * print job for identification.
+ * <p>
+ * <b>IPP Compatibility:</b> JobName is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class JobName extends TextSyntax
+  implements PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = 4660359192078689545L;
+
+  /**
+   * Creates a <code>JobName</code> object.
+   *
+   * @param jobName the job name.
+   * @param locale the locale to use, if <code>null</code> the default
+   * locale is used.
+   *
+   * @exception NullPointerException if jobName is <code>null</code>.
+   */
+  public JobName(String jobName, Locale locale)
+  {
+    super(jobName, locale);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof JobName))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobName</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobName.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-name".
+   */
+  public String getName()
+  {
+    return "job-name";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobOriginatingUserName.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobOriginatingUserName.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobOriginatingUserName.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobOriginatingUserName.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,109 @@
+/* JobOriginatingUserName.java -- 
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Locale;
+
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * The <code>JobOriginatingUserName</code> attribute specifies the name of 
+ * the user which submitted the print job.
+ * <p>
+ * <b>IPP Compatibility:</b> JobOriginatingUserName is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class JobOriginatingUserName extends TextSyntax
+  implements PrintJobAttribute
+{
+  private static final long serialVersionUID = -8052537926362933477L;
+
+  /**
+   * Creates a <code>JobOriginatingUserName</code> object.
+   *
+   * @param userName the user name
+   * @param locale the locale to use, if <code>null</code> the default
+   * locale is used.
+   *
+   * @exception NullPointerException if userName is <code>null</code>.
+   */
+  public JobOriginatingUserName(String userName, Locale locale)
+  {
+    super(userName, locale);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof JobOriginatingUserName))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobOriginatingUserName</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobOriginatingUserName.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-originating-user-name".
+   */
+  public String getName()
+  {
+    return "job-originating-user-name";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobPriority.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobPriority.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobPriority.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobPriority.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,114 @@
+/* JobPriority.java -- 
+   Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+
+/**
+ * The <code>JobPriority</code> printing attribute specifies
+ * the priority for scheduling a job on the print service.
+ * <p>
+ * A client may specify any value between 1 (lowest priority) and 100 
+ * (highest priority). A print service prints jobs with a priority
+ * value of n before those with a priority value of n-1.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> JobPriority is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class JobPriority extends IntegerSyntax
+  implements PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = -4599900369040602769L;
+
+  /**
+   * Creates a <code>JobPriority</code> object.
+   *
+   * @param value the priority
+   *
+   * @exception IllegalArgumentException if value < 1 or value > 100
+   */
+  public JobPriority(int value)
+  {
+    super(value);
+
+    if (value < 1 || value > 100)
+      throw new IllegalArgumentException("value out of range");
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof JobPriority))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobPriority</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobPriority.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-priority".
+   */
+  public String getName()
+  {
+    return "job-priority";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobPrioritySupported.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobPrioritySupported.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobPrioritySupported.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobPrioritySupported.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,116 @@
+/* JobPrioritySupported.java -- 
+   Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+
+
+/**
+ * The <code>JobPrioritySupported</code> printing attribute provides
+ * the supported values for the <code>JobPriority</code> attribute.
+ * <p>
+ * A client may specify any JobPriority value between 1 and 100. If a
+ * print service supports fewer priority levels it indicates the maximum
+ * levels through this attribute. The print service then automatically 
+ * maps the job priority value provided by the client in an even distribution
+ * over the whole range of 1 to 100.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> JobPrioritySupported is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.JobPriority
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class JobPrioritySupported extends IntegerSyntax
+  implements SupportedValuesAttribute
+{
+  private static final long serialVersionUID = 2564840378013555894L;
+
+  /**
+   * Creates a <code>JobPrioritySupported</code> object.
+   *
+   * @param value the priority
+   *
+   * @exception IllegalArgumentException if value < 1 or value > 100
+   */
+  public JobPrioritySupported(int value)
+  {
+    super(value);
+
+    if (value < 1 || value > 100)
+      throw new IllegalArgumentException("value out of range");
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof JobPrioritySupported))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobPrioritySupported</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobPrioritySupported.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-priority-supported".
+   */
+  public String getName()
+  {
+    return "job-priority-supported";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobSheets.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobSheets.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobSheets.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobSheets.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,126 @@
+/* JobSheets.java --
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+
+/**
+ * The <code>JobSheets</code> printing attribute specifies if a
+ * job start/end sheets should be printed. 
+ * <p>
+ * <b>IPP Compatibility:</b> JobSheets is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public class JobSheets extends EnumSyntax
+  implements PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = -4735258056132519759L;
+
+  /**
+   * No job sheet is printed. 
+   */
+  public static final JobSheets NONE = new JobSheets(0);
+  
+  /**
+   * The standard job sheet is printed. The sheet and if it 
+   * is printed only as start sheet or also as end sheet is
+   * site specific.
+   */
+  public static final JobSheets STANDARD = new JobSheets(1);
+
+  private static final String[] stringTable = { "none", "standard" };
+  
+  private static final JobSheets[] enumValueTable = { NONE, STANDARD };
+  
+  /**
+   * Constructs a <code>JobSheets</code> object.
+   * 
+   * @param value the enum value.
+   */
+  protected JobSheets(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobSheets</code> itself.
+   */
+  public final Class getCategory()
+  {
+    return JobSheets.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-sheets".
+   */
+  public final String getName()
+  {
+    return "job-sheets";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobState.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobState.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobState.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobState.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,175 @@
+/* JobState.java --
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
+
+
+/**
+ * The <code>JobState</code> printing attribute reports
+ * the current state of a job.
+ * <p>
+ * The {@link javax.print.attribute.standard.JobStateReasons}
+ * attribute provides further detailed information about
+ * the given job state. Detailed information about the job
+ * state and job state reasons can be found in the RFC 2911.
+ * </p> 
+ * <p>
+ * <b>IPP Compatibility:</b> JobState is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public class JobState extends EnumSyntax
+  implements PrintJobAttribute
+{
+  private static final long serialVersionUID = 400465010094018920L;
+
+  /**
+   * The job state is currently unknown.
+   */
+  public static final JobState UNKNOWN = new JobState(0);
+  
+  /**
+   * The job is pending processing.
+   */
+  public static final JobState PENDING = new JobState(3);
+  
+  /**
+   * The job is currently not a candidate for printing because
+   * of reasons reported by the job-state-reasons attribute. If
+   * the reasons are no longer present it will return to the
+   * pending state.
+   */
+  public static final JobState PENDING_HELD = new JobState(4);
+  
+  /**
+   * The job is currently processed.
+   */
+  public static final JobState PROCESSING = new JobState(5);
+  
+  /**
+   * The job's processing has stopped. The job-state-reasons
+   * attribute may indicate the reason(s). The job will return
+   * to the processing state if the reasons are no longer present.
+   */
+  public static final JobState PROCESSING_STOPPED = new JobState(6);
+  
+  /**
+   * The job has been canceled by the client.
+   */
+  public static final JobState CANCELED = new JobState(7);
+  
+  /**
+   * The job has been aborted by the system.
+   */
+  public static final JobState ABORTED = new JobState(8);
+  
+  /**
+   * The job has completed successfully.
+   */
+  public static final JobState COMPLETED = new JobState(9);
+
+
+  private static final String[] stringTable = { "unknown", null, null, 
+                                                "pending", "pending-held",
+                                                "processing", 
+                                                "processing-stopped",
+                                                "canceled", "aborted", 
+                                                "completed"};
+  
+  private static final JobState[] enumValueTable = { UNKNOWN, null, null,
+                                                     PENDING, PENDING_HELD,
+                                                     PROCESSING,
+                                                     PROCESSING_STOPPED,
+                                                     CANCELED, ABORTED,
+                                                     COMPLETED };
+  
+  /**
+   * Constructs a <code>JobState</code> object.
+   * 
+   * @param value the enum value.
+   */
+  protected JobState(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobState</code> itself.
+   */
+  public final Class getCategory()
+  {
+    return JobState.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-state".
+   */
+  public final String getName()
+  {
+    return "job-state";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobStateReason.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobStateReason.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobStateReason.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobStateReason.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,300 @@
+/* JobStateReason.java --
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+
+
+/**
+ * The <code>JobStateReason</code> attribute provides additional
+ * information about the current state of a job. Its always part
+ * of the {@link javax.print.attribute.standard.JobStateReasons}
+ * printing attribute. 
+ * <p>
+ * <b>IPP Compatibility:</b> JobStateReason is not an IPP 1.1 
+ * attribute itself but used inside the <code>JobStateReasons</code>
+ * attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public class JobStateReason extends EnumSyntax
+  implements Attribute
+{
+  private static final long serialVersionUID = -8765894420449009168L;
+
+  /**
+   * The printer has accepted the job or is retrieving document
+   * data for processing.
+   */
+  public static final JobStateReason JOB_INCOMING = new JobStateReason(0);
+  
+  /**
+   * The printer is expecting additional document data before it
+   * can move this job into the processing state.
+   */
+  public static final JobStateReason JOB_DATA_INSUFFICIENT = new JobStateReason(1);
+  
+  /**
+   * The printer is unable to access one or more documents provided
+   * by reference in the print job.
+   */
+  public static final JobStateReason DOCUMENT_ACCESS_ERROR = new JobStateReason(2);
+  
+  /**
+   * The printer has not received the whole job submission. This
+   * indicates no reason for the interruption.
+   */
+  public static final JobStateReason SUBMISSION_INTERRUPTED = new JobStateReason(3);
+  
+  /**
+   * The printer transfers the job to the actual output device.
+   */
+  public static final JobStateReason JOB_OUTGOING = new JobStateReason(4);
+  
+  /**
+   * The job was submitted with a <code>JobHoldUntil</code> attribute which 
+   * specifies a time period still in the future and causes the job to 
+   * be on hold.
+   */
+  public static final JobStateReason JOB_HOLD_UNTIL_SPECIFIED = new JobStateReason(5);
+  
+  /**
+   * One or more resources needed by the job are not ready. E.g. needed
+   * media type.
+   */
+  public static final JobStateReason RESOURCES_ARE_NOT_READY = new JobStateReason(6);
+  
+  /**
+   * The printer stopped partly.
+   */
+  public static final JobStateReason PRINTER_STOPPED_PARTLY = new JobStateReason(7);
+  
+  /**
+   * The printer stopped complete.
+   */
+  public static final JobStateReason PRINTER_STOPPED = new JobStateReason(8);
+  
+  /**
+   * The printer is currently interpreting the jobs document data.
+   * Detailed state of the job's processing state.
+   */
+  public static final JobStateReason JOB_INTERPRETING = new JobStateReason(9);
+  
+  /**
+   * The printer has queued the document data.
+   * Detailed state of the job's processing state.
+   */
+  public static final JobStateReason JOB_QUEUED = new JobStateReason(10);
+  
+  /**
+   * The printer is transforming the document data to another representation.
+   * Detailed state of the job's processing state.
+   */
+  public static final JobStateReason JOB_TRANSFORMING = new JobStateReason(11);
+  
+  /**
+   * The job is queued for marking.
+   */
+  public static final JobStateReason JOB_QUEUED_FOR_MARKER = new JobStateReason(12);
+  
+  /**
+   * The job is currently printing.
+   */
+  public static final JobStateReason JOB_PRINTING = new JobStateReason(13);
+  
+  /**
+   * The job was canceled by the user (the owner of the job).
+   */
+  public static final JobStateReason JOB_CANCELED_BY_USER = new JobStateReason(14);
+  
+  /**
+   * The job was canceled by the operator.
+   */
+  public static final JobStateReason JOB_CANCELED_BY_OPERATOR = new JobStateReason(15);
+  
+  /**
+   * The job was canceled by an unidentified local user at the device.
+   */
+  public static final JobStateReason JOB_CANCELED_AT_DEVICE = new JobStateReason(16);
+  
+  /**
+   * The job has been aborted by the system.
+   */
+  public static final JobStateReason ABORTED_BY_SYSTEM = new JobStateReason(17);
+  
+  /**
+   * The printer aborted the job because of an unsupported compression while
+   * trying to decompress the document data.
+   */
+  public static final JobStateReason UNSUPPORTED_COMPRESSION = new JobStateReason(18);
+  
+  /**
+   * The printer aborted the job because of a compression error while
+   * trying to decompress the document data. If this state is given the test
+   * for supported compression has already been passed.
+   */
+  public static final JobStateReason COMPRESSION_ERROR = new JobStateReason(19);
+  
+  /**
+   * The printer aborted the job because of the document format is not supported.
+   * This may happen if a job is specified as application/octet-stream format. 
+   */
+  public static final JobStateReason UNSUPPORTED_DOCUMENT_FORMAT = new JobStateReason(20);
+  
+  /**
+   * The printer aborted the job because of an error in the document data. 
+   */
+  public static final JobStateReason DOCUMENT_FORMAT_ERROR = new JobStateReason(21);
+  
+  /**
+   * The client has either canceled the job or the printer aborted the job.
+   * However the printer still performs some action on the job e.g. to cleanup. 
+   */
+  public static final JobStateReason PROCESSING_TO_STOP_POINT = new JobStateReason(22);
+  
+  /**
+   * The printer is offline and therefore is not accepting jobs.
+   */
+  public static final JobStateReason SERVICE_OFF_LINE = new JobStateReason(23);
+  
+  /**
+   * The printer completed the job successfully. 
+   */
+  public static final JobStateReason JOB_COMPLETED_SUCCESSFULLY = new JobStateReason(24);
+  
+  /**
+   * The printer completed the job with warnings.
+   */
+  public static final JobStateReason JOB_COMPLETED_WITH_WARNINGS = new JobStateReason(25);
+  
+  /**
+   * The printer completed the job with errors.
+   */
+  public static final JobStateReason JOB_COMPLETED_WITH_ERRORS = new JobStateReason(26);
+  
+  /**
+   * The job is retained and is able to be restared. 
+   */
+  public static final JobStateReason JOB_RESTARTABLE = new JobStateReason(27);
+  
+  /**
+   * The printer has forwarded the job to the actual output device. This device
+   * is not capable of reporting the state back so that the job state is set
+   * to completed by the printer. 
+   */
+  public static final JobStateReason QUEUED_IN_DEVICE = new JobStateReason(28);
+
+  private static final String[] stringTable = 
+    { "job-incoming", "job-data-insufficient", "document-access-error", 
+      "submission-interrupted", "job-outgoing", "job-hold-until-specified",
+      "resources-are-not-ready", "printer-stopped-partly", "printer-stopped",
+      "job-interpreting", "job-queued", "job-transforming", 
+      "job-queued-for-marker", "job-printing", "job-canceled-by-user",
+      "job-canceled-by-operator", "job-canceled-at-device", 
+      "aborted-by-system", "unsupported-compression", "compression-error",
+      "unsupported-document-format", "document-format-error", 
+      "processing-to-stop-point", "service-off-line", 
+      "job-completed-successfully", "job-completed-with-warnings", 
+      "job-completed-with-errors", "job-restartable", "queued-in-device" };
+  
+  private static final JobStateReason[] enumValueTable = 
+    { JOB_INCOMING, JOB_DATA_INSUFFICIENT, DOCUMENT_ACCESS_ERROR, 
+      SUBMISSION_INTERRUPTED, JOB_OUTGOING, JOB_HOLD_UNTIL_SPECIFIED, 
+      RESOURCES_ARE_NOT_READY, PRINTER_STOPPED_PARTLY, PRINTER_STOPPED,
+      JOB_INTERPRETING, JOB_QUEUED, JOB_TRANSFORMING, JOB_QUEUED_FOR_MARKER,
+      JOB_PRINTING, JOB_CANCELED_BY_USER, JOB_CANCELED_BY_OPERATOR,
+      JOB_CANCELED_AT_DEVICE, ABORTED_BY_SYSTEM, UNSUPPORTED_COMPRESSION,
+      COMPRESSION_ERROR, UNSUPPORTED_DOCUMENT_FORMAT, DOCUMENT_FORMAT_ERROR,
+      PROCESSING_TO_STOP_POINT, SERVICE_OFF_LINE, JOB_COMPLETED_SUCCESSFULLY,
+      JOB_COMPLETED_WITH_WARNINGS, JOB_COMPLETED_WITH_ERRORS, JOB_RESTARTABLE,
+      QUEUED_IN_DEVICE };
+  
+  /**
+   * Constructs a <code>JobStateReason</code> object.
+   * 
+   * @param value the enum value.
+   */
+  protected JobStateReason(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobStateReason</code> itself.
+   */
+  public final Class getCategory()
+  {
+    return JobStateReason.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-state-reason".
+   */
+  public final String getName()
+  {
+    return "job-state-reason";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,156 @@
+/* JobStateReasons.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import javax.print.attribute.PrintJobAttribute;
+
+/**
+ * The <code>JobStateReasons</code> attribute provides the set of 
+ * additional informations available about the current state of a print job. 
+ * <p>
+ * <b>IPP Compatibility:</b> JobStateReasons is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.JobState
+ * @see javax.print.attribute.standard.JobStateReason
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class JobStateReasons extends HashSet
+  implements PrintJobAttribute
+{
+  private static final long serialVersionUID = 8849088261264331812L;
+
+  /**
+   * Constructs an empty <code>JobStateReasons</code> attribute.
+   */  
+  public JobStateReasons()
+  {
+    super();
+  }
+
+  /**
+   * Constructs an empty <code>JobStateReasons</code> attribute
+   * with the given initial capacity and load factor.
+   * 
+   * @param initialCapacity the intial capacity.
+   * @param loadFactor the load factor of the underlying HashSet.
+   * 
+   * @throws IllegalArgumentException if initialCapacity < 0
+   * @throws IllegalArgumentException if initialCapacity or loadFactor < 0
+   */
+  public JobStateReasons(int initialCapacity, float loadFactor)
+  {
+    super(initialCapacity, loadFactor);
+  }
+
+  /**
+   * Constructs an empty <code>JobStateReasons</code> attribute
+   * with the given initial capacity and the default load factor.
+   * 
+   * @param initialCapacity the intial capacity.
+   * 
+   * @throws IllegalArgumentException if initialCapacity < 0
+   */
+  public JobStateReasons(int initialCapacity)
+  {
+    super(initialCapacity);
+  }
+
+  /**
+   * Constructs a <code>JobStateReasons</code> attribute
+   * with the content of the given collection.
+   * 
+   * @param collection the collection for the initial values.
+   * 
+   * @throws NullPointerException if collection or any value is 
+   * <code>null</code>.
+   * @throws ClassCastException if values of collection are not of type 
+   * <code>JobStateReason</code>.
+   */
+  public JobStateReasons(Collection collection)
+  {
+    super(collection.size(), 0.75f);
+    Iterator it = collection.iterator();
+    while (it.hasNext())
+      add(it.next());
+  }
+
+  /**
+   * Adds the given job state reason object to the set.
+   * 
+   * @param o the reason of type <code>JobStateReason</code>.
+   * @return <code>true</code> if set changed, <code>false</code> otherwise.
+   * 
+   * @throws NullPointerException if given object is <code>null</code>.
+   * @throws ClassCastException if given object is not an instance of
+   * <code>JobStateReason</code>.
+   */
+  public boolean add(Object o)
+  {
+    if (o == null)
+      throw new NullPointerException("reason is null");  
+    
+    return super.add((JobStateReason) o);   
+  }
+  
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>JobStateReasons</code> itself.
+   */
+  public Class getCategory()
+  {
+    return JobStateReasons.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "job-state-reasons".
+   */
+  public String getName()
+  {
+    return "job-state-reasons";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Media.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Media.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Media.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Media.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,122 @@
+/* Media.java --
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+
+/**
+ * The <code>Media</code> printing attribute specifies which
+ * type of media should be used for printing.
+ * <p>
+ * The media to be used can be specified in three ways represented
+ * by the media subclasses {@link javax.print.attribute.standard.MediaTray},
+ * {@link javax.print.attribute.standard.MediaName} and 
+ * {@link javax.print.attribute.standard.MediaSizeName}:
+ * <ul>
+ * <li>Selection by paper source - selection of printer tray to be used.</li>
+ * <li>Selection by name - e.g. A4 paper.</li>
+ * <li>Selection by standard sizes - e.g. ISO A5, JIS B4.</li>
+ * </ul>
+ * Each of the sublcasses represents the IPP attribute <code>media</code>
+ * and provides predefined values to be used.
+ * </p> 
+ * <p>
+ * <b>IPP Compatibility:</b> Media is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public abstract class Media extends EnumSyntax
+  implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
+{
+  private static final long serialVersionUID = -2823970704630722439L;
+
+  /**
+   * Constructs a <code>Media</code> object.
+   * 
+   * @param value the enum value.
+   */
+  protected Media(int value)
+  {
+    super(value);
+  }
+    
+  /**
+   * Tests if the given object is equal to this object.
+   * The objects are considered equal if both are of the same
+   * Media subclass, not null and the values are equal.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if (obj == null)
+      return false;
+    
+    return (obj.getClass() == this.getClass()
+            && ((Media) obj).getValue() == this.getValue());
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>Media</code> itself.
+   */
+  public final Class getCategory()
+  {
+    return Media.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "media".
+   */
+  public final String getName()
+  {
+    return "media";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaName.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaName.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaName.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaName.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,121 @@
+/* MediaName.java --
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.EnumSyntax;
+
+/**
+ * <code>MediaName</code> is a subclass of the <code>Media</code> printing 
+ * attribute and provides selection of media to be used by the means of 
+ * defined names. The class pre-defines commonly available media names. 
+ * This media type enumeration may be used in alternative to 
+ * MediaSizeName/MediaTray.
+ * <p>
+ * <b>IPP Compatibility:</b> MediaName is not an IPP 1.1 attribute on its own.
+ * It provides parts of the <code>media</code> attribute type values.
+ * </p>
+ * 
+ * @author Sven de Marothy
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public class MediaName extends Media
+{
+  private static final long serialVersionUID = 4653117714524155448L;
+  
+  /**
+   * The North American letter white medium.
+   */
+  public static final MediaName NA_LETTER_WHITE = new MediaName(0);
+  
+  /**
+   * The North American letter transparent medium.
+   */
+  public static final MediaName NA_LETTER_TRANSPARENT = new MediaName(1);
+  
+  /**
+   * The ISO A4 white medium.
+   */
+  public static final MediaName ISO_A4_WHITE = new MediaName(2);
+  
+  /**
+   * The ISO A4 transparent medium. 
+   */
+  public static final MediaName ISO_A4_TRANSPARENT = new MediaName(3);
+
+  private static final String[] stringTable = { "na-letter-white", 
+                                                "na-letter-transparent", 
+                                                "iso-a4-white",
+                                                "iso-a4-transparent" };
+  
+  private static final MediaName[] enumValueTable = { NA_LETTER_WHITE, 
+                                                      NA_LETTER_TRANSPARENT, 
+                                                      ISO_A4_WHITE, 
+                                                      ISO_A4_TRANSPARENT };  
+  
+  /**
+   * Creates a <code>MediaName</code> object.
+   *
+   * @param i the enum value.
+   */
+  protected MediaName(int i)
+  {
+    super( i );
+  }
+ 
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}
+

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaPrintableArea.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaPrintableArea.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaPrintableArea.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaPrintableArea.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,311 @@
+/* MediaPrintableArea.java -- 
+   Copyright (C) 2005, 2006  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+/**
+ * The <code>MediaPrintableArea</code> attribute specifies the area
+ * of a media sheet which is available for printing.
+ * <p>
+ * Due to hardware limitation its not possible with most printers to use the 
+ * whole area of a media sheet for printing. This attribute defines the area 
+ * for printing through the values of the upper left corner position (x,y)
+ * on the sheet and the available width and height of the area. The units of 
+ * the values are determined by two defined constants:
+ * <ul>
+ * <li>INCH - defines an inch</li>
+ * <li>MM - defines a millimeter</li>
+ * </ul>
+ * </p>
+ * <p>
+ * <b>Internal storage:</b><br>
+ * The values of x, y, width and height are stored internally in micrometers. 
+ * The values of the provided constants for inch (value 25400) and millimeters
+ * (value 1000) are used as conversion factors to the internal storage units.
+ * To get the internal micrometers values a multiplication of a given
+ * size value with its units constant value is done. Retrieving the size value
+ * for specific units is done by dividing the internal stored value by the 
+ * units constant value.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> MediaPrintableArea is not an IPP 1.1 attribute.
+ * </p>
+ *
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class MediaPrintableArea
+  implements DocAttribute, PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = -1597171464050795793L;
+
+  /**
+   * Constant for the units of inches.
+   * The actual value is the conversion factor to micrometers.
+   */
+  public static final int INCH = 25400;
+  
+  /**
+   * Constant for the units of millimeters.
+   * The actual value is the conversion factor to micrometers.
+   */
+  public static final int MM = 1000;
+  
+  /** x in micrometers. */
+  private int x;
+  /** y in micrometers. */
+  private int y;
+  /** width in micrometers. */
+  private int w;
+  /** height in micrometers. */
+  private int h;
+  
+  /**
+   * Creates a new <code>MediaPrintableArea</code> object with the given
+   * float values for the given units.
+   * 
+   * @param x start of the printable area on the sheet in x direction.
+   * @param y start of the printable area on the sheet in y direction.
+   * @param w the width of the printable area.
+   * @param h the height of the printable area.
+   * @param units the units of the given values.
+   * 
+   * @throws IllegalArgumentException if x i< 0 or y i< 0 or w i<= 0
+   * or h i<= 0 or units i< 1
+   */
+  public MediaPrintableArea(float x, float y, float w, float h, int units)
+  {
+    if (x < 0.0f || y < 0.0f || w <= 0.0f || h <= 0.0f)
+      throw new IllegalArgumentException();
+
+    this.x = (int) (x * units + 0.5f);
+    this.y = (int) (y * units + 0.5f);
+    this.w = (int) (w * units + 0.5f);
+    this.h = (int) (h * units + 0.5f);
+  }
+
+  /**
+   * Creates a new <code>MediaPrintableArea</code> object with the given
+   * int values for the given units.
+   * 
+   * @param x start of the printable area on the sheet in x direction.
+   * @param y start of the printable area on the sheet in y direction.
+   * @param w the width of the printable area.
+   * @param h the height of the printable area.
+   * @param units the units of the given values.
+   * 
+   * @throws IllegalArgumentException if x i< 0 or y i< 0 or w i<= 0
+   * or h i<= 0 or units i< 1
+   */
+  public MediaPrintableArea(int x, int y, int w, int h, int units)
+  {
+    if (x < 0 || y < 0 || w <= 0 || h <= 0)
+      throw new IllegalArgumentException();
+
+    this.x = x * units;
+    this.y = y * units;
+    this.w = w * units;
+    this.h = h * units;
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>MediaPrintableArea</code> itself.
+   */
+  public Class getCategory()
+  {
+    return MediaPrintableArea.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "media-printable-area".
+   */
+  public String getName()
+  {
+    return "media-printable-area";
+  }
+
+  /**
+   * Returns the height of the printable area for the given units.
+   * 
+   * @param units the units conversion factor.
+   * @return The height.
+   * 
+   * @throws IllegalArgumentException if <code>units</code> is < 1
+   */
+  public float getHeight(int units)
+  {
+    if (units < 1)
+      throw new IllegalArgumentException("units may not be less than 1");
+
+    return h / ((float)units);
+  }
+
+  /**
+   * Returns the width of the printable area for the given units.
+   * 
+   * @param units the units conversion factor.
+   * @return The width.
+   * 
+   * @throws IllegalArgumentException if <code>units</code> is < 1
+   */
+  public float getWidth(int units)
+  {
+    if (units < 1)
+      throw new IllegalArgumentException("units may not be less than 1");
+
+    return w / ((float)units);
+  }
+
+  /**
+   * Returns the position in x direction of the printable area 
+   * for the given units.
+   * 
+   * @param units the units conversion factor.
+   * @return The position in x direction.
+   * 
+   * @throws IllegalArgumentException if <code>units</code> is < 1
+   */
+  public float getX(int units)
+  {
+    if (units < 1)
+      throw new IllegalArgumentException("units may not be less than 1");
+
+    return x / ((float)units);
+  }
+
+  /**
+   * Returns the position in y direction of the printable area 
+   * for the given units.
+   * 
+   * @param units the units conversion factor.
+   * @return The position in y direction.
+   * 
+   * @throws IllegalArgumentException if <code>units</code> is < 1
+   */
+  public float getY(int units)
+  {
+    if (units < 1)
+      throw new IllegalArgumentException("units may not be less than 1");
+
+    return y / ((float)units);
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if (! (obj instanceof MediaPrintableArea))
+      return false;
+
+    MediaPrintableArea tmp = (MediaPrintableArea) obj;
+
+    return (x == tmp.getX(1) && y == tmp.getY(1)
+            && w == tmp.getWidth(1) && h == tmp.getHeight(1));
+  }
+
+  /**
+   * Returns the string representation for this object in units of millimeters..
+   * <p>
+   * The returned string is in the form "(x,y)->(width,height)mm".
+   * </p> 
+   * @return The string representation in millimeters.
+   */
+  public String toString()
+  {
+    return toString(MM, "mm");
+  }
+
+  /**
+   * Returns the hashcode for this object.
+   *
+   * @return The hashcode.
+   */
+  public int hashCode()
+  {
+    return x ^ y + w ^ h;
+  }
+  
+  /**
+   * Returns the string representation for this object in units of millimeters..
+   * <p>
+   * The returned string is in the form "(x,y)->(width,height)unitsName".
+   * </p>
+   * @param units the units to use for conversion.
+   * @param unitsName the name of the used units, appended to the resulting
+   * string if not <code>null</code>.
+   * @return The string representation in millimeters.
+   * 
+   * @throws IllegalArgumentException if <code>units</code> is < 1
+   */
+  public String toString(int units, String unitsName)
+  {
+    if (units < 1)
+      throw new IllegalArgumentException("units may not be less than 1");
+    
+    String tmp = "(" + getX(units) + "," + getY(units) + ")->("
+                 + getWidth(units) + "," + getHeight(units) + ")";
+    
+    return unitsName == null ? tmp : tmp + unitsName;
+  }
+
+  /**
+   * Returns the printable area as an float[] with 4 values 
+   * (order x, y, width, height) in the given units.
+   * 
+   * @param units the units to use.
+   * @return The printable area as float array.
+   */
+  public float[] getPrintableArea(int units)
+  {
+    return new float[] { getX(units), getY(units), 
+                         getWidth(units), getHeight(units) };
+  }  
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaSize.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaSize.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaSize.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaSize.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,883 @@
+/* MediaSize.java -- 
+   Copyright (C) 2005, 2006  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.ArrayList;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.Size2DSyntax;
+
+/**
+ * The <code>MediaSize</code> printing attribute class specifies the size
+ * of a printing media. The size is defined in portrait orientation with 
+ * x at the bottom edge and y at the left edge.
+ * <p>
+ * There are several media sizes predefined through the nested classes. Further
+ * sizes may be provided by the application. <code>MediaSize</code> is not used
+ * as a printing attribute currently. It may be used to get the actual sizes 
+ * for a named media or to find a suitable <code>MediaSizeName</code> instance
+ * by querying with the needed sizes.
+ * </p> 
+ * <p>
+ * <b>IPP Compatibility:</b> MediaSize is not an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.MediaSizeName
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public class MediaSize extends Size2DSyntax
+  implements Attribute
+{
+  private static final long serialVersionUID = -1967958664615414771L;
+
+  private static ArrayList mediaCache;
+  
+  static
+    {
+      mediaCache = new ArrayList();
+      
+      // We call one instance of every container class to make sure it gets
+      // loaded during class initialization and therefore all other static
+      // fields of this container class also.
+      
+      // This is needed to put all MediaSize instance into the mediaCache
+      // for use by the static methods in this class.
+      
+      MediaSize tmp = MediaSize.ISO.A0;
+      tmp = MediaSize.JIS.B0;
+      tmp = MediaSize.Engineering.A;
+      tmp = MediaSize.NA.LEGAL;
+      tmp = MediaSize.Other.EXECUTIVE;
+    }
+  
+  private MediaSizeName mediaName;
+  
+  /**
+   * Creates a <code>MediaSize</code> object. The created object will be added 
+   * to an internal cache used in the static methods of this class for lookup 
+   * of available <code>MediaSize</code> instances.
+   *
+   * @param x the size in x direction
+   * @param y the size in y direction
+   * @param units the units to use for the sizes
+   *
+   * @exception IllegalArgumentException if x or y < 0 or units < 1
+   * 
+   * @see #findMedia(float, float, int)
+   * @see #getMediaSizeForName(MediaSizeName)
+   */
+  public MediaSize(float x, float y, int units)
+  {
+    super(x, y, units);
+    mediaCache.add(this);
+  }
+  
+  /**
+   * Creates a <code>MediaSize</code> object associated with the given
+   * media name. The created object will be added to an internal cache used 
+   * in the static methods of this class for lookup of available 
+   * <code>MediaSize</code> instances.
+   *
+   * @param x the size in x direction
+   * @param y the size in y direction
+   * @param units the units to use for the sizes
+   * @param media the media name to associate
+   *
+   * @exception IllegalArgumentException if x or y < 0 or units < 1
+   * 
+   * @see #findMedia(float, float, int)
+   * @see #getMediaSizeForName(MediaSizeName)
+   */
+  public MediaSize(float x, float y, int units, MediaSizeName media)
+  {
+    super(x, y, units);
+    mediaName = media;
+    mediaCache.add(this);
+  }
+  
+  /**
+   * Creates a <code>MediaSize</code> object. The created object will be added 
+   * to an internal cache used in the static methods of this class for lookup 
+   * of available <code>MediaSize</code> instances.
+   *
+   * @param x the size in x direction
+   * @param y the size in y direction
+   * @param units the units to use for the sizes
+   *
+   * @exception IllegalArgumentException if x or y < 0 or units < 1
+   * 
+   * @see #findMedia(float, float, int)
+   * @see #getMediaSizeForName(MediaSizeName)
+   */
+  public MediaSize(int x, int y, int units)
+  {
+    super(x, y, units);
+    mediaCache.add(this);
+  }
+  
+  /**
+   * Creates a <code>MediaSize</code> object associated with the given
+   * media name. The created object will be added to an internal cache used 
+   * in the static methods of this class for lookup of available 
+   * <code>MediaSize</code> instances.
+   *
+   * @param x the size in x direction
+   * @param y the size in y direction
+   * @param units the units to use for the sizes
+   * @param media the media name to associate
+   *
+   * @exception IllegalArgumentException if x or y < 0 or units < 1
+   * 
+   * @see #findMedia(float, float, int)
+   * @see #getMediaSizeForName(MediaSizeName)
+   */
+  public MediaSize(int x, int y, int units, MediaSizeName media)
+  {
+    super(x, y, units);
+    mediaName = media;
+    mediaCache.add(this);
+  }
+  
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>MediaSize</code> itself.
+   */
+  public final Class getCategory()
+  {
+    return MediaSize.class;
+  }
+    
+  /**
+   * Searches for a MediaSize object with the given dimensions.
+   * If none is found with exact dimensions, the closest match is used.
+   * Afterwards the MediaSizeName of the found MediaSize object is 
+   * returned - which might be null if none is specified.
+   * 
+   * @param x the dimension for x
+   * @param y the dimension for y
+   * @param units the units to be used for comparison
+   * @return the corresponding MediaSizeName object, or null
+   */
+  public static MediaSizeName findMedia(float x, float y, int units)
+  {
+    if (x <= 0.0f || y <= 0.0f)
+      throw new IllegalArgumentException(
+        "x and/or y may not be less or equal 0");
+
+    if (units < 1)
+      throw new IllegalArgumentException("units may not be less then 1");
+
+    MediaSize bestMatch = null;
+    int bestDistance = Integer.MAX_VALUE;
+
+    int xMicro = (int) x * units;
+    int yMicro = (int) y * units;
+
+    for (int i = 0; i < mediaCache.size(); i++)
+      {
+        MediaSize size = (MediaSize) mediaCache.get(i);
+        int dist = (Math.abs(size.getXMicrometers() - xMicro) 
+                    + Math.abs(size.getYMicrometers() - yMicro));
+
+        if (dist < bestDistance)
+          {
+            bestMatch = size;
+            bestDistance = dist;
+          }
+      }
+
+    return bestMatch.getMediaSizeName();
+  }
+  
+  /**
+   * Returns the associated <code>MediaSize</code> instance for the 
+   * given named media <code>MediaSizeName</code> instance.
+   * 
+   * @param media the named media to search for.
+   * @return The corresponding <code>MediaSize</code> instance or 
+   * <code>null</code> if none found.
+   */
+  public static MediaSize getMediaSizeForName(MediaSizeName media)
+  {
+    for (int i = 0; i < mediaCache.size(); i++)
+      {
+	MediaSize size = (MediaSize) mediaCache.get(i);
+	
+	if (size.getMediaSizeName().equals(media))
+	  return size;
+      }
+
+    return null;
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if (!(obj instanceof MediaSize))
+      return false;
+
+    MediaSize tmp = (MediaSize) obj;
+    return (tmp.getXMicrometers() == this.getXMicrometers()
+            && tmp.getYMicrometers() == this.getYMicrometers());
+  }
+  
+  /**
+   * Returns the media name of this size.
+   * 
+   * @return The media name.
+   */
+  public MediaSizeName getMediaSizeName()
+  {
+    return mediaName;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "media-size".
+   */
+  public final String getName()
+  {
+    return "media-size";
+  }
+
+  /**
+   * Container class for predefined ISO media sizes.
+   * 
+   * @author Sven de Marothy (sven at physto.se)
+   */
+  public static final class ISO 
+  {
+    private ISO()
+    {
+      // prevent instantiation
+    }
+    
+    /**
+     * ISO A0 paper, 841 mm x 1189 mm.
+     */
+    public static final MediaSize A0 = new MediaSize(841, 1189, 
+					       MediaSize.MM, 
+					       MediaSizeName.ISO_A0);
+
+    /**
+     * ISO A1 paper, 594 mm x 841 mm
+     */
+    public static final MediaSize A1 = new MediaSize(594, 841, MediaSize.MM, 
+					       MediaSizeName.ISO_A1);
+
+    /**
+     * ISO A2 paper, 420 mm x 594 mm
+     */
+    public static final MediaSize A2 = new MediaSize(420, 594, MediaSize.MM, MediaSizeName.ISO_A2);
+
+    /**
+     * ISO A3 paper, 297 mm x 420 mm
+     */
+    public static final MediaSize A3 = new MediaSize(297, 420, MediaSize.MM, MediaSizeName.ISO_A3);
+
+    /**
+     * ISO A4 paper, 210 mm x 297 mm
+     */
+    public static final MediaSize A4 = new MediaSize(210, 297, MediaSize.MM, MediaSizeName.ISO_A4);
+
+    /**
+     * ISO A5 paper, 148 mm x 210 mm
+     */
+    public static final MediaSize A5 = new MediaSize(148, 210, MediaSize.MM, MediaSizeName.ISO_A5);
+
+    /**
+     * ISO A6 paper, 105 mm x 148 mm
+     */
+    public static final MediaSize A6 = new MediaSize(105, 148, MediaSize.MM, MediaSizeName.ISO_A6);
+
+    /**
+     * ISO A7 paper, 74 mm x 105 mm
+     */
+    public static final MediaSize A7 = new MediaSize(74, 105, MediaSize.MM, MediaSizeName.ISO_A7);
+
+    /**
+     * ISO A8 paper, 52 mm x 74 mm
+     */
+    public static final MediaSize A8 = new MediaSize(52, 74, MediaSize.MM, MediaSizeName.ISO_A8);
+
+    /**
+     * ISO A9 paper, 37 mm x 52 mm
+     */
+    public static final MediaSize A9 = new MediaSize(37, 52, MediaSize.MM, MediaSizeName.ISO_A9);
+
+    /**
+     * ISO A10 paper, 26 mm x 37 mm
+     */
+    public static final MediaSize A10 = new MediaSize(26, 37, MediaSize.MM, MediaSizeName.ISO_A10);
+
+
+    /**
+     * ISO B0 paper, 1000 mm x 1414 mm
+     */
+    public static final MediaSize B0 = new MediaSize(1000, 1414, MediaSize.MM, MediaSizeName.ISO_B0);
+
+    /**
+     * ISO B1 paper, 707 mm x 1000 mm
+     */
+    public static final MediaSize B1 = new MediaSize(707, 1000, MediaSize.MM, MediaSizeName.ISO_B1);
+
+    /**
+     * ISO B2 paper, 500 mm x 707 mm
+     */
+    public static final MediaSize B2 = new MediaSize(500, 707, MediaSize.MM, MediaSizeName.ISO_B2);
+
+    /**
+     * ISO B3 paper, 353 mm x 500 mm
+     */
+    public static final MediaSize B3 = new MediaSize(353, 500, MediaSize.MM, MediaSizeName.ISO_B3);
+
+    /**
+     * ISO B4 paper, 250 mm x 353 mm
+     */
+    public static final MediaSize B4 = new MediaSize(250, 353, MediaSize.MM, MediaSizeName.ISO_B4);
+
+    /**
+     * ISO B5 paper, 176 mm x 250 mm
+     */
+    public static final MediaSize B5 = new MediaSize(176, 250, MediaSize.MM, MediaSizeName.ISO_B5);
+
+    /**
+     * ISO B6 paper, 125 mm x 176 mm
+     */
+    public static final MediaSize B6 = new MediaSize(125, 176, MediaSize.MM, MediaSizeName.ISO_B6);
+
+    /**
+     * ISO B7 paper, 88 mm x 125 mm
+     */
+    public static final MediaSize B7 = new MediaSize(88, 125, MediaSize.MM, MediaSizeName.ISO_B7);
+
+    /**
+     * ISO B8 paper, 62 mm x 88 mm
+     */
+    public static final MediaSize B8 = new MediaSize(62, 88, MediaSize.MM, MediaSizeName.ISO_B8);
+
+    /**
+     * ISO B9 paper, 44 mm x 62 mm
+     */
+    public static final MediaSize B9 = new MediaSize(44, 62, MediaSize.MM, MediaSizeName.ISO_B9);
+
+    /**
+     * ISO B10 paper, 31 mm x 44 mm
+     */
+    public static final MediaSize B10 = new MediaSize(31, 44, MediaSize.MM, MediaSizeName.ISO_B10);
+    
+    /**
+     * ISO C3 envelope, 324 mm x 458 mm
+     */
+    public static final MediaSize C3 = new MediaSize(324, 458, MediaSize.MM, MediaSizeName.ISO_C3);
+
+    /**
+     * ISO C4 envelope, 229 mm x 324 mm
+     */
+    public static final MediaSize C4 = new MediaSize(229, 324, MediaSize.MM, MediaSizeName.ISO_C4);
+
+    /**
+     * ISO C5 envelope, 162 mm x 229 mm
+     */
+    public static final MediaSize C5 = new MediaSize(162, 229, MediaSize.MM, MediaSizeName.ISO_C5);
+
+    /**
+     * ISO C6 envelope, 114 mm x 162 mm
+     */
+    public static final MediaSize C6 = new MediaSize(114, 162, MediaSize.MM, MediaSizeName.ISO_C6);
+
+    /**
+     * ISO ISO Designated Long paper, 324 mm x 458 mm
+     */
+    public static final MediaSize DESIGNATED_LONG = 
+      new MediaSize(324, 458, MediaSize.MM, MediaSizeName.ISO_DESIGNATED_LONG);
+  } 
+
+  /**
+   * Container class for predefined North American media sizes.
+   * 
+   * @author Sven de Marothy (sven at physto.se)
+   */
+  public static final class NA
+  {
+    private NA()
+    {
+      // prevent instantiation
+    }
+    
+    /**
+     * US Legal paper size, 8.5 inch x 14 inch
+     */
+    public static final MediaSize LEGAL = new MediaSize(8.5f, 14f, MediaSize.INCH, 
+						  MediaSizeName.NA_LEGAL);
+
+    /**
+     * US Letter paper size, 8.5 inch x 11 inch
+     */
+    public static final MediaSize LETTER = new MediaSize(8.5f, 11f, MediaSize.INCH,
+						   MediaSizeName.NA_LETTER);
+
+    /**
+     * 5 inch x 7 inch paper size.
+     */
+    public static final MediaSize NA_5X7 = new MediaSize(5, 7, MediaSize.INCH,
+							 MediaSizeName.NA_5X7);
+
+    /**
+     * 8 inch x 10 inch paper size.
+     */
+    public static final MediaSize NA_8X10 = new MediaSize(8, 10, MediaSize.INCH,
+							  MediaSizeName.NA_8X10);
+
+    /**
+     * 6 inch x 9 inch envelope size.
+     */
+    public static final MediaSize NA_6X9_ENVELOPE = new MediaSize(6f, 9f, 
+								  MediaSize.INCH,
+								  MediaSizeName.NA_6X9_ENVELOPE);
+
+    /**
+     * 7 inch x 9 inch envelope size.
+     */
+    public static final MediaSize NA_7X9_ENVELOPE = new MediaSize(7f, 9f, 
+								  MediaSize.INCH,
+								  MediaSizeName.NA_7X9_ENVELOPE);
+
+    /**
+     * 9 inch x 11 inch envelope size.
+     */
+    public static final MediaSize NA_9x11_ENVELOPE = new MediaSize(9f, 11f, 
+							     MediaSize.INCH,
+							     MediaSizeName.NA_9X11_ENVELOPE);
+
+    /**
+     * 9 inch x 12 inch envelope size.
+     */
+    public static final MediaSize NA_9x12_ENVELOPE = new MediaSize(9f, 12f, 
+							     MediaSize.INCH,
+							     MediaSizeName.NA_9X12_ENVELOPE);
+
+
+    /**
+     * 10 inch x 13 inch envelope size.
+     */
+    public static final MediaSize NA_10x13_ENVELOPE = new MediaSize(10f, 13f, 
+							      MediaSize.INCH,
+							      MediaSizeName.NA_10X13_ENVELOPE);
+
+    /**
+     * 10 inch x 14 inch envelope size.
+     */
+    public static final MediaSize NA_10x14_ENVELOPE = new MediaSize(10f, 14f, 
+							      MediaSize.INCH,
+							      MediaSizeName.NA_10X14_ENVELOPE);
+
+    /**
+     * 10 inch x 15 inch envelope size.
+     */
+    public static final MediaSize NA_10X15_ENVELOPE = new MediaSize(10f, 15f, 
+							      MediaSize.INCH,
+							      MediaSizeName.NA_10X15_ENVELOPE);
+
+    /**
+     * Number 9 envelope size. 4.5 inch x 10.375 inch
+     */
+    public static final MediaSize NA_NUMBER_9_ENVELOPE = new MediaSize(3.875f, 8.875f,
+								 MediaSize.INCH,
+								 MediaSizeName.NA_NUMBER_9_ENVELOPE);
+
+    /**
+     * Number 10 envelope size. 4.125 inch x 9.5 inch
+     */
+    public static final MediaSize NA_NUMBER_10_ENVELOPE = 
+      new MediaSize(4.125f, 9.5f, MediaSize.INCH, MediaSizeName.NA_NUMBER_10_ENVELOPE);
+
+    /**
+     * Number 11 envelope size. 4.5 inch x 10.375 inch
+     */
+    public static final MediaSize NA_NUMBER_11_ENVELOPE = new MediaSize(4.5f, 10.375f, MediaSize.INCH,
+								  MediaSizeName.NA_NUMBER_11_ENVELOPE);
+    
+    /**
+     * Number 12 envelope size. 4.75 inch x 11 inch
+     */
+    public static final MediaSize NA_NUMBER_12_ENVELOPE = new MediaSize(4.75f, 11f, 
+								  MediaSize.INCH,
+								  MediaSizeName.NA_NUMBER_12_ENVELOPE);
+
+  /**
+   * Number 14 envelope size. 5 inch x 11.5 inch
+   */
+  public static final MediaSize NA_NUMBER_14_ENVELOPE = new MediaSize(5f, 11.5f, 
+								MediaSize.INCH,
+								MediaSizeName.NA_NUMBER_14_ENVELOPE);
+  }
+
+  /**
+   * Container class for predefined US Engineering media sizes.
+   * 
+   * @author Sven de Marothy (sven at physto.se)
+   */
+  public static final class Engineering 
+  {
+    private Engineering()
+    {
+      // prevent instantiation
+    }
+    
+    /**
+     * ANSI A paper size. 8.5 inch x 11 inch
+     */
+    public static final MediaSize A = new MediaSize(8.5f, 11f, 
+					      MediaSize.INCH, MediaSizeName.A);
+
+    /**
+     * ANSI B paper size. 11 inch x 17 inch
+     */
+    public static final MediaSize B = new MediaSize(11f, 17f, 
+					      MediaSize.INCH, MediaSizeName.B);
+
+    /**
+     * ANSI C paper size. 17 inch x 22 inch
+     */
+    public static final MediaSize C = new MediaSize(17f, 22f, 
+					      MediaSize.INCH, MediaSizeName.C);
+
+    /**
+     * ANSI D paper size. 22 inch x 34 inch
+     */
+    public static final MediaSize D = new MediaSize(22f, 34f, 
+					      MediaSize.INCH, MediaSizeName.D);
+
+    /**
+     * ANSI E paper size. 33 inch x 44 inch
+     */
+    public static final MediaSize E = new MediaSize(34f, 44f, 
+					      MediaSize.INCH, MediaSizeName.E);
+  }
+
+  /**
+   * Container class for predefined Japanese JIS media sizes.
+   * 
+   * @author Sven de Marothy (sven at physto.se)
+   */
+  public static final class JIS 
+  {
+    private JIS()
+    {
+      // prevent instantiation
+    }
+    
+    /**
+     * JIS B0 paper. 1030 mm x 1456 mm
+     * Note: The JIS B-series is not identical to the ISO B-series.
+     */
+    public static final MediaSize B0 = new MediaSize(1030, 1456, MediaSize.MM, MediaSizeName.JIS_B0);
+
+    /**
+     * JIS B1 paper. 1030 mm x 1456 mm
+     * Note: The JIS B-series is not identical to the ISO B-series.
+     */
+    public static final MediaSize B1 = new MediaSize(728, 1030, MediaSize.MM, MediaSizeName.JIS_B1);
+
+    /**
+     * JIS B2 paper. 515 mm x 728 mm
+     * Note: The JIS B-series is not identical to the ISO B-series.
+     */
+    public static final MediaSize B2 = new MediaSize(515, 728, MediaSize.MM, MediaSizeName.JIS_B2);
+
+    /**
+     * JIS B3 paper. 364 mm x 515 mm
+     * Note: The JIS B-series is not identical to the ISO B-series.
+     */
+    public static final MediaSize B3 = new MediaSize(364, 515, MediaSize.MM, MediaSizeName.JIS_B3);
+
+    /**
+     * JIS B4 paper. 257 mm x 364 mm
+     * Note: The JIS B-series is not identical to the ISO B-series.
+     */
+    public static final MediaSize B4 = new MediaSize(257, 364, MediaSize.MM, MediaSizeName.JIS_B4);
+
+    /**
+     * JIS B5 paper. 1030 mm x 1456 mm
+     * Note: The JIS B-series is not identical to the ISO B-series.
+     */
+    public static final MediaSize B5 = new MediaSize(182, 257, MediaSize.MM, MediaSizeName.JIS_B5);
+
+    /**
+     * JIS B6 paper. 128 mm x 182 mm
+     * Note: The JIS B-series is not identical to the ISO B-series.
+     */
+    public static final MediaSize B6 = new MediaSize(128, 182, MediaSize.MM, MediaSizeName.JIS_B6);
+
+    /**
+     * JIS B7 paper. 91 mm x 128 mm
+     * Note: The JIS B-series is not identical to the ISO B-series.
+     */
+    public static final MediaSize B7 = new MediaSize(91, 128, MediaSize.MM, MediaSizeName.JIS_B7);
+
+    /**
+     * JIS B8 paper. 64 mm x 91 mm
+     * Note: The JIS B-series is not identical to the ISO B-series.
+     */
+    public static final MediaSize B8 = new MediaSize(64, 91, MediaSize.MM, MediaSizeName.JIS_B8);
+
+    /**
+     * JIS B9 paper. 45 mm x 64 mm
+     * Note: The JIS B-series is not identical to the ISO B-series.
+     */
+    public static final MediaSize B9 = new MediaSize(45, 64, MediaSize.MM, MediaSizeName.JIS_B9);
+
+    /**
+     * JIS B10 paper. 32 mm x 45 mm
+     * Note: The JIS B-series is not identical to the ISO B-series.
+     */
+    public static final MediaSize B10 = new MediaSize(32, 45, MediaSize.MM, MediaSizeName.JIS_B10);
+
+    /**
+     * JIS chou #1 envelope size, 142 mm x 332 mm
+     */
+    public static final MediaSize CHOU_1 = new MediaSize(142, 332, MediaSize.MM);
+
+    /**
+     * JIS chou #2 envelope size, 119 mm x 227 mm
+     */
+    public static final MediaSize CHOU_2 = new MediaSize(119, 227, MediaSize.MM);
+
+    /**
+     * JIS chou #3 envelope size, 120 mm x 235 mm
+     */
+    public static final MediaSize CHOU_3 = new MediaSize(120, 235, MediaSize.MM);
+
+    /**
+     * JIS chou #4 envelope size, 90 mm x 205 mm
+     */
+    public static final MediaSize CHOU_4 = new MediaSize(90, 205, MediaSize.MM);
+
+    /**
+     * JIS chou #30 envelope size, 92 mm x 235 mm
+     */
+    public static final MediaSize CHOU_30 = new MediaSize(92, 235, MediaSize.MM);
+
+    /**
+     * JIS chou #40 envelope size, 90 mm x 225 mm
+     */
+    public static final MediaSize CHOU_40 = new MediaSize(90, 225, MediaSize.MM);
+
+    /**
+     * JIS kaku #0 envelope size, 287 mm x 382 mm
+     */
+    public static final MediaSize KAKU_0 = new MediaSize(287, 382, MediaSize.MM);
+
+    /**
+     * JIS kaku #1 envelope size, 270 mm x 382 mm
+     */
+    public static final MediaSize KAKU_1 = new MediaSize(270, 382, MediaSize.MM);
+
+    /**
+     * JIS kaku #2 envelope size, 240 mm x 332 mm
+     */
+    public static final MediaSize KAKU_2 = new MediaSize(240, 332, MediaSize.MM);
+
+    /**
+     * JIS kaku #20 envelope size, 229 mm x 324 mm
+     */
+    public static final MediaSize KAKU_20 = new MediaSize(229, 324, MediaSize.MM);
+
+    /**
+     * JIS kaku #3 envelope size, 216 mm x 227 mm
+     */
+    public static final MediaSize KAKU_3 = new MediaSize(216, 227, MediaSize.MM);
+
+    /**
+     * JIS kaku #4 envelope size, 197 mm x 267 mm
+     */
+    public static final MediaSize KAKU_4 = new MediaSize(197, 267, MediaSize.MM);
+
+    /**
+     * JIS kaku #5 envelope size, 190 mm x 240 mm
+     */
+    public static final MediaSize KAKU_5 = new MediaSize(190, 240, MediaSize.MM);
+
+    /**
+     * JIS kaku #6 envelope size, 162 mm x 229 mm
+     */
+    public static final MediaSize KAKU_6 = new MediaSize(162, 229, MediaSize.MM);
+
+    /**
+     * JIS kaku #7 envelope size, 142 mm x 205 mm
+     */
+    public static final MediaSize KAKU_7 = new MediaSize(142, 205, MediaSize.MM);
+
+    /**
+     * JIS kaku #8 envelope size, 119 mm x 197 mm
+     */
+    public static final MediaSize KAKU_8 = new MediaSize(119, 197, MediaSize.MM);
+
+    /**
+     * JIS kaku A4 envelope size, 228 mm x 312 mm
+     */
+    public static final MediaSize KAKU_A4 = new MediaSize(228, 312, MediaSize.MM);
+
+    /**
+     * JIS you #1 envelope size, 120 mm x 176 mm
+     */
+    public static final MediaSize YOU_1 = new MediaSize(120, 176, MediaSize.MM);
+
+    /**
+     * JIS you #2 envelope size, 114 mm x 162 mm
+     */
+    public static final MediaSize YOU_2 = new MediaSize(114, 162, MediaSize.MM);
+
+    /**
+     * JIS you #3 envelope size, 98 mm x 148 mm
+     */
+    public static final MediaSize YOU_3 = new MediaSize(98, 148, MediaSize.MM);
+
+    /**
+     * JIS you #4 envelope size, 105 mm x 235 mm
+     */
+    public static final MediaSize YOU_4 = new MediaSize(105, 235, MediaSize.MM);
+
+    /**
+     * JIS you #5 envelope size, 95 mm x 217 mm
+     */
+    public static final MediaSize YOU_5 = new MediaSize(95, 217, MediaSize.MM);
+
+    /**
+     * JIS you #6 envelope size, 98 mm x 190 mm
+     */
+    public static final MediaSize YOU_6 = new MediaSize(98, 190, MediaSize.MM);
+
+    /**
+     * JIS you #7 envelope size, 92 mm x 165 mm
+     */
+    public static final MediaSize YOU_7 = new MediaSize(92, 165, MediaSize.MM);
+  }
+
+  /**
+   * Container class for miscellaneous media sizes.
+   * 
+   * @author Sven de Marothy (sven at physto.se)
+   */
+  public static final class Other
+  {
+    private Other()
+    {
+      // prevent instantiation
+    }
+    
+    /**
+     * US Executive paper size, 7.25 inch x 10.5 inch
+     */
+    public static final MediaSize EXECUTIVE = new MediaSize(7.25f, 10.5f, 
+						      MediaSize.INCH, MediaSizeName.EXECUTIVE);
+
+    /**
+     * US Folio paper size, 8.5 inch x 13 inch
+     */
+    public static final MediaSize FOLIO = new MediaSize(8.5f, 13f, MediaSize.INCH, MediaSizeName.FOLIO);
+
+    /**
+     * US Quarto paper size, 8.5 inches by 10.83 inches.
+     */
+    public static final MediaSize QUARTO = new MediaSize(8.5f, 10.83f, MediaSize.INCH,
+						   MediaSizeName.QUARTO);
+
+    /**
+     * US Invoice size, 5.5 inch x 8.5 inch
+     */
+    public static final MediaSize INVOICE = new MediaSize(5.5f, 8.5f, 
+						    MediaSize.INCH, MediaSizeName.INVOICE);
+
+    /**
+     * US Ledger size, 11 inch x 17 inch
+     */
+    public static final MediaSize LEDGER = new MediaSize(11, 17, MediaSize.INCH, 
+						   MediaSizeName.LEDGER);
+
+    /**
+     * Monarch (7 3/4) envelope size, 3.87 inch x 7.5 inch
+     */
+    public static final MediaSize MONARCH_ENVELOPE = new MediaSize(3.87f, 7.5f, 
+							     MediaSize.INCH,
+							     MediaSizeName.MONARCH_ENVELOPE);
+
+    /**
+     * Personal envelope size, 3.625 inch x 6.5 inch.
+     */
+    public static final MediaSize PERSONAL_ENVELOPE = new MediaSize(3.625f, 6.5f, MediaSize.INCH,
+							      MediaSizeName.PERSONAL_ENVELOPE);
+
+    /**
+     * Italian envelope size, 110 mm x 230 mm
+     */
+    public static final MediaSize ITALY_ENVELOPE = new MediaSize(110, 230, 
+							   MediaSize.MM,
+							   MediaSizeName.ITALY_ENVELOPE);
+
+    /**
+     * Japanese postcard, 100 mm x 148 mm
+     */
+    public static final MediaSize JAPANESE_POSTCARD = new MediaSize(100, 148, MediaSize.MM, MediaSizeName.JAPANESE_POSTCARD);
+
+    /**
+     * Japanese double postcard, 148 mm x 200 mm
+     */
+    public static final MediaSize JAPANESE_DOUBLE_POSTCARD = new MediaSize(148, 200, MediaSize.MM, MediaSizeName.JAPANESE_DOUBLE_POSTCARD);
+    
+    /**
+     * Tabloid size, 11 inch x 17 inch.
+     * @since 1.5
+     */
+    public static final MediaSize TABLOID = 
+      new MediaSize(11, 17, Size2DSyntax.INCH, MediaSizeName.TABLOID);
+  }
+}
+

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaSizeName.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaSizeName.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaSizeName.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaSizeName.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,497 @@
+/* MediaSizeName.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.EnumSyntax;
+
+/**
+ * <code>MediaSizeName</code> is a subclass of the <code>Media</code> printing 
+ * attribute and provides selection of media to be used by the means of 
+ * defined size names. The class pre-defines commonly available media sizes. 
+ * This media type enumeration may be used in alternative to 
+ * MediaName/MediaTray.
+ * <p>
+ * <b>IPP Compatibility:</b> MediaSizeName is not an IPP 1.1 attribute on its 
+ * own. It provides parts of the <code>media</code> attribute type values.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public class MediaSizeName extends Media
+{
+  private static final long serialVersionUID = 2778798329756942747L;
+
+  /**
+   * The ISO A0 size: 841 mm by 1189 mm.
+   */
+  public static final MediaSizeName ISO_A0 = new MediaSizeName(0);
+  
+  /**
+   * The ISO A1 size: 594 mm by 841 mm.
+   */
+  public static final MediaSizeName ISO_A1 = new MediaSizeName(1);
+  
+  /**
+   * The ISO A2 size: 420 mm by 594 mm.
+   */
+  public static final MediaSizeName ISO_A2 = new MediaSizeName(2);
+  
+  /**
+   * The ISO A3 size: 297 mm by 420 mm.
+   */
+  public static final MediaSizeName ISO_A3 = new MediaSizeName(3);
+  
+  /**
+   * The ISO A4 size: 210 mm by 297 mm.
+   */
+  public static final MediaSizeName ISO_A4 = new MediaSizeName(4);
+  
+  /**
+   * The ISO A5 size: 148 mm by 210 mm.
+   */
+  public static final MediaSizeName ISO_A5 = new MediaSizeName(5);
+  
+  /**
+   * The ISO A6 size: 105 mm by 148 mm.
+   */
+  public static final MediaSizeName ISO_A6 = new MediaSizeName(6);
+  
+  /**
+   * The ISO A7 size: 74 mm by 105 mm.
+   */
+  public static final MediaSizeName ISO_A7 = new MediaSizeName(7);
+  
+  /**
+   * The ISO A8 size: 52 mm by 74 mm.
+   */
+  public static final MediaSizeName ISO_A8 = new MediaSizeName(8);
+  
+  /**
+   * The ISO A9 size: 37 mm by 52 mm.
+   */
+  public static final MediaSizeName ISO_A9 = new MediaSizeName(9);
+  
+  /**
+   * The ISO A10 size: 26 mm by 37 mm.
+   */
+  public static final MediaSizeName ISO_A10 = new MediaSizeName(10);
+  
+  /**
+   * The ISO B0 size: 1000 mm by 1414 mm.
+   */
+  public static final MediaSizeName ISO_B0 = new MediaSizeName(11);
+  
+  /**
+   * The ISO B1 size: 707 mm by 1000 mm.
+   */
+  public static final MediaSizeName ISO_B1 = new MediaSizeName(12);
+  
+  /**
+   * The ISO B2 size: 500 mm by 707 mm.
+   */
+  public static final MediaSizeName ISO_B2 = new MediaSizeName(13);
+  
+  /**
+   * The ISO B3 size: 353 mm by 500 mm.
+   */
+  public static final MediaSizeName ISO_B3 = new MediaSizeName(14);
+  
+  /**
+   * The ISO B4 size: 250 mm by 353 mm.
+   */
+  public static final MediaSizeName ISO_B4 = new MediaSizeName(15);
+  
+  /**
+   * The ISO B5 size: 176 mm by 250 mm.
+   */
+  public static final MediaSizeName ISO_B5 = new MediaSizeName(16);
+  
+  /**
+   * The ISO B6 size: 125 mm by 176 mm.
+   */
+  public static final MediaSizeName ISO_B6 = new MediaSizeName(17);
+  
+  /**
+   * The ISO B7 size: 88 mm by 125 mm.
+   */
+  public static final MediaSizeName ISO_B7 = new MediaSizeName(18);
+  
+  /**
+   * The ISO B8 size: 62 mm by 88 mm.
+   */
+  public static final MediaSizeName ISO_B8 = new MediaSizeName(19);
+  
+  /**
+   * The ISO B9 size: 44 mm by 62 mm.
+   */
+  public static final MediaSizeName ISO_B9 = new MediaSizeName(20);
+  
+  /**
+   * The ISO B10 size: 31 mm by 44 mm.
+   */
+  public static final MediaSizeName ISO_B10 = new MediaSizeName(21);
+  
+  /**
+   * The JIS B0 size: 1030mm x 1456mm.
+   */
+  public static final MediaSizeName JIS_B0 = new MediaSizeName(22);
+  
+  /**
+   * The JIS B1 size: 728mm x 1030mm.
+   */
+  public static final MediaSizeName JIS_B1 = new MediaSizeName(23);
+  
+  /**
+   * The JIS B2 size: 515mm x 728mm.
+   */
+  public static final MediaSizeName JIS_B2 = new MediaSizeName(24);
+  
+  /**
+   * The JIS B3 size: 364mm x 515mm.
+   */
+  public static final MediaSizeName JIS_B3 = new MediaSizeName(25);
+  
+  /**
+   * The JIS B4 size: 257mm x 364mm.
+   */
+  public static final MediaSizeName JIS_B4 = new MediaSizeName(26);
+  
+  /**
+   * The JIS B5 size: 182mm x 257mm.
+   */
+  public static final MediaSizeName JIS_B5 = new MediaSizeName(27);
+  
+  /**
+   * The JIS B6 size: 128mm x 182mm.
+   */
+  public static final MediaSizeName JIS_B6 = new MediaSizeName(28);
+  
+  /**
+   * The JIS B7 size: 91mm x 128mm.
+   */
+  public static final MediaSizeName JIS_B7 = new MediaSizeName(29);
+  
+  /**
+   * The JIS B8 size: 64mm x 91mm.
+   */
+  public static final MediaSizeName JIS_B8 = new MediaSizeName(30);
+  
+  /**
+   * The JIS B9 size: 45mm x 64mm.
+   */
+  public static final MediaSizeName JIS_B9 = new MediaSizeName(31);
+  
+  /**
+   * The JIS B10 size: 32mm x 45mm.
+   */
+  public static final MediaSizeName JIS_B10 = new MediaSizeName(32);
+  
+  /**
+   * The ISO C0 size: 917 mm by 1297 mm.
+   */
+  public static final MediaSizeName ISO_C0 = new MediaSizeName(33);
+  
+  /**
+   * The ISO C1 size: 648 mm by 917 mm.
+   */
+  public static final MediaSizeName ISO_C1 = new MediaSizeName(34);
+  
+  /**
+   * The ISO C2 size: 458 mm by 648 mm.
+   */
+  public static final MediaSizeName ISO_C2 = new MediaSizeName(35);
+  
+  /**
+   * The ISO C3 size: 324 mm by 458 mm.
+   */
+  public static final MediaSizeName ISO_C3 = new MediaSizeName(36);
+  
+  /**
+   * The ISO C4 size: 229 mm by 324 mm.
+   */
+  public static final MediaSizeName ISO_C4 = new MediaSizeName(37);
+  
+  /**
+   * The ISO C5 size: 162 mm by 229 mm.
+   */
+  public static final MediaSizeName ISO_C5 = new MediaSizeName(38);
+  
+  /**
+   * The ISO C6 size: 114 mm by 162 mm.
+   */
+  public static final MediaSizeName ISO_C6 = new MediaSizeName(39);
+  
+  /**
+   * The North American letter size: 8.5 inches by 11 inches.
+   */
+  public static final MediaSizeName NA_LETTER = new MediaSizeName(40);
+  
+  /**
+   * The North American legal size: 8.5 inches by 14 inches.
+   */
+  public static final MediaSizeName NA_LEGAL = new MediaSizeName(41);
+  
+  /**
+   * The executive size: 7.25 inches by 10.5 inches.
+   */
+  public static final MediaSizeName EXECUTIVE = new MediaSizeName(42);
+  
+  /**
+   * The ledger size: 11 inches by 17 inches.
+   */
+  public static final MediaSizeName LEDGER = new MediaSizeName(43);
+  
+  /**
+   * The tabloid size: 11 inches by 17 inches.
+   */
+  public static final MediaSizeName TABLOID = new MediaSizeName(44);
+  
+  /**
+   * The invoice size: 5.5 inches by 8.5 inches.
+   */
+  public static final MediaSizeName INVOICE = new MediaSizeName(45);
+  
+  /**
+   * The folio size: 8.5 inches by 13 inches.
+   */
+  public static final MediaSizeName FOLIO = new MediaSizeName(46);
+  
+  /**
+   * The quarto size: 8.5 inches by 10.83 inches.
+   */
+  public static final MediaSizeName QUARTO = new MediaSizeName(47);
+  
+  /**
+   * The Japanese postcard size, 100 mm by 148 mm.
+   */
+  public static final MediaSizeName JAPANESE_POSTCARD = new MediaSizeName(48);
+  
+  /**
+   * The Japanese Double postcard size: 148 mm by 200 mm.
+   */
+  public static final MediaSizeName JAPANESE_DOUBLE_POSTCARD =
+    new MediaSizeName(49);
+  
+  /**
+   * The engineering ANSI A size medium: 8.5 inches x 11 inches.
+   */
+  public static final MediaSizeName A = new MediaSizeName(50);
+  
+  /**
+   * The engineering ANSI B size medium: 11 inches x 17 inches.
+   */
+  public static final MediaSizeName B = new MediaSizeName(51);
+  
+  /**
+   * The engineering ANSI C size medium: 17 inches x 22 inches.
+   */
+  public static final MediaSizeName C = new MediaSizeName(52);
+  
+  /**
+   * The engineering ANSI D size medium: 22 inches x 34 inches.
+   */
+  public static final MediaSizeName D = new MediaSizeName(53);
+  
+  /**
+   * The engineering ANSI E size medium: 34 inches x 44 inches.
+   */
+  public static final MediaSizeName E = new MediaSizeName(54);
+  
+  /**
+   * The ISO Designated Long size: 110 mm by 220 mm.
+   */
+  public static final MediaSizeName ISO_DESIGNATED_LONG =
+    new MediaSizeName(55);
+  
+  /**
+   * The Italy envelope size: 110 mm by 230 mm.
+   */
+  public static final MediaSizeName ITALY_ENVELOPE = new MediaSizeName(56);
+  
+  /**
+   * The Monarch envelope size: 3.87 inch by 7.5 inch.
+   */
+  public static final MediaSizeName MONARCH_ENVELOPE = new MediaSizeName(57);
+  
+  /**
+   * The Personal envelope size: 3.625 inch by 6.5 inch.
+   */
+  public static final MediaSizeName PERSONAL_ENVELOPE = new MediaSizeName(58);
+  
+  /**
+   * The North American number 9 business envelope size: 
+   * 3.875 inches by 8.875 inches.
+   */
+  public static final MediaSizeName NA_NUMBER_9_ENVELOPE =
+    new MediaSizeName(59);
+  
+  /**
+   * The North American number 10 business envelope size:  
+   * 4.125 inches by 9.5 inches.
+   */
+  public static final MediaSizeName NA_NUMBER_10_ENVELOPE =
+    new MediaSizeName(60);
+  
+  /**
+   * The North American number 11 business envelope size: 
+   * 4.5 inches by 10.375 inches.
+   */
+  public static final MediaSizeName NA_NUMBER_11_ENVELOPE =
+    new MediaSizeName(61);
+  
+  /**
+   * The North American number 12 business envelope size: 
+   * 4.75 inches by 11 inches.
+   */
+  public static final MediaSizeName NA_NUMBER_12_ENVELOPE =
+    new MediaSizeName(62);
+  
+  /**
+   * The North American number 14 business envelope size: 
+   * 5 inches by 11.5 inches.
+   */
+  public static final MediaSizeName NA_NUMBER_14_ENVELOPE =
+    new MediaSizeName(63);
+  
+  /**
+   * The North American 6x9 inch envelope size.
+   */
+  public static final MediaSizeName NA_6X9_ENVELOPE = new MediaSizeName(64);
+  
+  /**
+   * The North American 7x9 inch envelope size.
+   */
+  public static final MediaSizeName NA_7X9_ENVELOPE = new MediaSizeName(65);
+  
+  /**
+   * The North American 9x11 inch envelope size.
+   */
+  public static final MediaSizeName NA_9X11_ENVELOPE = new MediaSizeName(66);
+  
+  /**
+   * The North American 9x12 inch envelope size.
+   */
+  public static final MediaSizeName NA_9X12_ENVELOPE = new MediaSizeName(67);
+  
+  /**
+   * The North American 10x13 inch envelope size.
+   */
+  public static final MediaSizeName NA_10X13_ENVELOPE = new MediaSizeName(68);
+  
+  /**
+   * The North American 10x14 inch envelope size.
+   */
+  public static final MediaSizeName NA_10X14_ENVELOPE = new MediaSizeName(69);
+  
+  /**
+   * The North American 10x15 inch envelope size.
+   */
+  public static final MediaSizeName NA_10X15_ENVELOPE = new MediaSizeName(70);
+  
+  /**
+   * The North American 5 inches by 7 inches.
+   */
+  public static final MediaSizeName NA_5X7 = new MediaSizeName(71);
+  
+  /**
+   * The North American 8 inches by 10 inches.
+   */
+  public static final MediaSizeName NA_8X10 = new MediaSizeName(72);
+
+  private static final String[] stringTable = 
+    { "iso-a0",  "iso-a1", "iso-a2", "iso-a3", "iso-a4", "iso-a5", "iso-a6", 
+      "iso-a7", "iso-a8", "iso-a9", "iso-a10", "iso-b0", "iso-b1", "iso-b2", 
+      "iso-b3", "iso-b4", "iso-b5", "iso-b6", "iso-b7", "iso-b8", "iso-b9", 
+      "iso-b10", "jis-b0", "jis-b1", "jis-b2", "jis-b3", "jis-b4", "jis-b5", 
+      "jis-b6", "jis-b7", "jis-b8", "jis-b9", "jis-b10", "iso-c0", "iso-c1", 
+      "iso-c2", "iso-c3", "iso-c4", "iso-c5", "iso-c6", "na-letter", 
+      "na-legal", "executive", "ledger", "tabloid", "invoice", "folio", 
+      "quarto", "japanese-postcard", "oufuko-postcard", "a", "b", "c", "d", 
+      "e", "iso-designated-long", "italian-envelope", "monarch-envelope", 
+      "personal-envelope", "na-number-9-envelope", "na-number-10-envelope", 
+      "na-number-11-envelope", "na-number-12-envelope", 
+      "na-number-14-envelope", "na-6x9-envelope", "na-7x9-envelope", 
+      "na-9x11-envelope", "na-9x12-envelope", "na-10x13-envelope", 
+      "na-10x14-envelope", "na-10x15-envelope", "na-5x7", "na-8x10" };
+  
+  private static final MediaSizeName[] enumValueTable = 
+    { ISO_A0, ISO_A1, ISO_A2, ISO_A3, ISO_A4, ISO_A5, ISO_A6, ISO_A7, ISO_A8, 
+      ISO_A9, ISO_A10, ISO_B0, ISO_B1, ISO_B2, ISO_B3, ISO_B4, ISO_B5, ISO_B6,
+      ISO_B7, ISO_B8, ISO_B9, ISO_B10, JIS_B0, JIS_B1, JIS_B2, JIS_B3, JIS_B4, 
+      JIS_B5, JIS_B6, JIS_B7, JIS_B8, JIS_B9, JIS_B10, ISO_C0, ISO_C1, ISO_C2,
+      ISO_C3, ISO_C4, ISO_C5, ISO_C6, NA_LETTER, NA_LEGAL, EXECUTIVE, LEDGER, 
+      TABLOID, INVOICE, FOLIO, QUARTO, JAPANESE_POSTCARD, 
+      JAPANESE_DOUBLE_POSTCARD, A, B, C, D, E, ISO_DESIGNATED_LONG, 
+      ITALY_ENVELOPE, MONARCH_ENVELOPE, PERSONAL_ENVELOPE, 
+      NA_NUMBER_9_ENVELOPE, NA_NUMBER_10_ENVELOPE, NA_NUMBER_11_ENVELOPE,
+      NA_NUMBER_12_ENVELOPE, NA_NUMBER_14_ENVELOPE, NA_6X9_ENVELOPE,
+      NA_7X9_ENVELOPE, NA_9X11_ENVELOPE, NA_9X12_ENVELOPE, NA_10X13_ENVELOPE,
+      NA_10X14_ENVELOPE, NA_10X15_ENVELOPE, NA_5X7, NA_8X10 }; 
+  
+  /**
+   * Constructs a <code>MediaSizeName</code> object.
+   * 
+   * @param value the enum value.
+   */
+  protected MediaSizeName(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaTray.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaTray.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaTray.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MediaTray.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,142 @@
+/* MediaTray.java --
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.EnumSyntax;
+
+/**
+ * <code>MediaTray</code> is a subclass of the <code>Media</code> printing 
+ * attribute and provides selection of media to be used by the means of the
+ * input tray of the printer. The class pre-defines commonly available types
+ * of input trays in printers. This media type enumeration may be used in
+ * alternative to MediaSizeName/MediaName.
+ * <p>
+ * <b>IPP Compatibility:</b> MediaTray is not an IPP 1.1 attribute on its own.
+ * It provides parts of the <code>media</code> attribute type values.
+ * </p>
+ * 
+ * @author Sven de Marothy
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public class MediaTray extends Media
+{
+  
+  private static final long serialVersionUID = -982503611095214703L;
+  
+  /**
+   * Top tray
+   */
+  public static final MediaTray TOP = new MediaTray(0);
+  
+  /**
+   * Middle tray
+   */
+  public static final MediaTray MIDDLE = new MediaTray(1);
+  
+  /**
+   * Bottom tray
+   */
+  public static final MediaTray BOTTOM = new MediaTray(2);
+
+  /**
+   * Envelope tray
+   */
+  public static final MediaTray ENVELOPE = new MediaTray(3);
+
+  /**
+   * Manual-feed tray
+   */ 
+  public static final MediaTray MANUAL = new MediaTray(4);
+  
+  /**
+   * Large capacity tray
+   */
+  public static final MediaTray LARGE_CAPACITY = new MediaTray(5);
+
+  /**
+   * Main tray
+   */
+  public static final MediaTray MAIN = new MediaTray(6);
+  
+  /**
+   * Side tray
+   */
+  public static final MediaTray SIDE = new MediaTray(7);  
+  
+  private static final String[] stringTable = { "top", "middle", "bottom",
+                                                "envelope", "manual", 
+                                                "large-capacity", "main", 
+                                                "side" };
+  
+  private static final MediaTray[] enumValueTable = { TOP, MIDDLE, BOTTOM, 
+                                                      ENVELOPE, MANUAL,
+                                                      LARGE_CAPACITY, MAIN,
+                                                      SIDE };  
+  
+  /**
+   * Creates a <code>MediaTray</code> object.
+   *
+   * @param i the enum value.
+   */
+  protected MediaTray(int i)
+  {
+    super( i );
+  }
+ 
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}
+

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MultipleDocumentHandling.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MultipleDocumentHandling.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MultipleDocumentHandling.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/MultipleDocumentHandling.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,146 @@
+/* MultipleDocumentHandling.java --
+   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+
+/**
+ * The <code>MultipleDocumentHandling</code> printing attribute controls
+ * how certain printing attributes affect printing in case of multiple 
+ * documents in a print job. This attribute is only relevant if a job 
+ * has multiple documents.
+ * <p>
+ * <b>IPP Compatibility:</b> MultipleDocumentHandling is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public class MultipleDocumentHandling extends EnumSyntax
+  implements PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = 8098326460746413466L;
+
+  /** 
+   * Multiple documents are treated as a single document.
+   */
+  public static final MultipleDocumentHandling SINGLE_DOCUMENT =
+    new MultipleDocumentHandling(0);
+  
+  /** 
+   * Multiple documents are treated as uncollated copies.
+   */
+  public static final MultipleDocumentHandling SEPARATE_DOCUMENTS_UNCOLLATED_COPIES =
+    new MultipleDocumentHandling(1);
+  
+  /** 
+   * Multiple documents are treated as collated copies. 
+   */
+  public static final MultipleDocumentHandling SEPARATE_DOCUMENTS_COLLATED_COPIES =
+    new MultipleDocumentHandling(2);
+  
+  /** 
+   * Multiple documents are treated so that every single document starts
+   * with a new sheet. 
+   */
+  public static final MultipleDocumentHandling SINGLE_DOCUMENT_NEW_SHEET =
+    new MultipleDocumentHandling(3);
+  
+  private static final String[] stringTable = { "single-document", 
+                                                "separate-documents-uncollated-copies",
+                                                "separate-documents-collated-copies",
+                                                "single-document-new-sheet" };
+  
+  private static final MultipleDocumentHandling[] enumValueTable = 
+    { SINGLE_DOCUMENT, SEPARATE_DOCUMENTS_UNCOLLATED_COPIES,
+      SEPARATE_DOCUMENTS_COLLATED_COPIES, SINGLE_DOCUMENT_NEW_SHEET};
+
+  /**
+   * Constructs a <code>MultipleDocumentHandling</code> object.
+   * 
+   * @param value the enum value
+   */
+  protected MultipleDocumentHandling(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>MultipleDocumentHandling</code> itself.
+   */
+  public final Class getCategory()
+  {
+    return MultipleDocumentHandling.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "multiple-document-handling".
+   */
+  public final String getName()
+  {
+    return "multiple-document-handling";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberOfDocuments.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberOfDocuments.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberOfDocuments.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberOfDocuments.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,107 @@
+/* NumberOfDocuments.java -- 
+   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
+
+/**
+ * The <code>NumberOfDocuments</code> printing attribute specifies 
+ * the number of documents in a job.
+ * <p>
+ * <b>IPP Compatibility:</b> NumberOfDocuments is an IPP 1.1 attribute.
+ * </p>
+ *
+ * @author Michael Koch
+ */
+public final class NumberOfDocuments extends IntegerSyntax
+  implements PrintJobAttribute
+{
+  private static final long serialVersionUID = 7891881310684461097L;
+  
+  /**
+   * Creates a <code>NumberOfDocuments</code> object.
+   *
+   * @param value the number of documents
+   *
+   * @exception IllegalArgumentException if value < 0
+   */
+  public NumberOfDocuments(int value)
+  {
+    super(value);
+
+    if (value < 0)
+      throw new IllegalArgumentException("value may not be less than 0");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof NumberOfDocuments))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>NumberOfDocuments</code> itself.
+   */
+  public Class getCategory()
+  {
+    return NumberOfDocuments.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "number-of-documents".
+   */
+  public String getName()
+  {
+    return "number-of-documents";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberOfInterveningJobs.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberOfInterveningJobs.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberOfInterveningJobs.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberOfInterveningJobs.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,108 @@
+/* NumberOfInterveningJobs.java -- 
+   Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
+
+/**
+ * The <code>NumberOfInterveningJobs</code> printing attribute provides
+ * the number of jobs ahead in the print service queue before the 
+ * requested job.
+ * <p>
+ * <b>IPP Compatibility:</b> NumberOfInterveningJobs is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch
+ */
+public final class NumberOfInterveningJobs extends IntegerSyntax
+  implements PrintJobAttribute
+{
+  private static final long serialVersionUID = 2568141124844982746L;
+  
+  /**
+   * Creates a <code>NumberOfInterveningJobs</code> object.
+   *
+   * @param value the number of intervening jobs
+   *
+   * @exception IllegalArgumentException if value < 0
+   */
+  public NumberOfInterveningJobs(int value)
+  {
+    super(value);
+
+    if (value < 0)
+      throw new IllegalArgumentException("value may not be less than 0");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof NumberOfInterveningJobs))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>NumberOfInterveningJobs</code> itself.
+   */
+  public Class getCategory()
+  {
+    return NumberOfInterveningJobs.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "number-of-intervening-jobs".
+   */
+  public String getName()
+  {
+    return "number-of-intervening-jobs";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberUp.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberUp.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberUp.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberUp.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,112 @@
+/* NumberUp.java -- 
+   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+/**
+ * The <code>NumberUp</code> printing attribute specifies the number of pages 
+ * to be arranged upon a single media sheet.
+ * <p>
+ * <b>Note:</b> The effect of this attribute on jobs with multiple documents 
+ * is controlled by the job attribute 
+ * {@link javax.print.attribute.standard.MultipleDocumentHandling}.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> NumberUp is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch
+ */
+public final class NumberUp extends IntegerSyntax
+  implements DocAttribute, PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = -3040436486786527811L;
+  
+  /**
+   * Creates a <code>NumberUp</code> object.
+   *
+   * @param value the number of print-stream pages to print on a single side
+   * of a media
+   *
+   * @exception IllegalArgumentException if value < 1
+   */
+  public NumberUp(int value)
+  {
+    super(value);
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof NumberUp))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>NumberUp</code> itself.
+   */
+  public Class getCategory()
+  {
+    return NumberUp.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "number-up".
+   */
+  public String getName()
+  {
+    return "number-up";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberUpSupported.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberUpSupported.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberUpSupported.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/NumberUpSupported.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,145 @@
+/* NumberUpSupported.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.SetOfIntegerSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+
+
+/**
+ * The <code>NumberUpSupported</code> printing attribute specifies the 
+ * supported value or range of values for the 
+ * {@link javax.print.attribute.standard.NumberUp} attribute.
+ * <p>
+ * <b>IPP Compatibility:</b> NumberUpSupported is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class NumberUpSupported extends SetOfIntegerSyntax
+  implements SupportedValuesAttribute
+{
+  private static final long serialVersionUID = -1041573395759141805L;
+
+  /**
+   * Constructs a <code>NumberUpSupported</code> object.
+   *
+   * @param member the only one value supported for number up.
+   *
+   * @exception IllegalArgumentException if member is < 1
+   */
+  public NumberUpSupported(int member)
+  {
+    super(member);
+    
+    if (member < 1)
+      throw new IllegalArgumentException("member may not be less than 1");
+  }
+
+  /**
+   * Constructs a <code>NumberUpSupported</code> object.
+   *
+   * @param members the members supported for number up.
+   *
+   * @exception IllegalArgumentException if any element is invalid
+   * @exception NullPointerException if members is <code>null</code> or any 
+   * element of members is <code>null</code>.
+   */
+  public NumberUpSupported(int[][] members)
+  {
+    super(members);
+    
+    if (members == null)
+      throw new NullPointerException("members may not be null");
+  }
+
+  /**
+   * Constructs a <code>NumberUpSupported</code> object with the
+   * given range for supported number up values.
+   *
+   * @param lowerBound the lower bound value
+   * @param upperBound the upper bound value
+   *
+   * @exception IllegalArgumentException if lowerBound <= upperbound
+   * and lowerBound < 1
+   */
+  public NumberUpSupported(int lowerBound, int upperBound)
+  {
+    super(lowerBound, upperBound);
+    
+    if (lowerBound < 1)
+      throw new IllegalArgumentException("lowerBound may not be less than 1");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if (! (obj instanceof NumberUpSupported))
+      return false;
+   
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>NumberUpSupported</code> itself.
+   */
+  public Class getCategory()
+  {
+    return NumberUpSupported.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "number-up-supported".
+   */
+  public String getName()
+  {
+    return "number-up-supported";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/OrientationRequested.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/OrientationRequested.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/OrientationRequested.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/OrientationRequested.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,160 @@
+/* OrientationRequested.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+
+/**
+ * The <code>OrientationRequested</code> printing attribute specifies
+ * the desired orientation of the print data on the media sheet.
+ * <p>
+ * The effect of this attribute may depend on the document format as
+ * some document formats (e.g. postscript) contains the orientation
+ * inside the print data. However for other formats like e.g. plain
+ * text this attribute will have an effect on the orientation.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> OrientationRequested is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class OrientationRequested extends EnumSyntax
+  implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
+{
+  private static final long serialVersionUID = -4447437289862822276L;
+
+  /** 
+   * Orientation as portrait. 
+   */
+  public static final OrientationRequested PORTRAIT =
+    new OrientationRequested(3);
+  
+  /** 
+   * Orientation as landscape. 
+   */
+  public static final OrientationRequested LANDSCAPE =
+    new OrientationRequested(4);
+  
+  /** 
+   * Orientation as reversed landscape. 
+   */
+  public static final OrientationRequested REVERSE_LANDSCAPE =
+    new OrientationRequested(5);
+  
+  /** 
+   * Orientation as reversed portrait. 
+   */
+  public static final OrientationRequested REVERSE_PORTRAIT =
+    new OrientationRequested(6);
+  
+
+  private static final String[] stringTable = { "portrait", "landscape",
+                                                "reverse-landscape",
+                                                "reverse-portrait" };
+  
+  private static final OrientationRequested[] 
+      enumValueTable = { PORTRAIT, LANDSCAPE, 
+                         REVERSE_LANDSCAPE, REVERSE_PORTRAIT };
+
+  /**
+   * Constructs a <code>OrientationRequested</code> object.
+   * 
+   * @param value the value
+   */
+  protected OrientationRequested(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>OrientationRequested</code> itself.
+   */
+  public Class getCategory()
+  {
+    return OrientationRequested.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "orientation-requested".
+   */
+  public String getName()
+  {
+    return "orientation-requested";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+  
+  /**
+   * Returns the lowest used value by the enumerations of this class.
+   * .
+   * @return The lowest value used.
+   */
+  protected int getOffset()
+  {
+    return 3;
+  }  
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/OutputDeviceAssigned.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/OutputDeviceAssigned.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/OutputDeviceAssigned.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/OutputDeviceAssigned.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,115 @@
+/* OutputDeviceAssigned.java -- 
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Locale;
+
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * The <code>OutputDeviceAssigned</code> printing attribute specifies the
+ * output printer device assigned by a print service to a print job. 
+ * <p>
+ * This may be empty if a print service is embedded in a printer, e.g. is the
+ * output device. However there exist print services with several physical 
+ * output devices (e.g. CUPS classes) where this attribute provides the actual
+ * output device.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> OutputDeviceAssigned is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class OutputDeviceAssigned extends TextSyntax
+  implements PrintJobAttribute
+{
+  private static final long serialVersionUID = 5486733778854271081L;
+
+  /**
+   * Creates a <code>OutputDeviceAssigned</code> object.
+   *
+   * @param deviceName the name of the device.
+   * @param locale the locale to use, if <code>null</code> the default
+   * locale is used.
+   *
+   * @exception NullPointerException if deviceName is <code>null</code>.
+   */
+  public OutputDeviceAssigned(String deviceName, Locale locale)
+  {
+    super(deviceName, locale);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof OutputDeviceAssigned))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>OutputDeviceAssigned</code> itself.
+   */
+  public Class getCategory()
+  {
+    return OutputDeviceAssigned.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "output-device-assigned".
+   */
+  public String getName()
+  {
+    return "output-device-assigned";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PDLOverrideSupported.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PDLOverrideSupported.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PDLOverrideSupported.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PDLOverrideSupported.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,129 @@
+/* PDLOverrideSupported.java --
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintServiceAttribute;
+
+
+/**
+ * The <code>PDLOverrideSupported</code> printing attribute specifies
+ * if a print services is capable of attempting to override document data
+ * instructions with IPP attributesc.
+ * <p>
+ * <b>IPP Compatibility:</b> PDLOverrideSupported is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public class PDLOverrideSupported extends EnumSyntax
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = -4393264467928463934L;
+
+  /**
+   * Indicates that the print service is not capable of
+   * attempting to override document data instructions.
+   */
+  public static final PDLOverrideSupported NOT_ATTEMPTED =
+    new PDLOverrideSupported(0);
+  
+  /**
+   * Indicates that the print service is capable of
+   * attempting to override document data instructions.
+   */
+  public static final PDLOverrideSupported ATTEMPTED =
+    new PDLOverrideSupported(1);
+  
+  private static final String[] stringTable = { "not-attempted", "attempted" };
+  
+  private static final PDLOverrideSupported[] enumValueTable = { NOT_ATTEMPTED,
+                                                                 ATTEMPTED};
+
+  /**
+   * Constructs a <code>PDLOverrideSupported</code> object.
+   * 
+   * @param value the enum value
+   */
+  protected PDLOverrideSupported(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class  <code>PDLOverrideSupported</code> itself.
+   */
+  public final Class getCategory()
+  {
+    return PDLOverrideSupported.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "pdl-override-supported".
+   */
+  public final String getName()
+  {
+    return "pdl-override-supported";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PageRanges.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PageRanges.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PageRanges.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PageRanges.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,171 @@
+/* PageRanges.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+import javax.print.attribute.SetOfIntegerSyntax;
+
+/**
+ * The <code>PageRanges</code> printing attribute specifies the 
+ * range(s) of pages to be printed in a print job.
+ * <p>
+ * <b>Note:</b> The effect of this attribute on jobs with multiple 
+ * documents is controlled by the job attribute 
+ * {@link javax.print.attribute.standard.MultipleDocumentHandling}.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> PageRanges is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class PageRanges extends SetOfIntegerSyntax
+  implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
+{
+  private static final long serialVersionUID = 8639895197656148392L;
+
+  /**
+   * Constructs a <code>PageRanges</code> object with only one
+   * page to be printed.
+   *
+   * @param member the only page to be printed.
+   *
+   * @exception IllegalArgumentException if member is < 1
+   */
+  public PageRanges(int member)
+  {
+    super(member);
+    
+    if (member < 1)
+      throw new IllegalArgumentException("member may not be less than 1");
+  }
+
+  /**
+   * Constructs a <code>PageRanges</code> object with a set
+   * of ranges to be printed.
+   *
+   * @param members the page ranges to be printed.
+   *
+   * @exception IllegalArgumentException if any element is invalid
+   * @exception NullPointerException if members is <code>null</code> or any 
+   * element of members is <code>null</code>.
+   */
+  public PageRanges(int[][] members)
+  {
+    super(members);
+    
+    if (members == null)
+      throw new NullPointerException("members may not be null");
+  }
+
+  /**
+   * Constructs a <code>PageRanges</code> object with the
+   * given single range of pages to be printed.
+   *
+   * @param lowerBound the lower bound value
+   * @param upperBound the upper bound value
+   *
+   * @exception IllegalArgumentException if lowerBound <= upperbound
+   * and lowerBound < 1
+   */
+  public PageRanges(int lowerBound, int upperBound)
+  {
+    super(lowerBound, upperBound);
+    
+    if (lowerBound < 1)
+      throw new IllegalArgumentException("lowerbound may not be less than 1");
+  }
+  
+  /**
+   * Constructs a <code>PageRanges</code> object with a set
+   * of ranges to be printed in string array form.
+   *
+   * @param members the page ranges to be printed in string form.
+   *
+   * @exception IllegalArgumentException if any element is invalid.
+   * @exception NullPointerException if members is <code>null</code> or any 
+   * element of members is <code>null</code>.
+   */
+  public PageRanges(String members)
+  {
+    super(members);
+    
+    if (members == null)
+      throw new NullPointerException("members may not be null");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if (! (obj instanceof PageRanges))
+      return false;
+   
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PageRanges</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PageRanges.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "page-ranges".
+   */
+  public String getName()
+  {
+    return "page-ranges";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PagesPerMinute.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PagesPerMinute.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PagesPerMinute.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PagesPerMinute.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,109 @@
+/* PagesPerMinute.java -- 
+   Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintServiceAttribute;
+
+/**
+ * The <code>PagesPerMinute</code> printing attribute specifies 
+ * the nominal number of pages per minute which may be printed
+ * by the printer. 
+ * <p>
+ * <b>IPP Compatibility:</b> PagesPerMinute is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class PagesPerMinute extends IntegerSyntax
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = -6366403993072862015L;
+  
+  /**
+   * Creates a <code>PagesPerMinute</code> object.
+   *
+   * @param value the number of pages per minute
+   *
+   * @exception IllegalArgumentException if value < 0
+   */
+  public PagesPerMinute(int value)
+  {
+    super(value);
+
+    if (value < 0)
+      throw new IllegalArgumentException("value may not be less than 0");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof PagesPerMinute))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PagesPerMinute</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PagesPerMinute.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "pages-per-minute".
+   */
+  public String getName()
+  {
+    return "pages-per-minute";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PagesPerMinuteColor.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PagesPerMinuteColor.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PagesPerMinuteColor.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PagesPerMinuteColor.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,108 @@
+/* PagesPerMinuteColor.java -- 
+   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintServiceAttribute;
+
+/**
+ * The <code>PagesPerMinuteColor</code> printing attribute specifies 
+ * the nominal number of pages per minute which may be printed in
+ * color by the printer. 
+ * <p>
+ * <b>IPP Compatibility:</b> PagesPerMinuteColor is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch
+ */
+public final class PagesPerMinuteColor extends IntegerSyntax
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = 1684993151687470944L;
+  
+  /**
+   * Creates a <code>PagesPerMinuteColor</code> object.
+   *
+   * @param value the number of pages per minute in color
+   *
+   * @exception IllegalArgumentException if value < 0
+   */
+  public PagesPerMinuteColor(int value)
+  {
+    super(value);
+
+    if (value < 0)
+      throw new IllegalArgumentException("value may not be less than 0");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof PagesPerMinuteColor))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PagesPerMinuteColor</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PagesPerMinuteColor.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "pages-per-minute-color".
+   */
+  public String getName()
+  {
+    return "pages-per-minute-color";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PresentationDirection.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PresentationDirection.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PresentationDirection.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PresentationDirection.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,176 @@
+/* PresentationDirection.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+
+/**
+ * The <code>PresentationDirection</code> attribute specifies
+ * a value to be used together with the <code>NumberUp</code> attribute 
+ * to indicate the layout of multiple pages on a single media sheet.
+ * <p>
+ * <b>IPP Compatibility:</b> PresentationDirection is not an IPP 1.1 
+ * attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class PresentationDirection extends EnumSyntax
+  implements PrintRequestAttribute, PrintJobAttribute
+{
+  private static final long serialVersionUID = 8294728067230931780L;
+
+  /**
+   * The single pages are arranged on the media in columns starting 
+   * at the top left towards the bottom left.
+   */
+  public static final PresentationDirection TOBOTTOM_TORIGHT =
+    new PresentationDirection(0);
+  
+  /**
+   * The single pages are arranged on the media in columns starting 
+   * at the top right towards the bottom left.
+   */
+  public static final PresentationDirection TOBOTTOM_TOLEFT =
+    new PresentationDirection(1);
+  
+  /**
+   * The single pages are arranged on the media in columns starting 
+   * at the bottom left towards the top right.
+   */
+  public static final PresentationDirection TOTOP_TORIGHT =
+    new PresentationDirection(2);
+  
+  /**
+   * The single pages are arranged on the media in columns starting 
+   * at the bottom right towards the top left.
+   */
+  public static final PresentationDirection TOTOP_TOLEFT =
+    new PresentationDirection(3);
+  
+  /**
+   * The single pages are arranged on the media in rows starting 
+   * at the top left towards the right bottom.
+   */
+  public static final PresentationDirection TORIGHT_TOBOTTOM =
+    new PresentationDirection(4);
+  
+  /**
+   * The single pages are arranged on the media in rows starting 
+   * at the bottom left towards the right top.
+   */
+  public static final PresentationDirection TORIGHT_TOTOP =
+    new PresentationDirection(5);
+  
+  /**
+   * The single pages are arranged on the media in rows starting 
+   * at the top right towards the left bottom.
+   */
+  public static final PresentationDirection TOLEFT_TOBOTTOM =
+    new PresentationDirection(6);
+  
+  /**
+   * The single pages are arranged on the media in rows starting 
+   * at the bottom right towards the left top.
+   */
+  public static final PresentationDirection TOLEFT_TOTOP =
+    new PresentationDirection(7);
+
+  private static final String[] stringTable = { "tobottom-toright", 
+    "tobottom-toleft", "totop-toright", "totop-toleft", "toright-tobottom", 
+    "toright-totop", "toleft-tobottom", "toleft-totop" };
+
+  private static final PresentationDirection[] enumValueTable = 
+    { TOBOTTOM_TORIGHT, TOBOTTOM_TOLEFT, TOTOP_TORIGHT, TOTOP_TOLEFT, 
+      TORIGHT_TOBOTTOM, TORIGHT_TOTOP, TOLEFT_TOBOTTOM, TOLEFT_TOTOP };
+  
+  /**
+   * Constructs a <code>PresentationDirection</code> object.
+   * 
+   * @param value the enum value.
+   */
+  private PresentationDirection(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PresentationDirection</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PresentationDirection.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "presentation-direction".
+   */
+  public String getName()
+  {
+    return "presentation-direction";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrintQuality.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrintQuality.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrintQuality.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrintQuality.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,140 @@
+/* PrintQuality.java --
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+
+/**
+ * The <code>PrintQuality</code> printing attribute specifies the
+ * print quality that should be used by the print services for a job.
+ * <p>
+ * <b>IPP Compatibility:</b> PrintQuality is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public class PrintQuality extends EnumSyntax
+  implements DocAttribute, PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = -3072341285225858365L;
+
+  /** 
+   * Draft quality of the printer. 
+   */
+  public static final PrintQuality DRAFT = new PrintQuality(3);
+  
+  /** 
+   * Normal quality of the printer. 
+   */
+  public static final PrintQuality NORMAL = new PrintQuality(4);
+  
+  /** 
+   * High quality of the printer. 
+   */
+  public static final PrintQuality HIGH = new PrintQuality(5);
+
+  private static final String[] stringTable = { "draft", "normal", "high" };
+  
+  private static final PrintQuality[] enumValueTable = { DRAFT, NORMAL, HIGH };
+  
+  /**
+   * Constructs a <code>PrintQuality</code> object.
+   * 
+   * @param value the value of the enum
+   */
+  protected PrintQuality(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PrintQuality</code> itself.
+   */
+  public final Class getCategory()
+  {
+    return PrintQuality.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "print-quality".
+   */
+  public final String getName()
+  {
+    return "print-quality";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }  
+
+  /**
+   * Returns the lowest used value by the enumerations of this class.
+   * .
+   * @return The lowest value used.
+   */
+  protected int getOffset()
+  {
+    return 3;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterInfo.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterInfo.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterInfo.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterInfo.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,109 @@
+/* PrinterInfo.java -- 
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Locale;
+
+import javax.print.attribute.PrintServiceAttribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * The <code>PrinterInfo</code> printing attribute provides 
+ * informations about a printer device.
+ * <p>
+ * <b>IPP Compatibility:</b> PrinterInfo is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class PrinterInfo extends TextSyntax
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = 7765280618777599727L;
+
+  /**
+   * Creates a <code>PrinterInfo</code> object.
+   *
+   * @param printerInfo the printer info
+   * @param locale the locale to use, if <code>null</code> the default
+   * locale is used.
+   *
+   * @exception NullPointerException if printerInfo is <code>null</code>.
+   */
+  public PrinterInfo(String printerInfo, Locale locale)
+  {
+    super(printerInfo, locale);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof PrinterInfo))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PrinterInfo</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PrinterInfo.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "printer-info".
+   */
+  public String getName()
+  {
+    return "printer-info";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterIsAcceptingJobs.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterIsAcceptingJobs.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterIsAcceptingJobs.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterIsAcceptingJobs.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,131 @@
+/* PrinterIsAcceptingJobs.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintServiceAttribute;
+
+
+/**
+ * The <code>PrinterIsAcceptingJobs</code> printing attribute signals 
+ * if a print services is currently accepting jobs.
+ * <p>
+ * <b>IPP Compatibility:</b> PrinterIsAcceptingJobs is an IPP 1.1 attribute.
+ * The IPP specification treats PrinterIsAcceptingJobs as boolean type which 
+ * is not available in the Java Print Service API. The IPP boolean value "true" 
+ * corresponds to <code>ACCEPTING_JOBS</code> and "false" 
+ * to <code>NOT_ACCEPTING_JOBS</code>.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class PrinterIsAcceptingJobs extends EnumSyntax
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = -5052010680537678061L;
+
+  /**
+   * The printer is not accepting jobs currently.
+   */
+  public static final PrinterIsAcceptingJobs NOT_ACCEPTING_JOBS =
+    new PrinterIsAcceptingJobs(0);
+  
+  /**
+   * The printer is accepting jobs.
+   */
+  public static final PrinterIsAcceptingJobs ACCEPTING_JOBS =
+    new PrinterIsAcceptingJobs(1);
+
+  private static final String[] stringTable = { "not-accepting-jobs", 
+                                                "accepting-jobs" };
+  
+  private static final PrinterIsAcceptingJobs[] enumValueTable = 
+    { NOT_ACCEPTING_JOBS, ACCEPTING_JOBS };
+  
+  /**
+   * Constructs a <code>PrinterIsAcceptingJobs</code> object.
+   * 
+   * @param value the enum value.
+   */
+  protected PrinterIsAcceptingJobs(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PrinterIsAcceptingJobs</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PrinterIsAcceptingJobs.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "printer-is-accepting-jobs".
+   */
+  public String getName()
+  {
+    return "printer-is-accepting-jobs";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterLocation.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterLocation.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterLocation.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterLocation.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,109 @@
+/* PrinterLocation.java -- 
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Locale;
+
+import javax.print.attribute.PrintServiceAttribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * The <code>PrinterLocation</code> printing attribute provides the location 
+ * of a printer device. This may be a room and building name for example.
+ * <p>
+ * <b>IPP Compatibility:</b> PrinterLocation is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class PrinterLocation extends TextSyntax
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = -1598610039865566337L;
+
+  /**
+   * Creates a <code>PrinterLocation</code> object.
+   *
+   * @param printerLocation the printer location
+   * @param locale the locale to use, if <code>null</code> the default
+   * locale is used.
+   *
+   * @exception NullPointerException if printerLocation is <code>null</code>.
+   */
+  public PrinterLocation(String printerLocation, Locale locale)
+  {
+    super(printerLocation, locale);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof PrinterLocation))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PrinterLocation</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PrinterLocation.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "printer-location".
+   */
+  public String getName()
+  {
+    return "printer-location";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMakeAndModel.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMakeAndModel.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMakeAndModel.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMakeAndModel.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,109 @@
+/* PrinterMakeAndModel.java -- 
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Locale;
+
+import javax.print.attribute.PrintServiceAttribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * The <code>PrinterMakeAndModel</code> printing attribute provides the name
+ * of the maker and the model of the printer.
+ * <p>
+ * <b>IPP Compatibility:</b> PrinterMakeAndModel is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class PrinterMakeAndModel extends TextSyntax
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = 4580461489499351411L;
+
+  /**
+   * Creates a <code>PrinterMakeAndModel</code> object.
+   *
+   * @param makeAndModel the make and model string
+   * @param locale the locale to use, if <code>null</code> the default
+   * locale is used.
+   *
+   * @exception NullPointerException if makeAndModel is <code>null</code>.
+   */
+  public PrinterMakeAndModel(String makeAndModel, Locale locale)
+  {
+    super(makeAndModel, locale);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof PrinterMakeAndModel))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PrinterMakeAndModel</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PrinterMakeAndModel.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "printer-make-and-model".
+   */
+  public String getName()
+  {
+    return "printer-make-and-model";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMessageFromOperator.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMessageFromOperator.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMessageFromOperator.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMessageFromOperator.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,112 @@
+/* PrinterMessageFromOperator.java -- 
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Locale;
+
+import javax.print.attribute.PrintServiceAttribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * The <code>PrinterMessageFromOperator</code> printing attribute provides 
+ * a message from an operator or a system administrator related to the 
+ * printer. This may include informations about the status of the printer
+ * or expected downtimes, etc.
+ * <p>
+ * <b>IPP Compatibility:</b> PrinterMessageFromOperator is an IPP 1.1 
+ * attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class PrinterMessageFromOperator extends TextSyntax
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = -4486871203218629318L;
+
+  /**
+   * Creates a <code>PrinterMessageFromOperator</code> object.
+   *
+   * @param message the message
+   * @param locale the locale to use, if <code>null</code> the default
+   * locale is used.
+   *
+   * @exception NullPointerException if message is <code>null</code>.
+   */
+  public PrinterMessageFromOperator(String message, Locale locale)
+  {
+    super(message, locale);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof PrinterMessageFromOperator))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PrinterMessageFromOperator</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PrinterMessageFromOperator.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "printer-message-from-operator".
+   */
+  public String getName()
+  {
+    return "printer-message-from-operator";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfo.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfo.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfo.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfo.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,111 @@
+/* PrinterMoreInfo.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.net.URI;
+
+import javax.print.attribute.PrintServiceAttribute;
+import javax.print.attribute.URISyntax;
+
+/**
+ * The <code>PrinterMoreInfo</code> attribute provides a URI that can be used
+ * to obtain more information about the printer.
+ * <p>
+ * The URI may for example contain a reference to a HTML page with information.
+ * The information is normally intended for end users.
+ * </p> 
+ * <p>
+ * <b>IPP Compatibility:</b> PrinterMoreInfo is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class PrinterMoreInfo extends URISyntax
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = 4555850007675338574L;
+
+  /**
+   * Constructs a <code>PrinterMoreInfo</code> object.
+   * 
+   * @param uri the URI of the information.
+   * @throws NullPointerException if the given uri is null.
+   */
+  public PrinterMoreInfo(URI uri)
+  {
+    super(uri);
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof PrinterMoreInfo))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PrinterMoreInfo</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PrinterMoreInfo.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "printer-more-info".
+   */
+  public String getName()
+  {
+    return "printer-more-info";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,115 @@
+/* PrinterMoreInfoManufacturer.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.net.URI;
+
+import javax.print.attribute.PrintServiceAttribute;
+import javax.print.attribute.URISyntax;
+
+/**
+ * The <code>PrinterMoreInfoManufacturer</code> attribute provides a URI that 
+ * can be used to obtain more information about the printer device type and
+ * its manufacturer.
+ * <p>
+ * The URI may for example contain a reference to a website of the 
+ * manufacturer, containing informations and links to the latest firmware, 
+ * printer drivers, manual etc. The information is normally intended for 
+ * end users.
+ * </p> 
+ * <p>
+ * <b>IPP Compatibility:</b> PrinterMoreInfoManufacturer is an IPP 1.1 
+ * attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class PrinterMoreInfoManufacturer extends URISyntax
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = 3323271346485076608L;
+
+  /**
+   * Constructs a <code>PrinterMoreInfoManufacturer</code> object.
+   * 
+   * @param uri the URI of the information..
+   * @throws NullPointerException if the given uri is null.
+   */
+  public PrinterMoreInfoManufacturer(URI uri)
+  {
+    super(uri);
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof PrinterMoreInfoManufacturer))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PrinterMoreInfoManufacturer</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PrinterMoreInfoManufacturer.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "printer-more-info-manufacturer".
+   */
+  public String getName()
+  {
+    return "printer-more-info-manufacturer";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterName.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterName.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterName.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterName.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,111 @@
+/* PrinterName.java -- 
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Locale;
+
+import javax.print.attribute.PrintServiceAttribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * The <code>PrinterName</code> printing attribute provides the name of a 
+ * print service. The name may but must not be related to parts of the
+ * printer URI.
+ * <p>
+ * <b>IPP Compatibility:</b> PrinterName is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.PrinterURI
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class PrinterName extends TextSyntax
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = 299740639137803127L;
+
+  /**
+   * Creates a <code>PrinterName</code> object.
+   *
+   * @param printerName the printer name
+   * @param locale the locale to use, if <code>null</code> the default
+   * locale is used.
+   *
+   * @exception NullPointerException if printerName is <code>null</code>.
+   */
+  public PrinterName(String printerName, Locale locale)
+  {
+    super(printerName, locale);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof PrinterName))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PrinterName</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PrinterName.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "printer-name".
+   */
+  public String getName()
+  {
+    return "printer-name";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterResolution.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterResolution.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterResolution.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterResolution.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,112 @@
+/* PrinterResolution.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+import javax.print.attribute.ResolutionSyntax;
+
+
+/**
+ * The <code>PrinterResolution</code> printing attribute specifies a 
+ * resolution supported by a print service or to be used by a print job. 
+ * <p>
+ * <b>IPP Compatibility:</b> PrinterResolution is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class PrinterResolution extends ResolutionSyntax
+  implements DocAttribute, PrintJobAttribute, PrintRequestAttribute
+{
+  private static final long serialVersionUID = 13090306561090558L;
+
+  /**
+   * Creates a <code>PrinterResolution</code> object with the given cross
+   * feed and feed resolutions.
+   *
+   * @param crossFeedResolution the cross feed resolution
+   * @param feedResolution the feed resolution
+   * @param units the unit to use (e.g. {@link #DPCM} or {@link #DPI})
+   *
+   * @exception IllegalArgumentException if either parameter is < 1
+   */
+  public PrinterResolution(int crossFeedResolution, int feedResolution,
+                           int units)
+  {
+    super(crossFeedResolution, feedResolution, units);
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof PrinterResolution))
+      return false;
+    
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PrinterResolution</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PrinterResolution.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "printer-resolution".
+   */
+  public String getName()
+  {
+    return "printer-resolution";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterState.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterState.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterState.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterState.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,146 @@
+/* PrinterState.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintServiceAttribute;
+
+
+/**
+ * The <code>PrinterState</code> printing attribute reports
+ * the current state of the printer device.
+ * <p>
+ * The {@link javax.print.attribute.standard.PrinterStateReasons}
+ * attribute provides further detailed information about
+ * the given printer state. Detailed information about the printer
+ * state and printer state reasons attributes can be found in the 
+ * RFC 2911.
+ * </p> 
+ * <p>
+ * <b>IPP Compatibility:</b> PrinterState is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class PrinterState extends EnumSyntax
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = -649578618346507718L;
+
+  /**
+   * The state is unknown currently.
+   */
+  public static final PrinterState UNKNOWN = new PrinterState(0);
+  
+  /**
+   * The printer device is in idle state. New jobs can start
+   * processing without waiting.
+   */
+  public static final PrinterState IDLE = new PrinterState(3);
+  
+  /**
+   * The printer device is in processing state.
+   */
+  public static final PrinterState PROCESSING = new PrinterState(4);
+  
+  /**
+   * The printer device has stopped. No jobs can be processed and
+   * normally manual intervention is needed.
+   */
+  public static final PrinterState STOPPED = new PrinterState(5);
+
+  private static final String[] stringTable = { "unknown", null, null, 
+                                                "idle", "processing", 
+                                                "stopped" };
+  
+  private static final PrinterState[] enumValueTable = { UNKNOWN, null, null,
+                                                         IDLE, PROCESSING, 
+                                                         STOPPED };
+  
+  /**
+   * Constructs a <code>PrinterState</code> object.
+   * 
+   * @param value the enum value.
+   */
+  protected PrinterState(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PrinterState</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PrinterState.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "printer-state".
+   */
+  public String getName()
+  {
+    return "printer-state";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterStateReason.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterStateReason.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterStateReason.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterStateReason.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,331 @@
+/* PrinterStateReason.java --
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+
+/**
+ * The <code>PrinterStateReason</code> attribute provides additional
+ * information about the current state of the printer device. Its always part
+ * of the {@link javax.print.attribute.standard.PrinterStateReasons}
+ * printing attribute. 
+ * <p>
+ * <b>IPP Compatibility:</b> PrinterStateReason is not an IPP 1.1 
+ * attribute itself but used inside the <code>PrinterStateReasons</code>
+ * attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public class PrinterStateReason extends EnumSyntax
+  implements Attribute
+{
+  private static final long serialVersionUID = -1623720656201472593L;
+
+  /**
+   * Any state other state not listed here.
+   */
+  public static final PrinterStateReason OTHER = new PrinterStateReason(0);
+  
+  /**
+   * A media tray has run out of media.
+   */
+  public static final PrinterStateReason MEDIA_NEEDED =
+    new PrinterStateReason(1);
+  
+  /**
+   * A media jam occured in the printer device.
+   */
+  public static final PrinterStateReason MEDIA_JAM = new PrinterStateReason(2);
+  
+  /**
+   * Indicates that the printer has been paused by the pause printer
+   * operation and is currently moving to the pause state.
+   */
+  public static final PrinterStateReason MOVING_TO_PAUSED =
+    new PrinterStateReason(3);
+  
+  /**
+   * The printer device has be paused by the pause printer operation.
+   */
+  public static final PrinterStateReason PAUSED = new PrinterStateReason(4);
+  
+  /**
+   * The printer device has been shutdown or removed from service.
+   */
+  public static final PrinterStateReason SHUTDOWN = new PrinterStateReason(5);
+  
+  /**
+   * The printer object is connecting to the device. If a printer
+   * device is on the network the printer object may be unable to connect. 
+   */
+  public static final PrinterStateReason CONNECTING_TO_DEVICE =
+    new PrinterStateReason(6);
+  
+  /**
+   * The connection to the device has timed out. 
+   */
+  public static final PrinterStateReason TIMED_OUT = new PrinterStateReason(7);
+  
+  /**
+   * The printer object is stopping the printer device.
+   */
+  public static final PrinterStateReason STOPPING = new PrinterStateReason(8);
+  
+  /**
+   * The printer object has stopped partly. A printer object may control
+   * several physical output devices (e.g. a printer class in CUPS) and
+   * stop only some of the devices.
+   */
+  public static final PrinterStateReason STOPPED_PARTLY =
+    new PrinterStateReason(9);
+  
+  /**
+   * The printer device is low on toner.
+   */
+  public static final PrinterStateReason TONER_LOW =
+    new PrinterStateReason(10);
+  
+  /**
+   * The printer device is out of toner.
+   */
+  public static final PrinterStateReason TONER_EMPTY =
+    new PrinterStateReason(11);
+  
+  /**
+   * The printers spool area is currently full. The printer is
+   * currently not able to accept jobs.
+   */
+  public static final PrinterStateReason SPOOL_AREA_FULL =
+    new PrinterStateReason(12);
+  
+  /**
+   * One or more covers of the printer device are open.
+   */
+  public static final PrinterStateReason COVER_OPEN =
+    new PrinterStateReason(13);
+  
+  /**
+   * One or more interlocks of the printer device are open.
+   */
+  public static final PrinterStateReason INTERLOCK_OPEN =
+    new PrinterStateReason(14);
+  
+  /**
+   * One or more doors of the printer device are open.
+   */
+  public static final PrinterStateReason DOOR_OPEN =
+    new PrinterStateReason(15);
+  
+  /**
+   * One or more input trays are missing in the printer device.
+   */
+  public static final PrinterStateReason INPUT_TRAY_MISSING =
+    new PrinterStateReason(16);
+  
+  /**
+   * The printer device is low on media.
+   */
+  public static final PrinterStateReason MEDIA_LOW =
+    new PrinterStateReason(17);
+  
+  /**
+   * The printer device is out of media.
+   */
+  public static final PrinterStateReason MEDIA_EMPTY =
+    new PrinterStateReason(18);
+  
+  /**
+   * One or more output trays are missing in the printer device.
+   */
+  public static final PrinterStateReason OUTPUT_TRAY_MISSING =
+    new PrinterStateReason(19);
+  
+  /**
+   * One or more output areas of the printer device are almost full.
+   */
+  public static final PrinterStateReason OUTPUT_AREA_ALMOST_FULL =
+    new PrinterStateReason(20);
+  
+  /**
+   * One or more output areas of the printer device are full.
+   */
+  public static final PrinterStateReason OUTPUT_AREA_FULL =
+    new PrinterStateReason(21);
+  
+  /**
+   * The printer device is low on marker supply.
+   */
+  public static final PrinterStateReason MARKER_SUPPLY_LOW =
+    new PrinterStateReason(22);
+  
+  /**
+   * The printer device is out of marker supply.
+   */
+  public static final PrinterStateReason MARKER_SUPPLY_EMPTY =
+    new PrinterStateReason(23);
+  
+  /**
+   * The marker waste bin of the printer device is almost full.
+   */
+  public static final PrinterStateReason MARKER_WASTE_ALMOST_FULL =
+    new PrinterStateReason(24);
+  
+  /**
+   * The marker waste bin of the printer device is full.
+   */
+  public static final PrinterStateReason MARKER_WASTE_FULL =
+    new PrinterStateReason(25);
+  
+  /**
+   * The fuser of the printer device is over temperature.
+   */
+  public static final PrinterStateReason FUSER_OVER_TEMP =
+    new PrinterStateReason(26);
+  
+  /**
+   * The fuser of the printer device is under the needed temperature.
+   */
+  public static final PrinterStateReason FUSER_UNDER_TEMP =
+    new PrinterStateReason(27);
+  
+  /**
+   * The optical photo conductor is near its end of life (EOL).
+   */
+  public static final PrinterStateReason OPC_NEAR_EOL =
+    new PrinterStateReason(28);
+  
+  /**
+   * The optical photo conductor has reached its end of life.
+   */
+  public static final PrinterStateReason OPC_LIFE_OVER =
+    new PrinterStateReason(29);
+  
+  /**
+   * The printer device is low on developer.
+   */
+  public static final PrinterStateReason DEVELOPER_LOW =
+    new PrinterStateReason(30);
+  
+  /**
+   * The printer device is out of developer.
+   */
+  public static final PrinterStateReason DEVELOPER_EMPTY =
+    new PrinterStateReason(31);
+  
+  /**
+   * An interpreter resource (e.g. font) is unavailable.
+   */
+  public static final PrinterStateReason INTERPRETER_RESOURCE_UNAVAILABLE =
+    new PrinterStateReason(32);
+
+  private static final String[] stringTable = 
+    { "other", "media-needed",  "media-jam", "moving-to-paused", "paused", 
+    "shutdown", "connecting-to-device", "timed-out", "stopping", 
+    "stopped-partly", "toner-low", "toner-empty", "spool-area-full", 
+    "cover-open", "interlock-open", "door-open", "input-tray-missing", 
+    "media-low", "media-empty", "output-tray-missing", "output-area-almost-full",
+    "output-area-full", "marker-supply-low", "marker-supply-empty", 
+    "marker-waste-almost-full", "marker-waste-full", "fuser-over-temp", 
+    "fuser-under-temp", "opc-near-eol", "opc-life-over", "developer-low", 
+    "developer-empty", "interpreter-resource-unavailable" };
+
+  private static final PrinterStateReason[] enumValueTable = 
+    { OTHER, MEDIA_NEEDED, MEDIA_JAM, MOVING_TO_PAUSED, PAUSED, SHUTDOWN,
+    CONNECTING_TO_DEVICE, TIMED_OUT, STOPPING, STOPPED_PARTLY, TONER_LOW,
+    TONER_EMPTY, SPOOL_AREA_FULL, COVER_OPEN, INTERLOCK_OPEN, DOOR_OPEN,
+    INPUT_TRAY_MISSING, MEDIA_LOW, MEDIA_EMPTY, OUTPUT_TRAY_MISSING,
+    OUTPUT_AREA_ALMOST_FULL, OUTPUT_AREA_FULL, MARKER_SUPPLY_LOW,
+    MARKER_SUPPLY_EMPTY, MARKER_WASTE_ALMOST_FULL, MARKER_WASTE_FULL,
+    FUSER_OVER_TEMP, FUSER_UNDER_TEMP, OPC_NEAR_EOL, OPC_LIFE_OVER, 
+    DEVELOPER_LOW, DEVELOPER_EMPTY, INTERPRETER_RESOURCE_UNAVAILABLE };
+
+  /**
+   * Constructs a <code>PrinterStateReason</code> object.
+   * 
+   * @param value the enum value.
+   */
+  protected PrinterStateReason(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PrintStateReason</code> itself.
+   */
+  public final Class getCategory()
+  {
+    return PrinterStateReason.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "printer-state-reason".
+   */
+  public final String getName()
+  {
+    return "printer-state-reason";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterStateReasons.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterStateReasons.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterStateReasons.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterStateReasons.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,203 @@
+/* PrinterStateReasons.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.print.attribute.PrintServiceAttribute;
+
+/**
+ * The <code>PrinterStateReasons</code> attribute provides the set of 
+ * additional informations available about the current state of the printer 
+ * device.
+ * <p>
+ * The attribute is basically a map with <code>PrinterStateReason</code>
+ * objects as keys associated with their severity level as 
+ * <code>Severity</code> instances. The IPP keyword value can be 
+ * constructed as follows: <br>
+ * <code>reason.toString() + '-' + severity.toString()</code> 
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> PrinterStateReasons is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.PrinterState
+ * @see javax.print.attribute.standard.PrinterStateReason
+ * @see javax.print.attribute.standard.Severity
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class PrinterStateReasons extends HashMap
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = -3731791085163619457L;
+
+  /**
+   * Constructs an empty <code>PrinterStateReasons</code> attribute.
+   */  
+  public PrinterStateReasons()
+  {
+    super();
+  }
+
+  /**
+   * Constructs an empty <code>PrinterStateReasons</code> attribute
+   * with the given initial capacity and load factor.
+   * 
+   * @param initialCapacity the intial capacity.
+   * @param loadFactor the load factor of the underlying HashMap.
+   * 
+   * @throws IllegalArgumentException if initialCapacity < 0
+   * @throws IllegalArgumentException if initialCapacity or loadFactor < 0
+   */
+  public PrinterStateReasons(int initialCapacity, float loadFactor)
+  {
+    super(initialCapacity, loadFactor);
+  }
+
+  /**
+   * Constructs an empty <code>PrinterStateReasons</code> attribute
+   * with the given initial capacity and the default load factor.
+   * 
+   * @param initialCapacity the intial capacity.
+   * 
+   * @throws IllegalArgumentException if initialCapacity < 0
+   */
+  public PrinterStateReasons(int initialCapacity)
+  {
+    super(initialCapacity);
+  }
+
+  /**
+   * Constructs a <code>PrinterStateReasons</code> attribute
+   * with the given content of the map.
+   * 
+   * @param map the map for the initial values with the same 
+   * <code>PrinterStateReason</code> to <code>Severity</code> mappings.
+   * 
+   * @throws NullPointerException if map or any key/value is <code>null</code>.
+   * @throws ClassCastException if values of map are not of type 
+   * <code>PrinterStateReason</code> and keys are not of type 
+   * <code>Severity</code>.
+   */
+  public PrinterStateReasons(Map map)
+  {
+    super(map.size(), 0.75f);
+    Iterator it = map.entrySet().iterator();
+    while (it.hasNext())
+      {
+        Map.Entry entry = (Map.Entry) it.next();
+        put(entry.getKey(), entry.getValue());
+      }
+  }
+
+  /**
+   * Constructs an unmodifiable view of the contained printer state reasons
+   * associated with the given severity level.
+   * 
+   * @param severity the severity level for the constructed set.
+   * @return The set of printer state reasons.
+   */
+  public Set printerStateReasonSet(Severity severity)
+  {
+    if (severity == null)
+      throw new NullPointerException("severity is null");
+    
+    HashSet set = new HashSet();
+    Iterator it = entrySet().iterator();
+    while (it.hasNext())
+      {
+        Map.Entry entry = (Map.Entry) it.next();
+        if (entry.getValue().equals(severity))
+          set.add(entry.getKey());
+      }
+    
+    return Collections.unmodifiableSet(set);
+  }
+  
+  /**
+   * Puts the given reason object associated with the given severity object
+   * into the set.
+   * 
+   * @param reason the reason of type <code>PrinterStateReason</code>.
+   * @param severity the severity of the reason of type <code>Severity</code>.
+   * 
+   * @return The previously associated severity of the reason or 
+   * <code>null</code> if the reason object was not in the map before.
+   * 
+   * @throws NullPointerException if any of the values is <code>null</code>.
+   * @throws ClassCastException if reason is not a 
+   * <code>PrinterStateReason</code> and severity is not a 
+   * <code>Severity</code> instance.
+   */
+  public Object put(Object reason, Object severity)
+  {
+    if (reason == null)
+      throw new NullPointerException("reason is null");    
+    if (severity == null)
+      throw new NullPointerException("severity is null");
+    
+    return super.put((PrinterStateReason) reason, (Severity) severity);
+  }   
+  
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PrintStateReasons</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PrinterStateReasons.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "printer-state-reasons".
+   */
+  public String getName()
+  {
+    return "printer-state-reasons";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterURI.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterURI.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterURI.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/PrinterURI.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,111 @@
+/* PrinterURI.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.net.URI;
+
+import javax.print.attribute.PrintServiceAttribute;
+import javax.print.attribute.URISyntax;
+
+/**
+ * The <code>PrinterURI</code> attribute provides the URI of a printer. 
+ * <p>
+ * The URI identifies the printer against all the other print services 
+ * available. This attribute is used to direct a print service request 
+ * to this specific printer.
+ * </p> 
+ * <p>
+ * <b>IPP Compatibility:</b> PrinterURI is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class PrinterURI extends URISyntax
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = 7923912792485606497L;
+
+  /**
+   * Constructs a <code>PrinterURI</code> object.
+   * 
+   * @param uri the URI of the print service.
+   * @throws NullPointerException if the given uri is null.
+   */
+  public PrinterURI(URI uri)
+  {
+    super(uri);
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof PrinterURI))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>PrinterURI</code> itself.
+   */
+  public Class getCategory()
+  {
+    return PrinterURI.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "printer-uri".
+   */
+  public String getName()
+  {
+    return "printer-uri";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/QueuedJobCount.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/QueuedJobCount.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/QueuedJobCount.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/QueuedJobCount.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,110 @@
+/* QueuedJobCount.java -- 
+   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintServiceAttribute;
+
+/**
+ * The <code>QueuedJobCount</code> printing attribute reports 
+ * the number of jobs currently in the queue. These are jobs
+ * that are in 'pending', 'processing', 'pending-held' or
+ * 'processing-stopped' state. 
+ * <p>
+ * <b>IPP Compatibility:</b> QueuedJobCount is an IPP 1.1 attribute.
+ * </p>
+ * @see javax.print.attribute.standard.JobState
+ * 
+ * @author Michael Koch
+ */
+public final class QueuedJobCount extends IntegerSyntax
+  implements PrintServiceAttribute
+{
+  private static final long serialVersionUID = 7499723077864047742L;
+  
+  /**
+   * Creates a <code>QueuedJobCount</code> object.
+   *
+   * @param value the number of queued jobs
+   *
+   * @exception IllegalArgumentException if value < 0
+   */
+  public QueuedJobCount(int value)
+  {
+    super(value);
+
+    if (value < 0)
+      throw new IllegalArgumentException("value may not be less than 0");
+  }
+  
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof QueuedJobCount))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>QueuedJobCount</code> itself.
+   */
+  public Class getCategory()
+  {
+    return QueuedJobCount.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "queued-job-count".
+   */
+  public String getName()
+  {
+    return "queued-job-count";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/ReferenceUriSchemesSupported.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/ReferenceUriSchemesSupported.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/ReferenceUriSchemesSupported.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/ReferenceUriSchemesSupported.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,166 @@
+/* ReferenceUriSchemesSupported.java --
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+
+
+/**
+ * The <code>ReferenceUriSchemesSupported</code> attribute provides 
+ * the supported URI schemes (e.g. ftp) which are supported by the
+ * printer service to be used as uri reference for document data.
+ * <p>
+ * <b>IPP Compatibility:</b> ReferenceUriSchemesSupported is an IPP 1.1 
+ * attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public class ReferenceUriSchemesSupported extends EnumSyntax
+  implements Attribute
+{
+  private static final long serialVersionUID = -8989076942813442805L;
+
+  /**
+   * The file transfer protocol (FTP).
+   */
+  public static final ReferenceUriSchemesSupported FTP =
+    new ReferenceUriSchemesSupported(0);
+  
+  /**
+   * The hyper text transfer protocol (HTTP).
+   */
+  public static final ReferenceUriSchemesSupported HTTP =
+    new ReferenceUriSchemesSupported(1);
+  
+  /**
+   * The secure hyper text transfer protocol (HTTPS).
+   */
+  public static final ReferenceUriSchemesSupported HTTPS =
+    new ReferenceUriSchemesSupported(2);
+  
+  /**
+   * The gopher protocol.
+   */
+  public static final ReferenceUriSchemesSupported GOPHER =
+    new ReferenceUriSchemesSupported(3);
+  
+  /**
+   * The USENET news - RFC 1738.
+   */
+  public static final ReferenceUriSchemesSupported NEWS =
+    new ReferenceUriSchemesSupported(4);
+  
+  /**
+   * The network news transfer protocol (NNTP) - RFC 1738.
+   */
+  public static final ReferenceUriSchemesSupported NNTP =
+    new ReferenceUriSchemesSupported(5);
+  
+  /**
+   * The wide area information server protocol (WAIS) - RFC 4156.
+   */
+  public static final ReferenceUriSchemesSupported WAIS =
+    new ReferenceUriSchemesSupported(6);
+  
+  /**
+   * A filename specific to the host.
+   */
+  public static final ReferenceUriSchemesSupported FILE =
+    new ReferenceUriSchemesSupported(7);
+
+  private static final String[] stringTable = { "ftp", "http", "https", 
+                                                "gopher", "news", "nntp", 
+                                                "wais", "file" };
+
+  private static final ReferenceUriSchemesSupported[] enumValueTable = 
+    { FTP, HTTP, HTTPS, GOPHER, NEWS, NNTP, WAIS, FILE };
+
+  /**
+   * Constructs a <code>ReferenceUriSchemeSupported</code> object.
+   * 
+   * @param value the enum value.
+   */
+  protected ReferenceUriSchemesSupported(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>ReferenceUriSchemesSupported</code> itself.
+   */
+  public final Class getCategory()
+  {
+    return ReferenceUriSchemesSupported.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "reference-uri-schemes-supported".
+   */
+  public final String getName()
+  {
+    return "reference-uri-schemes-supported";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/RequestingUserName.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/RequestingUserName.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/RequestingUserName.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/RequestingUserName.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,109 @@
+/* RequestingUserName.java -- 
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.print.attribute.standard;
+
+import java.util.Locale;
+
+import javax.print.attribute.PrintRequestAttribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * The <code>RequestingUserName</code> attribute provides the name of 
+ * the user which requests the printing of the given job.
+ * <p>
+ * <b>IPP Compatibility:</b> RequestingUserName is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public final class RequestingUserName extends TextSyntax
+  implements PrintRequestAttribute
+{
+  private static final long serialVersionUID = -2683049894310331454L;
+
+  /**
+   * Creates a <code>RequestingUserName</code> object.
+   *
+   * @param userName the user name
+   * @param locale the locale to use, if <code>null</code> the default
+   * locale is used.
+   *
+   * @exception NullPointerException if userName is <code>null</code>.
+   */
+  public RequestingUserName(String userName, Locale locale)
+  {
+    super(userName, locale);
+  }
+
+  /**
+   * Tests if the given object is equal to this object.
+   *
+   * @param obj the object to test
+   *
+   * @return <code>true</code> if both objects are equal, 
+   * <code>false</code> otherwise.
+   */
+  public boolean equals(Object obj)
+  {
+    if(! (obj instanceof RequestingUserName))
+      return false;
+
+    return super.equals(obj);
+  }
+
+  /**
+   * Returns category of this attribute.
+   *
+   * @return The class <code>RequestingUserName</code> itself.
+   */
+  public Class getCategory()
+  {
+    return RequestingUserName.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "requesting-user-name".
+   */
+  public String getName()
+  {
+    return "requesting-user-name";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Severity.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Severity.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Severity.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Severity.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,135 @@
+/* Severity.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+
+
+/**
+ * The <code>Severity</code> printing attribute specifies the severity
+ * for a <code>PrinterStateReason</code> attribute.
+ * <p>
+ * This attribute does not appear in the attribute set of a print service 
+ * itself. Its used inside the <code>PrinterStateReasons</code> 
+ * attribute which contains <code>PrinterStateReason</code> objects which 
+ * informs about the print service's status.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> Severity is not an IPP attribute on its own
+ * but used in the PrinterStateReason attribute to indicate the severity.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class Severity extends EnumSyntax
+  implements Attribute
+{
+  private static final long serialVersionUID = 8781881462717925380L;
+
+  /**
+   * Indicates that the reason is a report.
+   */
+  public static final Severity REPORT = new Severity(0);
+  
+  /**
+   * Indicates that the reason is a warning.
+   */
+  public static final Severity WARNING = new Severity(1);
+  
+  /**
+   * Indicates that the reason is an error.
+   */
+  public static final Severity ERROR = new Severity(2);
+
+  private static final String[] stringTable = { "report", "warning", "error" };
+  
+  private static final Severity[] enumValueTable = { REPORT, WARNING, ERROR };
+  
+  /**
+   * Constructs a <code>Severity</code> object.
+   *
+   * @param value the enum value.
+   */
+  protected Severity(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>Severity</code> itself.
+   */
+  public Class getCategory()
+  {
+    return Severity.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "severity".
+   */
+  public String getName()
+  {
+    return "severity";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/SheetCollate.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/SheetCollate.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/SheetCollate.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/SheetCollate.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,135 @@
+/* SheetCollate.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+
+/**
+ * The <code>SheetCollate</code> printing attribute specifies 
+ * whether or not the sheets of each copy in a print job have to be
+ * in sequence.
+ * <p>
+ * The attribute only makes sense if multiple copies are specified through
+ * the <code>Copies</code> printing attribute. If <code>UNCOLLATED</code>
+ * is specified every page of a print job is printed for all requested
+ * copies before the next page is processed. <code>COLLATED</code> means
+ * that for every copy requested the pages have to be printed in sequence.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> SheetCollate is not an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class SheetCollate extends EnumSyntax
+  implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
+{
+  private static final long serialVersionUID = 7080587914259873003L;
+
+  /**
+   * The sheets of the different copies are uncollated.
+   */
+  public static final SheetCollate UNCOLLATED = new SheetCollate(0);
+  
+  /**
+   * The sheets of the different copies are collated.
+   */
+  public static final SheetCollate COLLATED = new SheetCollate(1);
+
+
+  private static final String[] stringTable = { "uncollated", "collated" };
+  
+  private static final SheetCollate[] enumValueTable = { UNCOLLATED, 
+                                                         COLLATED };  
+  
+  /**
+   * Creates a <code>SheetCollate</code> object.
+   *
+   * @param value the enum value.
+   */
+  protected SheetCollate(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>SheetCollate</code> itself.
+   */
+  public Class getCategory()
+  {
+    return SheetCollate.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "sheet-collate".
+   */
+  public String getName()
+  {
+    return "sheet-collate";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Sides.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Sides.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Sides.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/Sides.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,146 @@
+/* Sides.java --
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute.standard;
+
+import javax.print.attribute.DocAttribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.PrintJobAttribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+
+/**
+ * The <code>Sides</code> printing attribute specifies how consecutive
+ * printing pages are arranged on the media sheet. 
+ * <p>
+ * <b>IPP Compatibility:</b> Sides is an IPP 1.1 attribute.
+ * </p>
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ * @author Wolfgang Baer (WBaer at gmx.de)
+ */
+public final class Sides extends EnumSyntax
+  implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
+{
+  private static final long serialVersionUID = -6890309414893262822L;
+
+  /** 
+   * Specifies that each page should be printed on one sheet. 
+   */
+  public static final Sides ONE_SIDED = new Sides(0);
+  
+  /** 
+   * Specifies that two following pages should be printed on the 
+   * front and back of one sheet for binding on the long edge.
+   */
+  public static final Sides TWO_SIDED_LONG_EDGE = new Sides(1);
+  
+  /** 
+   * Specifies that two following pages should be printed on the 
+   * front and back of one sheet for binding on the short edge.
+   */
+  public static final Sides TWO_SIDED_SHORT_EDGE = new Sides(2);
+  
+  /** 
+   * An alias constant for "two sided long edge". 
+   */
+  public static final Sides DUPLEX = new Sides(1);
+  
+  /** 
+   * An alias constant for "two sided short edge". 
+   */
+  public static final Sides TUMBLE = new Sides(2);
+
+  private static final String[] stringTable = { "one-sided", 
+                                                "two-sided-long-edge",
+                                                "two-sided-short-edge" };
+  
+  private static final Sides[] enumValueTable = { ONE_SIDED, 
+                                                  TWO_SIDED_LONG_EDGE, 
+                                                  TWO_SIDED_SHORT_EDGE };  
+  
+  /**
+   * Creates a <code>Sides</code> object.
+   *
+   * @param value the number of sides
+   */
+  protected Sides(int value)
+  {
+    super(value);
+  }
+
+  /**
+   * Returns category of this class.
+   *
+   * @return The class <code>Sides</code> itself.
+   */
+  public Class getCategory()
+  {
+    return Sides.class;
+  }
+
+  /**
+   * Returns the name of this attribute.
+   *
+   * @return The name "sides".
+   */
+  public String getName()
+  {
+    return "sides";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/package.html
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/package.html?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/package.html (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/attribute/standard/package.html Thu Nov  8 16:56:19 2007
@@ -0,0 +1,60 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.print.attribute.standard 
+                    package.
+   Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.print.attribute.standard</title></head>
+
+<body>
+Provides the printing attribute classes of the Java Print Service API.
+<p>
+The package contains the available printing attributes. Some attributes are 
+used by the print service implementations to inform about the state of print 
+services and print jobs. Other attributes are needs to be provided by the 
+user/program to specify how a print job or a document in a print job should 
+be printed.
+</p><p>
+<b>Note:</b> Printing attributes can implement more than one attribute role 
+and therefore be used to specify e.g. print request attributes as well as 
+document attributes.
+</p>
+<p>
+<b>Since:</b> 1.4
+</p>
+</body>
+</html>

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintEvent.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintEvent.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintEvent.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintEvent.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,69 @@
+/* PrintEvent.java -- 
+   Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.event;
+
+import java.util.EventObject;
+
+
+/**
+ * Superclass of all events in the Java Print Service API.
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public class PrintEvent extends EventObject
+{
+  /**
+   * Constructs a <code>PrintEvent</code> object.
+   * 
+   * @param source the source of this event
+   */
+  public PrintEvent(Object source)
+  {
+    super(source);
+  }
+
+  /**
+   * Returns a string representation of this object.
+   * 
+   * @return The string representation
+   */
+  public String toString()
+  {
+    return "PrintEvent on " + getSource().toString();
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobAdapter.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobAdapter.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobAdapter.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobAdapter.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,129 @@
+/* PrintJobAdapter.java -- 
+   Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.event;
+
+
+/**
+ * Adapter class for implementing {@link javax.print.event.PrintJobListener}
+ * classes. The methods in this class do nothing by default. Subclasses may
+ * only implement the methods for the {@link javax.print.event.PrintJobEvent}s
+ * they are interested in.
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public abstract class PrintJobAdapter
+  implements PrintJobListener
+{
+  /**
+   * Constructs a <code>PrintJobAdapter</code> object.
+   */
+  public PrintJobAdapter()
+  {
+    // Do nothing here.
+  }
+  
+  /**
+   * Called to notify the client that all data has been successfully transferred
+   * to the print service.
+   * <p>The default implementation does nothing.</p>
+   * 
+   * @param event the event. 
+   */
+  public void printDataTransferCompleted(PrintJobEvent event)
+  {
+    // Do nothing here.
+  }
+
+  /**
+   * Called to notify the client that a print job was canceled. 
+   * <p>The default implementation does nothing.</p>
+   * 
+   * @param event the event. 
+   */
+  public void printJobCanceled(PrintJobEvent event)
+  {
+    // Do nothing here.
+  }
+
+  /**
+   * Called to notify the client that a print job was successfully completed.
+   * <p>The default implementation does nothing.</p>
+   * 
+   * @param event the event. 
+   */
+  public void printJobCompleted(PrintJobEvent event)
+  {
+    // Do nothing here.
+  }
+
+  /**
+   * Called to notify the client that a print job failed to complete
+   * successfully.
+   * <p>The default implementation does nothing.</p>
+   * 
+   * @param event the event. 
+   */
+  public void printJobFailed(PrintJobEvent event)
+  {
+    // Do nothing here.
+  }
+
+  /**
+   * Called to notify the client that no more job events will be send.
+   * <p>The default implementation does nothing.</p>
+   * 
+   * @param event the event. 
+   */
+  public void printJobNoMoreEvents(PrintJobEvent event)
+  {
+    // Do nothing here.
+  }
+
+  /**
+   * Called to notify the client that a problem occured during printing.
+   * This event signals problems a user might be able to fix 
+   * (e.g. out of paper or paper jam).
+   * <p>The default implementation does nothing.</p>
+   * 
+   * @param event the event. 
+   */
+  public void printJobRequiresAttention(PrintJobEvent event)
+  {
+    // Do nothing here.
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobAttributeEvent.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobAttributeEvent.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobAttributeEvent.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobAttributeEvent.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,89 @@
+/* PrintJobAttributeEvent.java -- 
+   Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.event;
+
+import javax.print.DocPrintJob;
+import javax.print.attribute.PrintJobAttributeSet;
+
+
+/**
+ * <code>PrintJobAttributeEvent</code>s are generated by a 
+ * <code>PrintService</code> to inform registered listeners that attributes
+ * associated with a {@link javax.print.DocPrintJob} instance have changed.
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public class PrintJobAttributeEvent extends PrintEvent
+{
+  private static final long serialVersionUID = -6534469883874742101L;
+  
+  private PrintJobAttributeSet attributes;
+  
+  /**
+   * Constructs a <code>PrintJobAttributeEvent</code> object.
+   * 
+   * @param source the source of this event
+   * @param attributes the attribute changes being reported
+   */
+  public PrintJobAttributeEvent(DocPrintJob source,
+                                PrintJobAttributeSet attributes)
+  {
+    super(source);
+    this.attributes = attributes;
+  }
+
+  /**
+   * Returns the print job generating this event.
+   * 
+   * @return The print job.
+   */
+  public DocPrintJob getPrintJob()
+  {
+    return (DocPrintJob) getSource();
+  }
+
+  /**
+   * Returns the attributes that changed and their new values.
+   * 
+   * @return The changed attributes.
+   */
+  public PrintJobAttributeSet getAttributes()
+  {
+    return attributes;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobAttributeListener.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobAttributeListener.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobAttributeListener.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobAttributeListener.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,56 @@
+/* PrintJobAttributeListener.java -- 
+   Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.event;
+
+
+/**
+ * Listener interface to receive attribute changes from a print job.
+ * Implementations of this interface can be registered with a 
+ * {@link javax.print.DocPrintJob} instance.
+ *  
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public interface PrintJobAttributeListener
+{
+  /**
+   * Notifies the listener of an attribute change.
+   * 
+   * @param event the event
+   */
+  void attributeUpdate(PrintJobAttributeEvent event);
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobEvent.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobEvent.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobEvent.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobEvent.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,109 @@
+/* PrintEvent.java -- 
+   Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.event;
+
+import javax.print.DocPrintJob;
+
+
+/**
+ * <code>PrintJobEvent</code>s are generated by a print job during
+ * print job processing to inform registered listeners about the state
+ * of processing.
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public class PrintJobEvent extends PrintEvent
+{
+  private static final long serialVersionUID = -1711656903622072997L;
+  
+  /** Indicates that the data transfer to the print service has completed. */
+  public static final int DATA_TRANSFER_COMPLETE = 106;
+  
+  /** Indicates that the print job was canceled. */
+  public static final int JOB_CANCELED = 101;
+  
+  /** Indicates that the print job was completed (=printed). */
+  public static final int JOB_COMPLETE = 102;
+  
+  /** Indicates that the print job failed to complete. */
+  public static final int JOB_FAILED = 103;
+  
+  /** Indicates that no more job events will be send.*/
+  public static final int NO_MORE_EVENTS = 105;
+  
+  /** 
+   * Indicates a situation where human intervention might be needed.
+   * E.g. the printer run out of paper or a paper jam occured.
+   */
+  public static final int REQUIRES_ATTENTION = 104;
+  
+  /** The reason (one of the defined constants). */
+  private int reason;
+  
+  /**
+   * Constructs a <code>PrintJobEvent</code> object.
+   * 
+   * @param source the source generating this event
+   * @param reason the reason for this event
+   */
+  public PrintJobEvent(DocPrintJob source, int reason)
+  {
+    super(source);
+    this.reason = reason;
+  }
+
+  /**
+   * Returns the reason for this event.
+   * 
+   * @return The reason.
+   */
+  public int getPrintEventType()
+  {
+    return reason;
+  }
+
+  /**
+   * Returns the print job that generated this event.
+   * 
+   * @return The print job.
+   */ 
+  public DocPrintJob getPrintJob()
+  {
+    return (DocPrintJob) getSource();
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobListener.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobListener.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobListener.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintJobListener.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,96 @@
+/* PrintJobListener.java -- 
+   Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.event;
+
+
+/**
+ * Listener interface to receive processing events from a print job.
+ * Implementations of this interface can be registered with a 
+ * {@link javax.print.DocPrintJob} instance.
+ * 
+ * @see javax.print.event.PrintJobAdapter
+ *  
+ * @author Michael Koch (konqueror at gmx.de) 
+ */
+public interface PrintJobListener
+{
+  /**
+   * Notifies the listener that all data has been successfully transferred
+   * to the print service.
+   * 
+   * @param event the event
+   */
+  void printDataTransferCompleted(PrintJobEvent event);
+  
+  /**
+   * Notifies the listener that a print job got canceled.
+   * 
+   * @param event the event
+   */
+  void printJobCanceled(PrintJobEvent event);
+  
+  /**
+   * Notifies the listener that a print job has completed.
+   * 
+   * @param event the event
+   */
+  void printJobCompleted(PrintJobEvent event);
+  
+  /**
+   * Notifies the listener that a print job has failed to complete.
+   * 
+   * @param event the event.
+   */
+  void printJobFailed(PrintJobEvent event);
+  
+  /**
+   * Notifies the listener that no more events will be delivered.
+   * 
+   * @param event the event
+   */
+  void printJobNoMoreEvents(PrintJobEvent event);
+  
+  /**
+   * Notifies the listener that a problem occured during printing.
+   * This event signals problems a user might be able to fix 
+   * (e.g. out of paper or paper jam).
+   * 
+   * @param event the event
+   */
+  void printJobRequiresAttention(PrintJobEvent event);
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintServiceAttributeEvent.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintServiceAttributeEvent.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintServiceAttributeEvent.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintServiceAttributeEvent.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,87 @@
+/* PrintServiceAttributeEvent.java -- 
+   Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.event;
+
+import javax.print.PrintService;
+import javax.print.attribute.PrintServiceAttributeSet;
+
+
+/**
+ * <code>PrintServiceAttributeEvent</code>s are generated by a 
+ * <code>PrintService</code> to inform registered listeners that
+ * its associated attributes have changed.
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public class PrintServiceAttributeEvent extends PrintEvent
+{
+  private PrintServiceAttributeSet attributes;
+  
+  /**
+   * Constructs a <code>PrintServiceAttributeEvent</code> object.
+   * 
+   * @param source the source of this event
+   * @param attributes the attribute changes being reported
+   */
+  public PrintServiceAttributeEvent(PrintService source,
+                                    PrintServiceAttributeSet attributes)
+  {
+    super(source);
+    this.attributes = attributes;
+  }
+
+  /**
+   * Returns the print service that generated this event.
+   * 
+   * @return The print service.
+   */
+  public PrintService getPrintService()
+  {
+    return (PrintService) getSource();
+  }
+
+  /**
+   * Returns the changed attributes this event reports.
+   * 
+   * @return The changed attributes.
+   */
+  public PrintServiceAttributeSet getAttributes()
+  {
+    return attributes;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintServiceAttributeListener.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintServiceAttributeListener.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintServiceAttributeListener.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/PrintServiceAttributeListener.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,56 @@
+/* PrintServiceAttributeListener.java -- 
+   Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.event;
+
+
+/**
+ * Listener interface to receive attribute changes from a print service.
+ * Implementations of this interface can be registered with a 
+ * {@link javax.print.PrintService} instance.
+ * 
+ * @author Michael Koch (konqueror at gmx.de)
+ */
+public interface PrintServiceAttributeListener
+{
+  /**
+   * Notifies the listener that some attributes have changed.
+   * 
+   * @param event the event
+   */
+  void attributeUpdate(PrintServiceAttributeEvent event);
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/package.html
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/package.html?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/package.html (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/event/package.html Thu Nov  8 16:56:19 2007
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.print.event package.
+   Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.print.event</title></head>
+
+<body>
+Provides events and listeners to be used with the Java Print Service API.
+<p>
+The provided listeners are used to register with print services and/or
+print jobs to receive state information or to monitor the progress of
+print jobs. Print jobs don't need to be implemented synchronous and
+therefore should be monitored to know if they succeed or fail. For this
+common task the <a href="PrintJobAdapter.html">PrintJobAdapter</a> class 
+is provided.
+</p>
+<p>
+<b>Since:</b> 1.4
+</p>
+</body>
+</html>

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/print/package.html
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/print/package.html?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/print/package.html (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/print/package.html Thu Nov  8 16:56:19 2007
@@ -0,0 +1,240 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.print package.
+   Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.print</title></head>
+<body>
+Provides the basic interfaces and classes of the Java Print Service API.
+<p>
+The Java Print Service API enables programmers to:
+<ul>
+<li>Discover print services for printing to printer devices and to output 
+streams. The discovery process can be constrained to return only print
+services supporting specific document formats or printing attributes.</li>
+<li>Print client-formatted print data like Postscript, PDF or various
+image formats and service-formatted print data from Java.</li>
+<li>Submit, cancel and monitor single and multi document print jobs.</li>
+<li>Provide users a graphical print service browser with printing attribute 
+selection.</li>
+</ul>
+</p>
+<p>
+<h2>Print Service Discovery</h2>
+
+Print service types in the JPS API:
+<ul>
+<li><a href="PrintService.html">PrintService</a>:<br>The base interface 
+describing a print service capable of printing a supplied document for a 
+given document format to the printer device it is representing.</li><br>
+<li><a href="MultiDocPrintService.html">MultiDocPrintService</a>:<br>Extends 
+the PrintService interface and provides a print service which is capable of 
+printing multiple documents as one print job to its printer device.</li><br>
+<li><a href="StreamPrintService.html">StreamPrintService</a>:<br>Extends the 
+PrintService interface and provides a print service which is capable of 
+printing into a supplied output stream instead of to a physical printer 
+device.</li>
+</ul>
+</p>
+<p>
+<h4>PrintService, MultiDocPrintService</h4>
+Discovery is done by the use of the static methods in the 
+<a href="PrintServiceLookup.html">PrintServiceLookup</a> class. The discovery 
+process can be constrained by supplying the document formats and printing 
+attributes that need to be supported by the returned print service. Furthermore
+the <a href="PrintServiceLookup.html#lookupDefaultPrintService()">
+lookupDefaultPrintService()</a> method enables to lookup the default print
+service of the platforms printing system.
+</p>
+<p>
+<h4>StreamPrintService</h4>
+StreamPrintService provides the same functionality as a print service for output
+to a supplied <code>OutputStream</code>. Available stream print services are 
+discovered via the static methods in the <a href="StreamPrintServiceFactory.html">
+StreamPrintServiceFactory</a> factory. The query can be constrained by supplying
+the the requested document format support and the needed output format.
+</p>
+
+<h2>Document formats</h2>
+
+The format of the printing documents are specified by the 
+<a href="DocFlavor.html">DocFlavor</a> class in the JPS API. It provides the 
+description of the format in which the print data will be supplied in a print 
+job to the print service and consists of two parts:
+<ul>
+<li>The MIME type (Multipurpose Internet Mail Extensions types as described in 
+RFC 2045/2046) specifying the media format of the print data.</li>
+<br>
+<li>The representation class name which is the fully qualified name of the 
+class providing the print data to the print job. For example if the print data 
+is supplied as a byte array the representation class name will be "[B" or for 
+an input stream "java.io.InputStream".</li>
+</ul>
+The Java Print Service API differentiates between two types of print data, 
+client-formatted and service-formatted. Client-formatted print data is already 
+provided in a formatted representation by the client e.g. in an image format 
+or as postscript. For service-formatted print data, the Java Print Service 
+implementation produces the formatted print data. Here the doc flavor's 
+representation class name does specify an interface instead of the actual 
+print data source. The print service will call the methods of the given 
+implementation of this interface with a special Graphics object capable of 
+producing formatted print data from the graphics routines inside the 
+interface methods.
+</ul>
+<h2>Printing attributes</h2>
+
+Print services as well as print jobs report their state and capabilities 
+by the way of supplying printing attributes. Also the behaviour of print
+jobs (like how many copies should be printed) is controlled via printing
+attributes. For these requirements the JPS API defines different roles
+of attributes and common syntax classes in the package 
+<code>javax.print.attribute</code>. The actual available printing attributes 
+are implemented in the <code>javax.print.attribute.standard</code> package.
+<ul>
+
+<li>Print service attributes:<br>
+These printing attributes of role 
+<a href="attribute/PrintServiceAttribute.html">PrintServiceAttribute</a> report 
+the status and other informations of a PrintService. Example for informations
+available in the print services attributes are the attribute 
+<code>PagesPerMinute</code> providing the number of pages a printer can print 
+per minute. Status attributes like the <code>PrinterState</code> attribute
+gives the current state (e.g. printer currently processes or is idle) of the 
+printer.</li>
+<br>
+<li>Print job attributes:<br>
+Print job attributes of role <a href="attribute/PrintJobAttribute.html">
+PrintJobAttribute</a> inform about the status of given print job. For example 
+the <code>NumberOfInterveningJobs</code> attribute provides the number of jobs 
+ahead in the print service queue before this job. Status attributes like the 
+<code>JobState</code> attribute gives the current state of the print job (like
+pending, processing or canceled).</li>
+<br>
+<li>Print request attributes:<br>
+The attributes of role <a href="attribute/PrintRequestAttribute.html">
+PrintRequestAttribute</a> specify the behaviour of a complete print job.
+The print request attributes apply to all documents in a print job, whereas 
+the doc attributes only apply to the specific document in a print job.
+Most of the print request attributes are also doc attributes and therefore
+implementing both attribute role interfaces.
+</li>
+<br>
+<li>Doc attributes:<br>
+As described above the <a href="attribute/PrintJobAttribute.html">
+PrintJobAttribute</a> attributes are specific to a single document in the 
+print job.
+</li>
+</ul>
+
+<h2>Example of using the API</h2>
+<pre>
+import java.io.*;
+<br>
+import javax.print.*;
+import javax.print.attribute.*;
+import javax.print.attribute.standard.*;
+import javax.print.event.*;
+<br>
+public class Beispiel
+{
+  public static void main(String[] args)
+  {
+    // Using the predefined doc flavor for postscript mimetype
+    DocFlavor flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
+<br>
+    // Looking for printservice supporting this doc flavor
+    PrintService[] services = PrintServiceLookup.lookupPrintServices(flavor, null);
+<br>
+    // Just take the first
+    PrintService service = services[0];
+    System.out.println("Name :" + service.getName());
+<br>
+    try
+      {
+        // Create a print job
+        DocPrintJob job = service.createPrintJob();
+<br>
+        // We want to print a file so we construct an inputstream
+        // on the file to supply the print data as given in the doc flavor
+        File file = new File("File.ps");
+        InputStream stream = new FileInputStream(file);
+<br>
+        // Build a attribute set with the wanted printing attributes
+        HashPrintRequestAttributeSet attr = new HashPrintRequestAttributeSet();
+        attr.add(new Copies(2)); // two copies
+        attr.add(new PageRanges(2, 7)); // only the 2-7 pages
+<br>
+        // Construct a doc object with the provided class SimpleDoc
+        SimpleDoc doc = new SimpleDoc(stream, flavor, null);
+<br>
+        // register us as the print - use the adapter class 
+        // and override the interesing failure condition
+        job.addPrintJobListener(new PrintJobAdapter()
+        {
+          public void printJobFailed(PrintJobEvent arg0)
+          {
+            System.out.println("The PrintJob failed.");
+          }
+        });
+<br>
+        // start the printing process
+        job.print(doc, attr);
+<br>
+        // lets assume we want to cancel it
+        if (job instanceof CancelablePrintJob)
+          {
+            CancelablePrintJob cancelJob = (CancelablePrintJob) job;
+            cancelJob.cancel();
+          }
+<br>
+      }
+    catch (PrintException e)
+    {
+      e.printStackTrace();
+    }
+    catch (FileNotFoundException e)
+    {
+      e.printStackTrace();
+    }
+  }
+}
+</pre>
+<p>
+<b>Since:</b> 1.4
+</p>
+</body>
+</html>

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/ClassDesc.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/ClassDesc.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/ClassDesc.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/ClassDesc.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,66 @@
+/* ClassDesc.java --
+   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.rmi.CORBA;
+
+import java.io.Serializable;
+
+/**
+ * This class is used to marshal java.lang.Class objects over IIOP.
+ * When used as a parameter type, return type, or data member, the Java Class
+ * is mapped to the OMG IDL type ::javax::rmi::CORBA::ClassDesc.
+ *
+ * @author Audrius Meskauskas (AudriusA at Bioinformatics.org)
+ */
+public class ClassDesc implements Serializable
+{
+  /** 
+   * Use serialVersionUID (V1.4) for interoperability. 
+   */
+  private static final long serialVersionUID = -3477057297839810709L;
+
+  /**
+   * The class repository Id.
+   */
+  String repid;
+  
+  /**
+   * Space separeted list of URL's from where the code can be downloaded.
+   */
+  String codebase;
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/PortableRemoteObjectDelegate.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/PortableRemoteObjectDelegate.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/PortableRemoteObjectDelegate.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/PortableRemoteObjectDelegate.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,137 @@
+/* PortableRemoteObjectDelegate.java -- Interface supporting PortableRemoteObject
+   Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.rmi.CORBA;
+
+import java.rmi.NoSuchObjectException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * A delegate, implementing the functionality, provided by the
+ * {@link PortableRemoteObject}.
+ * 
+ * The default delegate can be altered by setting the system property
+ * "javax.rmi.CORBA.PortableRemoteObjectClass" to the name of the alternative
+ * class that must implement {@link PortableRemoteObjectDelegate}.
+ * 
+ * @author Audrius Meskauskas (AudriusA at Bioinformatics.org)
+ */
+public interface PortableRemoteObjectDelegate
+{
+  /**
+   * <p>
+   * Makes the remote object <code>target</code> ready for remote
+   * communication using the same communications runtime as for the passed
+   * <code>source</code> parameter. Connection normally happens implicitly
+   * when the object is sent or received as an argument on a remote method call.
+   * </p>
+   * <p>
+   * The target object is connected to the same ORB as source by calling the
+   * {@link Stub#connect} if it is a stub or by associating its tie with an ORB
+   * if it is an implementation object.
+   * </p>
+   * 
+   * @param target the target object that may be either an RMI/IDL stub or an
+   * exported RMI/IDL implementation object
+   * @param source the source object may also be either an RMI/IDL stub or an
+   * exported RMI/IDL implementation object.
+   * 
+   * @throws RemoteException if the target is already connected to another ORB.
+   */
+  void connect(Remote target, Remote source)
+    throws RemoteException;
+
+  /**
+   * Register the passed object with the ORB runtimes, making it remotely
+   * accessible. When called on jre with no objects exported, creates a
+   * non-daemon thread that prevents jre from terminating until all objects are
+   * unexported. Also, such object cannot be collected by garbage collector.
+   * This is usually impemented via {@link Util#unexportObject}
+   * 
+   * @param object the object to export.
+   * 
+   * @throws RemoteException
+   */
+  void exportObject(Remote obj)
+    throws RemoteException;
+
+  /**
+   * Narrows the passed object to conform to the given interface or IDL type.
+   * This method may return different instance and cannot be replaced by the
+   * direct cast.
+   * 
+   * @param narrowFrom an object to narrow.
+   * @param narrowTo a type to that the object must be narrowed.
+   * 
+   * @return On success, an object of type narrowTo or null, if narrowFrom =
+   * null.
+   * 
+   * @throws ClassCastException if no narrowing is possible.
+   */
+  Object narrow(Object narrowFrom, Class narrowTo)
+    throws ClassCastException;
+
+  /**
+   * Takes a server implementation object and returns a stub object that can be
+   * used to access that server object (target). If the target is connected, the
+   * returned stub is also connected to the same ORB. If the target is
+   * unconnected, the returned stub is unconnected.
+   * 
+   * @param target a server side object.
+   * @return a stub object that can be used to access that server object.
+   * 
+   * @throws NoSuchObjectException if a stub cannot be located for the given
+   * target.
+   */
+  Remote toStub(Remote obj)
+    throws NoSuchObjectException;
+
+  /**
+   * Deregister a currently exported server object from the ORB runtimes. The
+   * object to becomes available for garbage collection. This is usually
+   * impemented via {@link Util#unexportObject}
+   * 
+   * @param object the object to unexport.
+   * 
+   * @throws NoSuchObjectException if the passed object is not currently
+   * exported.
+   */
+  void unexportObject(Remote obj)
+    throws NoSuchObjectException;
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/Stub.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/Stub.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/Stub.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/Stub.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,203 @@
+/* Stub.java --
+   Copyright (C) 2004, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.rmi.CORBA;
+
+import gnu.javax.rmi.CORBA.DelegateFactory;
+import gnu.javax.rmi.CORBA.StubDelegateImpl;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.rmi.RemoteException;
+
+import javax.rmi.PortableRemoteObject;
+
+import org.omg.CORBA.ORB;
+import org.omg.CORBA_2_3.portable.ObjectImpl;
+
+/**
+ * A Stub descendants provide access to the object on the client side. This base
+ * class implements methods, required for remote or local invocation using CORBA
+ * mechanisms. The most of the functionality is forwarded to the stub delegate.
+ * This delegate can be altered by setting the system property
+ * "javax.rmi.CORBA.StubClass" to the name of the alternative class that must
+ * implement {@link StubDelegate}. Hence Stub contains two delegates, one for
+ * Stub-related operations and another inherited from the ObjectImpl.
+ * 
+ * @specnote GNU Classpath uses separate delegate per each Stub. The delegate
+ * holds information about the ORB and other data, specific for the each Stub.
+ * 
+ * @author Audrius Meskauskas (AudriusA at Bioinformatics.org)
+ */
+public abstract class Stub
+  extends ObjectImpl
+  implements Serializable
+{
+  /**
+   * For compatability with Sun's JDK 1.4.2 rev. 5
+   */
+  private static final long serialVersionUID = 1087775603798577179L;
+
+  /**
+   * The hashcode, computed once (expensive operation).
+   */
+  transient int m_hash = Integer.MIN_VALUE;
+
+  /**
+   * The stringified reference, computed once (expensive operation).
+   */
+  transient String m_ior;
+
+  /**
+   * The ORB, where the stub is connected on the client side.
+   */
+  transient ORB m_orb;
+
+  /**
+   * The associated delegate, responsible for the major of the functionality of
+   * this stub.
+   */
+  static StubDelegate delegate = (StubDelegate) DelegateFactory.getInstance(DelegateFactory.STUB);
+
+  /**
+   * Returns the same hashcode for all stubs that point to the same remote
+   * object.
+   */
+  public int hashCode()
+  {
+    if (m_hash == Integer.MIN_VALUE)
+      m_hash = delegate.hashCode(this);
+    // This should finally result to the IOR comparison.
+    return m_hash;
+  }
+
+  /**
+   * The stubs are equal if they point to the same remote object.
+   */
+  public boolean equals(java.lang.Object obj)
+  {
+    return delegate.equals(this, obj);
+  }
+
+  /**
+   * Get the string representation of this Stub.
+   * 
+   * @return the CORBA IOR reference.
+   */
+  public String toString()
+  {
+    if (m_ior == null)
+      m_ior = delegate.toString(this);
+    return m_ior;
+  }
+
+  /**
+   * <p>
+   * Finds the suitable {@link Tie} for this Stub and connects it to the given
+   * ORB. The tie is found by the name pattern. If the found tie is derived from
+   * {@link org.omg.CORBA.PortableServer.Servant}, it is connected to the root
+   * POA, also activating it (if not already active).
+   * </p>
+   * <p>
+   * This method does not allow to specify, to which POA the found Tie must be
+   * connected and requires to use the deprecated method {@link ORB#connect}.
+   * Many useful POA features remain unaccessible. A better alternative it might
+   * be to generate a {@link org.omg.CORBA.PortableServer.Servant} - derived Tie
+   * (-poa key in rmic) and connect it to POA in one of the many ways, listed in
+   * the description of the {@link orb.omg.PortableServer} package). The
+   * obtained CORBA object can be narrowed into stub using
+   * {@link PortableRemoteObject#narrow}.
+   * </p>
+   * <p>
+   * It is frequently easier to call {@link PortableRemoteObject#connect} rather
+   * than this method.
+   * </p>
+   * 
+   * @param orb the ORB where the Stub must be connected.
+   * 
+   * @throws RemoteException if the stub is already connected to some other ORB.
+   * If the stub is already connected to the ORB that was passed as parameter,
+   * the method returns without action.
+   * 
+   * @throws BAD_PARAM if the name of this stub does not match the stub name
+   * pattern, "_*_Stub" or if the Tie class, "_*Impl_Tie", does not exists or an
+   * instance of this class cannot be instantiated.
+   */
+  public void connect(ORB orb)
+    throws RemoteException
+  {
+    if (m_orb != null && orb != null)
+      {
+        if (m_orb.equals(orb))
+          throw new RemoteException("Stub " + this
+            + " is connected to another ORB, " + orb);
+        else
+          return;
+      }
+    m_orb = orb;
+    delegate.connect(this, orb);
+  }
+
+  /**
+   * Required by serialized form of Java API doc.
+   */
+  private void readObject(ObjectInputStream input)
+    throws IOException, ClassNotFoundException
+  {
+    if (delegate instanceof StubDelegateImpl)
+      ((StubDelegateImpl) delegate).readObject(this, input, m_orb);
+    else
+      delegate.readObject(this, input);
+  }
+
+  /**
+   * Required by serialized form of Java API doc.
+   */
+  private void writeObject(ObjectOutputStream output)
+    throws IOException
+  {
+    // The m_orb in this case may be either known or not.
+    if (delegate instanceof StubDelegateImpl)
+      ((StubDelegateImpl) delegate).writeObject(this, output, m_orb);
+    else
+
+      delegate.writeObject(this, output);
+  }
+}
\ No newline at end of file

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/StubDelegate.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/StubDelegate.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/StubDelegate.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/StubDelegate.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,103 @@
+/* StubDelegate.java --
+   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.rmi.CORBA;
+
+import org.omg.CORBA.ORB;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import java.rmi.RemoteException;
+
+/**
+ * A delegate, implementing the functionality, provided by the {@link Stub}.
+ * The default delegate can be altered by setting the system property
+ * "javax.rmi.CORBA.StubClass" to the name of the alternative class that must
+ * implement StubDelegate.
+ * 
+ * @author Audrius Meskauskas (AudriusA at Bioinformatics.org)
+ */
+public interface StubDelegate
+{
+  /**
+   * <p>
+   * Makes the stub ready for remote communication using the given ORB.
+   * </p>
+   * <p>
+   * It is frequently easier to call {@link PortableRemoteObject#connect} rather
+   * than this method.
+   * </p>
+   * 
+   * @param orb the ORB where the Stub must be connected.
+   * 
+   * @throws RemoteException if the stub is already connected to some other ORB.
+   * If the stub is already connected to the ORB that was passed as parameter,
+   * the method returns without action.
+   */
+  void connect(Stub self, ORB orb)
+    throws RemoteException;
+
+  /**
+   * The objects stubs are equal if they refer the same remote object.
+   */
+  boolean equals(Stub self, Object obj);
+
+  /**
+   * Get the hashcode fo this delegate.
+   */
+  int hashCode(Stub self);
+
+  /**
+   * Read this stub from the object input stream.
+   */
+  void readObject(Stub self, ObjectInputStream s)
+    throws IOException, ClassNotFoundException;
+
+  /**
+   * Write this stub to the object output stream.
+   */
+  void writeObject(Stub self, ObjectOutputStream s)
+    throws IOException;
+
+  /**
+   * Get the string representation of this stub.
+   */
+  String toString(Stub self);
+}
\ No newline at end of file

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/Tie.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/Tie.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/Tie.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/Tie.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,125 @@
+/* Tie.java --
+   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.rmi.CORBA;
+
+import java.rmi.NoSuchObjectException;
+import java.rmi.Remote;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.portable.InvokeHandler;
+
+/**
+ * <p>
+ * A Tie serves as a CORBA Servant or implementation base. It is connected to
+ * the ORB on a server side, providing the implementation of the required
+ * functionality. ORB access this implementation using {@link InvokeHandler}
+ * ._invoke(..). All such calls are finally delegated to the object, returned by
+ * {@link #getTarget()}.
+ * </p>
+ * <p>
+ * Ties are generated from implementations (name pattern *Impl) and have the
+ * name pattern _*Impl_Tie, for instance:<br>
+ * <code>rmic -keep -iiop -poa -always gnu.testlet.java.rmi.Remote.CalculatorImpl</code>
+ * </p>
+ * <p>
+ * Ties should normally be derived from the
+ * {@link org.omg.PortableServer.Servant}. Such ties are generated by
+ * <code>rmic</code> compiler using <code>-poa</code> key. Ties can be also
+ * derived from {@link org.omg.CORBA_2_3.portable.ObjectImpl}.
+ * </p>
+ * 
+ * @author Audrius Meskauskas (AudriusA at Bioinformatics.org)
+ */
+public interface Tie
+  extends InvokeHandler
+{
+  /**
+   * Get the invocation target, where all method calls should be delegated.
+   * 
+   * @return the object, implementing methods, defined in the interface being
+   * served by this Tie.
+   */
+  Remote getTarget();
+
+  /**
+   * Set the invocation target, where all method calls should be delegated.
+   * 
+   * @param target the object, implementing methods, defined in the interface
+   * being served by this Tie. The code, produced by a typical rmic compiler
+   * usually requires the target to be an instance of the implementation from
+   * that the Tie was generated.
+   * 
+   * @throws ClassCastException if the passed parameter is not an instance of
+   * the implementation from that the Tie was generated.
+   */
+  void setTarget(Remote target);
+
+  /**
+   * Get the ORB to that this Tie is connected.
+   * 
+   * @see org.omg.PortableServer.Servant#_orb
+   */
+  ORB orb();
+
+  /**
+   * Connect this Tie to the given ORB.
+   */
+  void orb(ORB orb);
+
+  /**
+   * Get the object that delegates calls to this tie.
+   * 
+   * @see org.omg.PortableServer.Servant#_this_object
+   */
+  org.omg.CORBA.Object thisObject();
+
+  /**
+   * Deactivate this Tie. The tie is normally deactivated using POA mechanisms.
+   * Depending on the POA policies, it may be possible to activate the Tie
+   * again. The ties that are not derived from
+   * {@link org.omg.PortableServer.Servant} deactivate themselves by
+   * {@link ORB.disconnect}.
+   * 
+   * @throws NoSuchObjectException if there are no objects served by this Tie,
+   * or if the these objects are already deactivated.
+   * 
+   * @see org.omg.PortableServer.POA#deactivate_object
+   */
+  void deactivate()
+    throws NoSuchObjectException;
+
+}
\ No newline at end of file

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/Util.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/Util.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/Util.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/Util.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,416 @@
+/* Util.java --
+   Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.rmi.CORBA;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.COMM_FAILURE;
+import org.omg.CORBA.CompletionStatus;
+import org.omg.CORBA.INVALID_TRANSACTION;
+import org.omg.CORBA.INV_OBJREF;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.NO_PERMISSION;
+import org.omg.CORBA.OBJECT_NOT_EXIST;
+import org.omg.CORBA.OMGVMCID;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.SystemException;
+import org.omg.CORBA.TRANSACTION_REQUIRED;
+import org.omg.CORBA.TRANSACTION_ROLLEDBACK;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.OutputStream;
+
+import gnu.javax.rmi.CORBA.DelegateFactory;
+
+import java.rmi.AccessException;
+import java.rmi.MarshalException;
+import java.rmi.NoSuchObjectException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.ServerError;
+import java.rmi.ServerException;
+import java.rmi.UnexpectedException;
+import java.rmi.server.RMIClassLoader;
+
+import javax.transaction.InvalidTransactionException;
+import javax.transaction.TransactionRequiredException;
+import javax.transaction.TransactionRolledbackException;
+
+/**
+ * Provides utility methods used by stubs and ties to perform common operations.
+ * The functionality is forwarded to the enclosed UtilDelegate. This delegate
+ * can be altered by setting the system property "javax.rmi.CORBA.UtilClass" to
+ * the name of the alternative class that must implement {@link UtilDelegate}.
+ * 
+ * @author Audrius Meskauskas (AudriusA at Bioinformatics.org)
+ */
+public class Util
+{
+  /**
+   * The delegate, responsible for all functionality.
+   */
+  static UtilDelegate delegate = (UtilDelegate) DelegateFactory.getInstance(DelegateFactory.UTIL);
+
+  /**
+   * Prevents this class from being instantiated.
+   */
+  private Util()
+  {
+  }
+
+  /**
+   * Used by local stubs to create a copy of the object. The object must be
+   * Serializable for this operation to succeed. Strings are not copied and
+   * 1D-3D string arrays are only cloned.
+   */
+  public static java.lang.Object copyObject(java.lang.Object object, ORB orb)
+    throws RemoteException
+  {
+    return delegate.copyObject(object, orb);
+  }
+
+  /**
+   * Used by local stubs to create a multiple copies of the object, preserving
+   * sharing accross the parameters if necessary.
+   */
+  public static java.lang.Object[] copyObjects(java.lang.Object[] object,
+    ORB orb)
+    throws RemoteException
+  {
+    return delegate.copyObjects(object, orb);
+  }
+
+  /**
+   * Get the value handler that Serializes Java objects to and from CDR (GIOP)
+   * streams.
+   * 
+   * When using the default Util implementation, the class of the returned
+   * handler can be altered by setting by setting the system property
+   * "javax.rmi.CORBA.ValueHandlerClass" to the name of the alternative class
+   * that must implement {@link ValueHandler}.
+   */
+  public static ValueHandler createValueHandler()
+  {
+    return delegate.createValueHandler();
+  }
+
+  /**
+   * This call is finally delegated to {@link RMIClassLoader#getClassAnnotation};
+   */
+  public static String getCodebase(Class clz)
+  {
+    return delegate.getCodebase(clz);
+  }
+
+  /**
+   * Get the Tie that handles invocations on the given target. If the target/Tie
+   * pair has not been previously registered using {@link #registerTarget},
+   * this method tries to locate a tie class by the name pattern. If this
+   * succeeds, the tie-target pair is also registered.
+   * 
+   * @return the Tie.
+   */
+  public static Tie getTie(Remote target)
+  {
+    return delegate.getTie(target);
+  }
+
+  /**
+   * Checks if the given stub is local. The implementation it delegates call to
+   * {@link ObjectImpl#_is_local().
+   * 
+   * @param stub a stub to check.
+   * @return true if the stub is local, false otherwise.
+   * 
+   * @throws RemoteException if the {@link ObjectImpl#_is_local()} throws a
+   * {@link org.omg.CORBA.SystemException}.
+   */
+  public static boolean isLocal(Stub stub)
+    throws RemoteException
+  {
+    return delegate.isLocal(stub);
+  }
+
+  /**
+   * Load the class. The method uses class loaders from the call stact first. If
+   * this fails, the further behaviour depends on the System Property
+   * "java.rmi.server.useCodebaseOnly" with default value "false".
+   * 
+   * <ul>
+   * <li>If remoteCodebase is non-null and useCodebaseOnly is "false" then call
+   * java.rmi.server.RMIClassLoader.loadClass (remoteCodebase, className)</li>
+   * <li> If remoteCodebase is null or useCodebaseOnly is true then call
+   * java.rmi.server.RMIClassLoader.loadClass(className)</li>
+   * <li>If a class is still not successfully loaded and the loader != null
+   * then try Class.forName(className, false, loader). </li>
+   * </ul>
+   * 
+   * @param className the name of the class.
+   * @param remoteCodebase the codebase.
+   * @param loader the class loader.
+   * @return the loaded class.
+   * 
+   * @throws ClassNotFoundException of the class cannot be loaded.
+   */
+  public static Class loadClass(String className, String remoteCodebase,
+    ClassLoader loader)
+    throws ClassNotFoundException
+  {
+    return delegate.loadClass(className, remoteCodebase, loader);
+  }
+
+  /**
+   * Converts CORBA {@link SystemException} into RMI {@link RemoteException}.
+   * The exception is converted as defined in the following table:
+   * <p>
+   * <table border = "1">
+   * <tr>
+   * <th>CORBA Exception</th>
+   * <th>RMI Exception</th>
+   * </tr>
+   * <tr>
+   * <td>{@link COMM_FAILURE}</td>
+   * <td>{@link MarshalException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link INV_OBJREF}</td>
+   * <td>{@link  NoSuchObjectException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link NO_PERMISSION}</td>
+   * <td>{@link  AccessException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link MARSHAL}</td>
+   * <td>{@link  MarshalException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link BAD_PARAM} (all other cases)</td>
+   * <td>{@link  MarshalException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link OBJECT_NOT_EXIST}</td>
+   * <td>{@link  NoSuchObjectException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link TRANSACTION_REQUIRED}</td>
+   * <td>{@link  TransactionRequiredException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link TRANSACTION_ROLLEDBACK}</td>
+   * <td>{@link  TransactionRolledbackException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link INVALID_TRANSACTION}</td>
+   * <td>{@link  InvalidTransactionException}</td>
+   * </tr>
+   * <tr>
+   * <td bgcolor="lightgray">Any other {@link SystemException}</td>
+   * <td bgcolor="lightgray">{@link RemoteException}</td>
+   * </tr>
+   * </table>
+   * </p>
+   * <p>
+   * The exception detailed message always consists of
+   * <ol>
+   * <li>the string "CORBA "</li>
+   * <li>the CORBA name of the system exception</li>
+   * <li>single space</li>
+   * <li>the hexadecimal value of the system exception's minor code, preceeded
+   * by 0x (higher bits contain {@link OMGVMCID}).</li>
+   * <li>single space</li>
+   * <li>the {@link CompletionStatus} of the exception: "Yes", "No" or "Maybe".</li>
+   * </ol>
+   * The subsequent content is not part of the official RMI-IIOP standart and is
+   * added for compatibility with Sun's implementation:
+   * <ol>
+   * <li>the phrase "<code>; nested exception is: <i>(line feed)(tab)</i></code>"</li>
+   * <li>the full name of the mapped SystemException, as returned by
+   * Class.getName().</li>
+   * <li>the ": ".
+   * <li>the value, returned by .getMessage() of the passed parameter.</li>
+   * </ol>
+   * <p>
+   * For instance, if the Internet connection was refused:
+   * </p><p>
+   * <code>CORBA COMM_FAILURE 0x535500C9 No</code>
+   * </p><p>
+   * The original CORBA exception is set as the cause of the RemoteException
+   * being created.
+   * </p>
+   */
+  public static RemoteException mapSystemException(SystemException ex)
+  {
+    return delegate.mapSystemException(ex);
+  }
+
+  /**
+   * Register the Tie-target pair. As the Tie is a Servant, it can potentially
+   * be connected to several objects and hence may be registered with several
+   * targets.
+   */
+  public static void registerTarget(Tie tie, Remote target)
+  {
+    delegate.registerTarget(tie, target);
+  }
+
+  /**
+   * Deactivate the associated Tie, if it is found and is not connected to other
+   * registered targets. Independing from the POA policies, the transparent
+   * reactivation will not be possible.
+   */
+  public static void unexportObject(Remote target)
+    throws NoSuchObjectException
+  {
+    delegate.unexportObject(target);
+  }
+
+  /**
+   * Converts the exception that was thrown by the implementation method on a
+   * server side into RemoteException that can be transferred and re-thrown on a
+   * client side. The method converts exceptions as defined in the following
+   * table: <table border = "1">
+   * <tr>
+   * <th>Exception to map (or subclass)</th>
+   * <th>Maps into</th>
+   * </tr>
+   * <tr>
+   * <td>{@link Error}</td>
+   * <td>{@link ServerError}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link RemoteException}</td>
+   * <td>{@link ServerException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link SystemException}</td>
+   * <td>wrapException({@link #mapSystemException})</td>
+   * </tr>
+   * <tr>
+   * <td>{@link RuntimeException}</td>
+   * <td><b>rethrows</b></td>
+   * </tr>
+   * <tr>
+   * <td>Any other exception</td>
+   * <td>{@link UnexpectedException}</td>
+   * </tr>
+   * </table>
+   * 
+   * @param ex an exception that was thrown on a server side implementation.
+   * 
+   * @return the corresponding RemoteException unless it is a RuntimeException.
+   * 
+   * @throws RuntimeException the passed exception if it is an instance of
+   * RuntimeException.
+   * 
+   * @specnote It is the same behavior, as in Suns implementations 1.4.0-1.5.0.
+   */
+  public static RemoteException wrapException(Throwable exception)
+  {
+    return delegate.wrapException(exception);
+  }
+
+  /**
+   * Write abstract interface to the CORBA output stream. The write format is
+   * matching CORBA abstract interface. Remotes and CORBA objects are written as
+   * objects, other classes are supposed to be value types and are written as
+   * such. {@link Remote}s are processed as defined in
+   * {@link #writeRemoteObject}. The written data contains discriminator,
+   * defining, that was written. Another method that writes the same content is
+   * {@link org.omg.CORBA_2_3.portable.OutputStream#write_abstract_interface(java.lang.Object)}.
+   * 
+   * @param output a stream to write to, must be
+   * {@link org.omg.CORBA_2_3.portable.OutputStream}.
+   * 
+   * @param object an object to write, must be CORBA object, Remote
+   */
+  public static void writeAbstractObject(OutputStream output,
+    java.lang.Object object)
+  {
+    delegate.writeAbstractObject(output, object);
+  }
+
+  /**
+   * Write the passed java object to the output stream in the form of the CORBA
+   * {@link Any}. This includes creating an writing the object {@link TypeCode}
+   * first. Such Any can be later read by a non-RMI-IIOP CORBA implementation
+   * and manipulated, for instance, by means, provided in
+   * {@link org.omg.DynamicAny.DynAny}. Depending from the passed value, this
+   * method writes CORBA object, value type or value box. For value types Null
+   * is written with the abstract interface, its typecode having repository id
+   * "IDL:omg.org/CORBA/AbstractBase:1.0" and the empty string name.
+   * 
+   * @param output the object to write.
+   * @param object the java object that must be written in the form of the CORBA
+   * {@link Any}.
+   */
+  public static void writeAny(OutputStream output, java.lang.Object object)
+  {
+    delegate.writeAny(output, object);
+  }
+  
+  /**
+   * Read Any from the input stream. 
+   */
+  public static java.lang.Object readAny(InputStream input)
+  {
+    return delegate.readAny(input);
+  }
+
+  /**
+   * Write the passed parameter to the output stream as CORBA object. If the
+   * parameter is an instance of Remote and not an instance of Stub, the method
+   * instantiates a suitable Tie, connects the parameter to this Tie and then
+   * connects that Tie to the ORB that is requested from the output stream. Then
+   * the object reference is written to the stream, making remote invocations
+   * possible (the ORB is started and activated, if required). This method is
+   * used in write_value(..) method group in
+   * {@link org.omg.CORBA_2_3.portable.OutputStream} and also may be called
+   * directly from generated Stubs and Ties.
+   * 
+   * @param output a stream to write to, must be
+   * org.omg.CORBA_2_3.portable.OutputStream
+   * @param object an object to write.
+   */
+  public static void writeRemoteObject(OutputStream output,
+    java.lang.Object object)
+  {
+    delegate.writeRemoteObject(output, object);
+  }
+}
\ No newline at end of file

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/UtilDelegate.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/UtilDelegate.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/UtilDelegate.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/UtilDelegate.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,310 @@
+/* UtilDelegate.java --
+   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.rmi.CORBA;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.COMM_FAILURE;
+import org.omg.CORBA.CompletionStatus;
+import org.omg.CORBA.INVALID_TRANSACTION;
+import org.omg.CORBA.INV_OBJREF;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.NO_PERMISSION;
+import org.omg.CORBA.OBJECT_NOT_EXIST;
+import org.omg.CORBA.OMGVMCID;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.SystemException;
+import org.omg.CORBA.TRANSACTION_REQUIRED;
+import org.omg.CORBA.TRANSACTION_ROLLEDBACK;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.OutputStream;
+
+import java.rmi.AccessException;
+import java.rmi.MarshalException;
+import java.rmi.NoSuchObjectException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.ServerError;
+import java.rmi.ServerException;
+import java.rmi.UnexpectedException;
+
+import javax.transaction.InvalidTransactionException;
+import javax.transaction.TransactionRequiredException;
+import javax.transaction.TransactionRolledbackException;
+
+/**
+ * A delegate, implementing the functionality, provided by the {@link Util}.
+ * 
+ * The default delegate can be altered by setting the system property
+ * "javax.rmi.CORBA.UtilClass" to the name of the alternative class that must
+ * implement this interface.
+ * 
+ * @author Audrius Meskauskas (AudriusA at Bioinformatics.org)
+ */
+public interface UtilDelegate
+{
+  /**
+   * Used by local stubs to create a copy of the object.
+   */
+  Object copyObject(Object obj, ORB orb)
+    throws RemoteException;
+
+  /**
+   * Used by local stubs to create a multiple copies of the object, preserving
+   * sharing accross the parameters if necessary.
+   */
+  Object[] copyObjects(Object[] obj, ORB orb)
+    throws RemoteException;
+
+  /**
+   * Get the value handler that Serializes Java objects to and from CDR (GIOP)
+   * streams.
+   */
+  ValueHandler createValueHandler();
+
+  String getCodebase(Class clz);
+
+  /**
+   * Checks if the given stub is local.
+   */
+  boolean isLocal(Stub stub)
+    throws RemoteException;
+
+  Class loadClass(String className, String remoteCodebase, ClassLoader loader)
+    throws ClassNotFoundException;
+
+  /**
+   * Converts CORBA {@link SystemException} into RMI {@link RemoteException}.
+   * The exception is converted as defined in the following table:
+   * <p>
+   * <table border = "1">
+   * <tr>
+   * <th>CORBA Exception</th>
+   * <th>RMI Exception</th>
+   * </tr>
+   * <tr>
+   * <td>{@link COMM_FAILURE}</td>
+   * <td>{@link MarshalException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link INV_OBJREF}</td>
+   * <td>{@link  NoSuchObjectException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link NO_PERMISSION}</td>
+   * <td>{@link  AccessException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link MARSHAL}</td>
+   * <td>{@link  MarshalException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link BAD_PARAM} (all other cases)</td>
+   * <td>{@link  MarshalException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link OBJECT_NOT_EXIST}</td>
+   * <td>{@link  NoSuchObjectException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link TRANSACTION_REQUIRED}</td>
+   * <td>{@link  TransactionRequiredException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link TRANSACTION_ROLLEDBACK}</td>
+   * <td>{@link  TransactionRolledbackException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link INVALID_TRANSACTION}</td>
+   * <td>{@link  InvalidTransactionException}</td>
+   * </tr>
+   * <tr>
+   * <td bgcolor="lightgray">Any other {@link SystemException}</td>
+   * <td bgcolor="lightgray">{@link RemoteException}</td>
+   * </tr>
+   * </table>
+   * </p>
+   * <p>
+   * The exception detailed message always consists of
+   * <ol>
+   * <li>the string "CORBA "</li>
+   * <li>the CORBA name of the system exception</li>
+   * <li>single space</li>
+   * <li>the hexadecimal value of the system exception's minor code, preceeded
+   * by 0x (higher bits contain {@link OMGVMCID}).</li>
+   * <li>single space</li>
+   * <li>the {@link CompletionStatus} of the exception: "Yes", "No" or "Maybe".</li>
+   * </ol>
+   * The subsequent content is not part of the official RMI-IIOP standart and is
+   * added for compatibility with Sun's implementation:
+   * <ol>
+   * <li>the phrase "<code>; nested exception is: <i>(line feed)(tab)</i></code>"</li>
+   * <li>the full name of the mapped SystemException, as returned by
+   * Class.getName().</li>
+   * <li>the ": ".
+   * <li>the value, returned by .getMessage() of the passed parameter.</li>
+   * </ol>
+   * <p>
+   * For instance, if the Internet connection was refused:
+   * </p><p>
+   * <code>CORBA COMM_FAILURE 0x535500C9 No</code>
+   * </p><p>
+   * The original CORBA exception is set as the cause of the RemoteException
+   * being created.
+   * </p>
+   */
+  RemoteException mapSystemException(SystemException ex);
+
+  /**
+   * Get the Tie that handles invocations on the given target. The target/Tie
+   * pair must be previously registered using {@link #registerTarget}.
+   * 
+   * @return the Tie, or null if no such is known.
+   */
+  Tie getTie(Remote target);
+
+  /**
+   * Register the Tie-target pair.
+   */
+  void registerTarget(Tie tie, Remote target);
+
+  /**
+   * Deactivate the associated Tie, if it is found and is not connected to other
+   * registered targets.
+   */
+  void unexportObject(Remote target)
+    throws NoSuchObjectException;
+
+  /**
+   * Converts the exception that was thrown by the implementation method on a
+   * server side into RemoteException that can be transferred and re-thrown on a
+   * client side. The method converts exceptions as defined in the following
+   * table: <table border = "1">
+   * <tr>
+   * <th>Exception to map (or subclass)</th>
+   * <th>Maps into</th>
+   * </tr>
+   * <tr>
+   * <td>{@link Error}</td>
+   * <td>{@link ServerError}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link RemoteException}</td>
+   * <td>{@link ServerException}</td>
+   * </tr>
+   * <tr>
+   * <td>{@link SystemException}</td>
+   * <td>wrapException({@link #mapSystemException})</td>
+   * </tr>
+   * <tr>
+   * <td>{@link RuntimeException}</td>
+   * <td><b>rethrows</b></td>
+   * </tr>
+   * <tr>
+   * <td>Any other exception</td>
+   * <td>{@link UnexpectedException}</td>
+   * </tr>
+   * </table>
+   * 
+   * @param ex an exception that was thrown on a server side implementation.
+   * 
+   * @return the corresponding RemoteException unless it is a RuntimeException.
+   * 
+   * @throws RuntimeException the passed exception if it is an instance of
+   * RuntimeException.
+   * 
+   * @specnote It is the same behavior, as in Suns implementations 1.4.0-1.5.0.
+   */
+  RemoteException wrapException(Throwable orig);
+
+  /**
+   * Write the passed parameter to the output stream as CORBA object. If the
+   * parameter is an instance of Remote and not an instance of Stub, the method
+   * instantiates a suitable Tie, connects the parameter to this Tie and then
+   * connects that Tie to the ORB that is requested from the output stream. Then
+   * the object reference is written to the stream, making remote invocations
+   * possible. This method is used in write_value(..) method group in
+   * {@link org.omg.CORBA_2_3.portable.OutputStream} and also may be called
+   * directly from generated Stubs and Ties.
+   * 
+   * @param output a stream to write to, must be
+   * org.omg.CORBA_2_3.portable.OutputStream
+   * @param object an object to write.
+   */
+  void writeRemoteObject(OutputStream output, Object obj);
+
+  /**
+   * Write abstract interface to the CORBA output stream. The write format is
+   * matching CORBA abstract interface. Remotes and CORBA objects are written as
+   * objects, other classes are supposed to be value types and are written as
+   * such. {@link Remote}s are processed as defined in
+   * {@link #writeRemoteObject}. The written data contains discriminator,
+   * defining, that was written. Another method that writes the same content is
+   * {@link org.omg.CORBA_2_3.portable.OutputStream#write_abstract_interface(java.lang.Object)}.
+   * 
+   * @param output a stream to write to, must be
+   * {@link org.omg.CORBA_2_3.portable.OutputStream}.
+   * 
+   * @param object an object to write, must be CORBA object, Remote
+   */
+  void writeAbstractObject(OutputStream output, Object object);
+
+  /**
+   * Write the passed java object to the output stream in the form of the CORBA
+   * {@link Any}. This includes creating an writing the object {@link TypeCode}
+   * first. Such Any can be later read by a non-RMI-IIOP CORBA implementation
+   * and manipulated, for instance, by means, provided in
+   * {@link org.omg.DynamicAny.DynAny}. Depending from the passed value, this
+   * method writes CORBA object, value type or value box. For value types Null
+   * is written with the abstract interface, its typecode having repository id
+   * "IDL:omg.org/CORBA/AbstractBase:1.0" and the empty string name.
+   * 
+   * @param output the object to write.
+   * @param object the java object that must be written in the form of the CORBA
+   * {@link Any}.
+   */
+  void writeAny(OutputStream output, Object object);
+
+  /**
+   * Read Any from the input stream. 
+   */
+  Object readAny(InputStream input);
+
+}
\ No newline at end of file

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/ValueHandler.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/ValueHandler.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/ValueHandler.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/ValueHandler.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,130 @@
+/* ValueHandler.java --
+   Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.rmi.CORBA;
+
+import java.io.Serializable;
+
+import org.omg.CORBA.CustomMarshal;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
+import org.omg.SendingContext.RunTime;
+
+/**
+ * Serializes Java objects to and from CDR (GIOP) streams. The working instance
+ * of the value handler is returned by {@link Util#createValueHandler} and can
+ * be altered by setting the system property "javax.rmi.CORBA.ValueHandlerClass"
+ * to the name of the alternative class that must implement ValueHandler.
+ * 
+ * @author Audrius Meskauskas (AudriusA at Bioinformatics.org)
+ */
+public interface ValueHandler
+{
+  /**
+   * Get CORBA repository Id for the given java class.
+   * 
+   * The syntax of the repository ID is the initial ?RMI:?, followed by the Java
+   * class name, followed by name, followed by a hash code string, followed
+   * optionally by a serialization version UID string.
+   * 
+   * For Java identifiers that contain illegal OMG IDL identifier characters
+   * such as ?$?, any such illegal characters are replaced by ?\U? followed by
+   * the 4 hexadecimal characters (in upper case) representing the Unicode
+   * value.
+   * 
+   * @param clz a class for that the repository Id is required.
+   * 
+   * @return the class repository id.
+   */
+  String getRMIRepositoryID(Class clz);
+
+  /**
+   * Returns the CodeBase for this ValueHandler.
+   * 
+   * @return the codebase.
+   */
+  RunTime getRunTimeCodeBase();
+
+  /**
+   * Indicates that the given class is responsible itself for writing its
+   * content to the stream. Such classes implement either {@link Streamable}
+   * (default marshalling, generated by IDL-to-java compiler) or
+   * {@link CustomMarshal} (the user-programmed marshalling).
+   * 
+   * @param clz the class being checked.
+   * @return true if the class supports custom or default marshalling, false
+   * otherwise.
+   */
+  boolean isCustomMarshaled(Class clz);
+
+  /**
+   * Read value from the CORBA input stream in the case when the value is not
+   * Streamable or CustomMarshall'ed. The fields of the class being written will
+   * be accessed using reflection.
+   * 
+   * @param in a CORBA stream to read.
+   * @param offset the current position in the input stream.
+   * @param clz the type of value being read.
+   * @param repositoryID the repository Id of the value being read.
+   * @param sender the sending context that should provide data about the
+   * message originator.
+   * 
+   * @return the object, extracted from the stream.
+   */
+  Serializable readValue(InputStream in, int offset, Class clz,
+    String repositoryID, RunTime sender);
+
+  /**
+   * When the value provides the writeReplace method, the result of this method
+   * is written. Otherwise, the value itself is written.
+   * 
+   * @param the value that should be written to the stream.
+   * 
+   * @return the value that will be actually written to the stream.
+   */
+  Serializable writeReplace(Serializable value);
+
+  /**
+   * Write value to CORBA output stream using java senmatics.
+   * 
+   * @param out a stream to write into.
+   * @param value a java object to write.
+   */
+  void writeValue(OutputStream out, Serializable value);
+}
\ No newline at end of file

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/ValueHandlerMultiFormat.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/ValueHandlerMultiFormat.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/ValueHandlerMultiFormat.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/ValueHandlerMultiFormat.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,94 @@
+/* ValueHandlerMultiFormat.java --
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.rmi.CORBA;
+
+import org.omg.CORBA.portable.OutputStream;
+
+import java.io.Serializable;
+
+/**
+ * This interface extends the previous ValueHandler, supporting various stream
+ * format versions. The {@link ValueHandler} can be casted into this interface
+ * to access additional features.
+ * 
+ * @since 1.5
+ * 
+ * @author Audrius Meskauskas, Lithuania (AudriusA at Bioinformatics.org)
+ */
+public interface ValueHandlerMultiFormat
+  extends ValueHandler
+{
+  /**
+   * Get the maximal supported version for the value types, supported by
+   * this value handler. The versions are integer numbers, the currently valid
+   * values being 1 and 2.
+   * 
+   * These two versions differ in how the additional data, stored by the
+   * writeObject method, are encoded.
+   * <ul>
+   * <li> For version 1 (GNU Classpath default), that data (if present) are
+   * written "as is". </li>
+   * <li>For version 2, this data fragment is enclosed within a CDR custom
+   * valuetype with no codebase and repository Id "RMI:org.omg.custom.<class>"
+   * where <class> is the fully-qualified name of the class whose writeObject
+   * method is being invoked. If the object does not write any data via
+   * writeObject method, the null valuetype (0x0) must be written.</li>
+   * </ul>
+   * As the version number is part of the value type record, there is no need
+   * to the format control during the reading.
+   * 
+   * @return the maximal supported version.
+   */
+  byte getMaximumStreamFormatVersion();
+
+  /**
+   * Write the value type to the output stream using the given format version.
+   * The older method {@link ValueHandler#writeValue} always uses the version 1.
+   * 
+   * @param output the stream, where the value should be written, must implement
+   * {@link ValueOutputStream}.
+   * @param value the value that should be written.
+   * @param version the version of the format that must be used to write the
+   * value.
+   * 
+   * @throws BAD_PARAM if the version number is less than 1 or greater than the
+   * maximal supported version.
+   */
+  void writeValue(OutputStream output, Serializable value, byte version);
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/package.html
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/package.html?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/package.html (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/CORBA/package.html Thu Nov  8 16:56:19 2007
@@ -0,0 +1,76 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.rmi package.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.rmi.CORBA</title></head>
+
+<body>
+<p>
+Java RMI over IIOP combines RMI technology with CORBA technology. Like plain RMI,
+RMI over IIOP allows to work completely in the Java programming language 
+(no IDL). When CORBA needs a separate helper class for each structure being
+passed, RMI over IIOP only needs stubs and ties for the objects that are remotely
+accessible. As a result, development with RMI-IIOP is easier. However the 
+specialised pure CORBA helpers needs no reflection to transfer they structures 
+and hence may be faster than methods, used by both RMI-IIOP and plain RMI.
+</p><p>
+Like RMI, RMI over IIOP provides flexibility by allowing to pass any serializable
+Java object (Objects By Value) between application components. A certain
+"imaginary IDL" is automatically supposed; this IDL can be explicitly generated
+and later used to interoperate with non-java application.
+</p><p>
+Like CORBA, RMI over IIOP is based on open standards defined with the 
+participation of hundredsof vendors and users in the OMG. It uses IIOP 
+communication protocol that provides much better interoperability with other 
+programming languages.
+</p><p>
+With RMI/IIOP you can use advanced CORBA features: multiple objects per servant
+and servants per object, servant activators and locators, servant, client and
+ior interceptors, CORBA naming service, various ORB policies, stringified object
+references and so on. This functionality is based on CORBA value type standard.
+RMI/IIOP supports (and GNU Classpath implements) transferring of the arbitrary 
+connected object graphs (graph flattenning).
+</p><p>
+GNU Classpath RMI-IIOP functionality is implemented as described in
+OMG formal/03-09-04 (IDL to Java mapping v1.3). Value types are written as 
+described in formal/04-03-12 (CORBA 3.0.3).
+</p>
+ at author Wu Gansha (gansha.wu at intel.com), headers.
+ at author Audrius Meskauskas (AudriusA at Bioinformatics.org), implementation.
+</body>
+</html>

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/PortableRemoteObject.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/PortableRemoteObject.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/PortableRemoteObject.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/PortableRemoteObject.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,228 @@
+/* PortableRemoteObject.java --
+   Copyright (C) 2004, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.rmi;
+
+import gnu.javax.rmi.CORBA.DelegateFactory;
+
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.portable.ObjectImpl;
+import org.omg.PortableServer.POA;
+import org.omg.PortableServer.Servant;
+
+import java.rmi.NoSuchObjectException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import javax.rmi.CORBA.PortableRemoteObjectDelegate;
+import javax.rmi.CORBA.Stub;
+import javax.rmi.CORBA.Tie;
+import javax.rmi.CORBA.Util;
+
+/**
+ * <p>
+ * An utility class for RMI/IDL server side object implementations. Server side
+ * implementation objects may inherit from this class, but this is not
+ * mandatory, as the needed methds are static. Server side implementations may
+ * choose to inherit from {@link ObjectImpl} or {@link Servant} instead.
+ * </p>
+ * <p>
+ * The functionality of methods in this class is forwarded to the enclosed
+ * PortableRemoteObjectDelegate. This delegate can be altered by setting the
+ * system property "javax.rmi.CORBA.PortableRemoteObjectClass" to the name of
+ * the alternative class that must implement
+ * {@link PortableRemoteObjectDelegate}.
+ * </p>
+ * 
+ * @author Audrius Meskauskas (AudriusA at Bioinformatics.org)
+ */
+public class PortableRemoteObject
+{
+  /**
+   * A delegate where the functionality is forwarded.
+   */
+  static PortableRemoteObjectDelegate delegate = (PortableRemoteObjectDelegate) DelegateFactory.getInstance(DelegateFactory.PORTABLE_REMOTE_OBJECT);
+
+  /**
+   * The protected constructor calls {@link exportObject} (this).
+   * 
+   * @throws RemoteException if the exportObject(this) throws one.
+   */
+  protected PortableRemoteObject()
+    throws RemoteException
+  {
+    exportObject((Remote) this);
+  }
+
+  /**
+   * <p>
+   * Makes the remote object <code>a_target</code> ready for remote
+   * communication using the same communications runtime as for the passed
+   * <code>a_source</code> parameter. The a_target is connected to the same
+   * ORB (and, if applicable, to the same {@link POA}) as the a_source.
+   * 
+   * @param a_target the target to connect to ORB, must be an instance of either
+   * {@link ObjectImpl} (Stubs and old-style ties) or {@link Tie}.
+   * 
+   * @param a_source the object, providing the connection information, must be
+   * an instance of either {@link ObjectImpl} (Stubs and old-style ties) or
+   * {@link Servant} (the next-generation Ties supporting {@link POA}).
+   * 
+   * @throws RemoteException if the target is already connected to another ORB.
+   */
+  public static void connect(Remote target, Remote source)
+    throws RemoteException
+  {
+    delegate.connect(target, source);
+  }
+
+  /**
+   * <p>
+   * Makes a server object ready for remote calls. The subclasses of
+   * PortableRemoteObject do not need to call this method, as it is called by
+   * the constructor.
+   * </p>
+   * <p>
+   * This method only creates a tie object and caches it for future usage. The
+   * created tie does not have a delegate or an ORB associated.
+   * </p>
+   * 
+   * @param object the object to export.
+   * 
+   * @throws RemoteException if export fails due any reason.
+   */
+  public static void exportObject(Remote object)
+    throws RemoteException
+  {
+    delegate.exportObject(object);
+  }
+
+  /**
+   * Narrows the passed object to conform to the given interface or IDL type. In
+   * RMI-IIOP, this method replaces the narrow(org.omg.CORBA.Object) method that
+   * was present in the CORBA Helpers. This method frequently returns different
+   * instance and cannot be replaced by the direct cast. The typical narrowing
+   * cases (all supported by GNU Classpath) are:
+   * <ul>
+   * <li>A CORBA object (for instance, returned by the
+   * {@link ORB#string_to_object} or from the naming service) can be narrowed
+   * into interface, derived from Remote. The method will try to locate an
+   * appropriate {@link Stub} by the name pattern (_*_Stub). If the object being
+   * narrowed is connected to an ORB, the returned instance will inherit that
+   * connection, representing the same remote (or local) object, but now with
+   * the possibility to invoke remote methods. </li>
+   * <li>A CORBA object may be directly narrowed into the appropriate
+   * {@link Stub} class, if it is and passed as a second parameter. This allows
+   * to use non-standard stubs without parameterless constructors.</li>
+   * <li>Any two classes, derived from the {@link ObjectImpl} (may be Stub's)
+   * can be narrowed one into another (a delegate is transferred). </li>
+   * <li>An implementation of Remote can be narrowed into {@link Tie} that can
+   * later connected to an ORB, making the methods accessible remotely. The
+   * Remote being narrowed normally provides a local implementation, but you can
+   * also narrow remote Stub, creating "forwarding Tie".</li>
+   * <li>null is narrowed into null regardless of the second parameter.</li>
+   * <li>A {@link Tie} can be narrowed into Remote, representing the
+   * implementation for this Tie (if one is set).</li>
+   * </ul>
+   * 
+   * @param object the object like CORBA Object, Stub or Remote that must be
+   * narrowed to the given interface.
+   * 
+   * @param narrowToInstaceOf the class of the interface to that the object must
+   * be narrowed.
+   * 
+   * @return On success, an object of type narrowTo or null, if narrowFrom =
+   * null.
+   * 
+   * @throws ClassCastException if no narrowing is possible.
+   */
+  public static Object narrow(Object object, Class narrowToInstaceOf)
+    throws ClassCastException
+  {
+    return delegate.narrow(object, narrowToInstaceOf);
+  }
+
+  /**
+   * <p>
+   * Takes a server implementation object (name pattern *imp) and returns a stub
+   * object that can be used to access that server object (target), name
+   * (pattern _*_Stub).
+   * 
+   * The returned stub is not connected to any ORB and must be explicitly
+   * connected using {@link #connect}.
+   * </p>
+   * <p>
+   * The method signature prevents it from returning stubs that does not
+   * implement Remote (ClassCastException will be thrown).
+   * </p>
+   * 
+   * @param target a server side object implementation.
+   * @return a stub object that can be used to access that server object.
+   * 
+   * @throws NoSuchObjectException if a stub class cannot be located by supposed
+   * name pattern, or an instance of stub fails to be instantiated.
+   * 
+   * @throws ClassCastException if the stub class can be located, but it does
+   * not inherit from Remote.
+   * 
+   * @throws BAD_PARAM if the name of the passed class does not match the
+   * implementation name pattern (does not end by 'Impl').
+   */
+  public static Remote toStub(Remote targetImpl)
+    throws NoSuchObjectException
+  {
+    return delegate.toStub(targetImpl);
+  }
+
+  /**
+   * Deregister a currently exported server object from the ORB runtimes. The
+   * object to becomes available for garbage collection. This is usually
+   * impemented via {@link Util#unexportObject}
+   * 
+   * @param object the object to unexport.
+   * 
+   * @throws NoSuchObjectException if the passed object is not currently
+   * exported.
+   */
+  public static void unexportObject(Remote object)
+    throws NoSuchObjectException
+  {
+    delegate.unexportObject(object);
+  }
+}
\ No newline at end of file

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/package.html
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/package.html?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/package.html (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/package.html Thu Nov  8 16:56:19 2007
@@ -0,0 +1,76 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.rmi package.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.rmi.CORBA</title></head>
+
+<body>
+<p>
+Java RMI over IIOP combines RMI technology with CORBA technology. Like plain RMI,
+RMI over IIOP allows to work completely in the Java programming language 
+(no IDL). When CORBA needs a separate helper class for each structure being
+passed, RMI over IIOP only needs stubs and ties for the objects that are remotely
+accessible. As a result, development with RMI-IIOP is easier. However the 
+specialised pure CORBA helpers needs no reflection to transfer they structures 
+and hence may be faster than methods, used by both RMI-IIOP and plain RMI.
+</p><p>
+Like RMI, RMI over IIOP provides flexibility by allowing to pass any serializable
+Java object (Objects By Value) between application components. A certain
+"imaginary IDL" is automatically supposed; this IDL can be explicitly generated
+and later used to interoperate with non-java application.
+</p><p>
+Like CORBA, RMI over IIOP is based on open standards defined with the 
+participation of hundredsof vendors and users in the OMG. It uses IIOP 
+communication protocol that provides much better interoperability with other 
+programming languages.
+</p><p>
+With RMI/IIOP you can use advanced CORBA features: multiple objects per servant
+and servants per object, servant activators and locators, servant, client and
+ior interceptors, CORBA naming service, various ORB policies, stringified object
+references and so on. This functionality is based on CORBA value type standard.
+RMI/IIOP supports (and GNU Classpath implements) transferring of the arbitrary 
+connected object graphs (graph flattenning).
+</p><p>
+GNU Classpath RMI-IIOP functionality is implemented as described in
+OMG formal/03-09-04 (IDL to Java mapping v1.3). Value types are written as 
+described in formal/04-03-12 (CORBA 3.0.3).
+</p>
+ at author Wu Gansha (gansha.wu at intel.com), headers.
+ at author Audrius Meskauskas (AudriusA at Bioinformatics.org), implementation.
+</body>
+</html>

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/ssl/SslRMIClientSocketFactory.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/ssl/SslRMIClientSocketFactory.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/ssl/SslRMIClientSocketFactory.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/ssl/SslRMIClientSocketFactory.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,166 @@
+/* SslRMIClientSocketFactory.java -- 
+   Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.rmi.ssl;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import java.util.StringTokenizer;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.SSLSocket;
+import java.net.Socket;
+import java.rmi.server.RMIClientSocketFactory;
+
+/**
+ * SslRMIClientSocketFactory
+ *
+ * This class implements an RMIClientSocketFactory for SSL sockets.
+ * it uses the defeult SSLClientSocketFactory.
+ *
+ * This class can optionally use the following system properties, if set: 
+ * <code>javax.rmi.ssl.client.enabledCipherSuites</code>
+ * <code>javax.rmi.ssl.client.enabledProtocols</code>
+ *
+ * These properties will specify a list of SSL/TLS cipher suites and protocols,
+ * respectively, to enable on the created sockets. 
+ *
+ * Both properties should consist of a comma-separated list.
+ *
+ * @author Sven de Marothy
+ * @since 1.5
+ */
+public class SslRMIClientSocketFactory 
+  implements RMIClientSocketFactory, Serializable
+{
+
+  /**
+   * Compatible with JDK 1.5
+   */
+  private static final long serialVersionUID = -8310631444933958385L;
+
+  private String[] enabledCipherSuites, enabledProtocols;
+
+  /**
+   * The SSL Socket factory.
+   */
+  private static SSLSocketFactory socketFactory = 
+    (SSLSocketFactory)SSLSocketFactory.getDefault();
+
+  /**
+   * Creates a new SslRMIClientSocketFactory 
+   */
+  public SslRMIClientSocketFactory()
+  {
+    enabledCipherSuites = getProp("javax.rmi.ssl.client.enabledCipherSuites");
+    enabledProtocols = getProp("javax.rmi.ssl.client.enabledProtocols");
+  }
+
+  private String[] getProp(String p)
+  {
+    StringTokenizer st;
+    try
+      {
+	String o = (String)System.getProperty( p );
+	st = new StringTokenizer( o, "," );
+      }
+    catch(SecurityException se)
+      {
+	return null;
+      }
+
+    int n = st.countTokens();
+    if( n < 1 )
+      return null;
+    String[] strs = new String[ n ];
+    for( int i = 0; i < n; i++ )
+      strs[i] = st.nextToken().trim();
+
+    return strs;
+  }
+
+  /**
+   * Creates an SSLSocket on a given port 
+   *
+   * @throws IOException if an error occurs on socket creation.
+   */
+  public Socket createSocket(String host, int port) throws IOException
+  {
+    SSLSocket socket = (SSLSocket)socketFactory.
+      createSocket( host, port );
+    if( enabledCipherSuites != null )
+      socket.setEnabledCipherSuites( enabledCipherSuites );
+    if( enabledProtocols != null )
+      socket.setEnabledProtocols( enabledProtocols );
+    return socket;
+  }
+
+  /**
+   * Compare two SslRMIServerSocketFactor instances
+   */ 
+  public boolean equals(Object obj)
+  {
+    if( !(obj instanceof SslRMIClientSocketFactory) )
+      return false;
+    SslRMIClientSocketFactory s = (SslRMIClientSocketFactory)obj;
+    
+    if(!SslRMIServerSocketFactory.
+       cmpStrArray(enabledCipherSuites, s.enabledCipherSuites))
+      return false;
+
+    if(!SslRMIServerSocketFactory.
+       cmpStrArray(enabledProtocols, s.enabledProtocols))
+      return false;
+
+    return true;
+  }
+
+  /**
+   * Returns the hash code of this object.
+   */
+  public int hashCode()
+  {
+    int hash = 0;
+    if( enabledCipherSuites != null )
+      for(int i = 0; i < enabledCipherSuites.length; i++ )
+	hash = hash ^ enabledCipherSuites[i].hashCode();
+    if( enabledProtocols != null )
+      for(int i = 0; i < enabledProtocols.length; i++ )
+	hash = hash ^ enabledProtocols[i].hashCode();
+    return hash;
+ }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/ssl/SslRMIServerSocketFactory.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/ssl/SslRMIServerSocketFactory.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/ssl/SslRMIServerSocketFactory.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/rmi/ssl/SslRMIServerSocketFactory.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,213 @@
+/* SslRMIServerSocketFactory.java -- 
+   Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.rmi.ssl;
+
+import java.io.IOException;
+import javax.net.ssl.SSLServerSocketFactory;
+import javax.net.ssl.SSLServerSocket;
+import java.net.ServerSocket;
+import java.rmi.server.RMIServerSocketFactory;
+
+/**
+ * SslRMIServerSocketFactory
+ *
+ * This class implements an RMIServerSocketFactory for SSL sockets.
+ * it uses the defeult SSLServerSocketFactory.
+ *
+ * @author Sven de Marothy
+ * @since 1.5
+ */
+public class SslRMIServerSocketFactory implements RMIServerSocketFactory
+{
+  private String[] enabledCipherSuites, enabledProtocols;
+  private boolean needClientAuth;
+
+  /**
+   * The SSL ServerSocket factory.
+   */
+  private static SSLServerSocketFactory socketFactory = 
+    (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
+
+  /**
+   * Creates a new SslRMIServerSocketFactory with the default socket
+   * cipher suites and protocols, and without requiring client authorisation.
+   */
+  public SslRMIServerSocketFactory()
+  {
+    enabledCipherSuites = enabledProtocols = null;
+    needClientAuth = false;
+  }
+
+  /**
+   * Creates a new SslRMIServerSocketFactory with a given set of socket
+   * cipher suites and protocols. needClientAuth specifies if client
+   * authorization is required.
+   *
+   * @param enabledCipherSuites - the cypher suites to enable
+   * or <code>null</code> for the defauls.
+   * @param enabledCipherSuites - the protocols to enable, 
+   * or <code>null</code> for the defauls.
+   * @param needClientAuth - specify client authorization requirement.
+   * @throws IllegalArgumentException if any of the ciphers or protocols
+   *  specified are not available.
+   */
+  public SslRMIServerSocketFactory(String[] enabledCipherSuites, 
+				   String[] enabledProtocols, 
+				   boolean needClientAuth)
+  {
+    this.enabledCipherSuites = enabledCipherSuites;
+    this.enabledProtocols = enabledProtocols; 
+    this.needClientAuth = needClientAuth;
+    try 
+      {
+	if( enabledProtocols != null || enabledCipherSuites != null )
+	  createServerSocket( 0 ); // stupid way to test the parameters  
+      }
+    catch(IOException e)
+      {
+	// Can this happen? FIXME.
+	throw new IllegalArgumentException();
+      }
+  }
+
+  /**
+   * Creates an SSLServerSocket on a given port 
+   *
+   * @throws IOException if an error occurs on socket creation.
+   */
+  public ServerSocket createServerSocket(int port) throws IOException
+  {
+    SSLServerSocket socket = (SSLServerSocket)socketFactory.
+      createServerSocket( port );
+    if( enabledCipherSuites != null )
+      socket.setEnabledCipherSuites( enabledCipherSuites );
+    if( enabledProtocols != null )
+      socket.setEnabledProtocols( enabledProtocols );
+    socket.setNeedClientAuth( needClientAuth );
+    return socket;
+  }
+
+  /**
+   * Compare two SslRMIServerSocketFactor instances
+   */ 
+  public boolean equals(Object obj)
+  {
+    if( !(obj instanceof SslRMIServerSocketFactory) )
+      return false;
+    SslRMIServerSocketFactory s = (SslRMIServerSocketFactory)obj;
+    if( needClientAuth != s.needClientAuth )
+      return false;
+    
+    if(!cmpStrArray(enabledCipherSuites, s.enabledCipherSuites))
+      return false;
+
+    if(!cmpStrArray(enabledProtocols, s.enabledProtocols))
+      return false;
+
+    return true;
+  }
+
+  /**
+   * Compare two string arrays.
+   */
+  static boolean cmpStrArray(String[] a, String[] b)
+  {
+    if( ( a == null || b == null ) && a != b )
+      return false;
+
+    if( a != null )
+      {
+	if( a.length != b.length )
+	  return false;
+	for( int i = 0; i < a.length; i++ )
+	  if(!a[i].equals(b[i]))
+	    return false;
+      }
+
+    return true;
+  }
+
+  /**
+   * Returns the enabled cipher suites, or <code>null</code> 
+   * if the defaults are to be used.
+   * @returns a string array of cipher suite names
+   */
+  public String[] getEnabledCipherSuites()
+  {  
+    if( enabledCipherSuites == null )
+      return null;
+    return (String[])enabledCipherSuites.clone();
+  }
+
+  /**
+   * Returns the enabled protocols, or <code>null</code> if the defaults are
+   * to be used.
+   *
+   * @returns a string array of protocol names
+   */
+  public String[] getEnabledProtocols()
+  {
+    if( enabledProtocols == null )
+      return null;
+    return (String[])enabledProtocols.clone();
+  }
+
+  /**
+   * Returns whether client authorization is needed.
+   */
+  public boolean getNeedClientAuth()
+  {
+    return needClientAuth;
+  }
+
+  /**
+   * Returns the hash code of this object.
+   */
+  public int hashCode()
+  {
+    int hash = 0;
+    if( enabledCipherSuites != null )
+      for(int i = 0; i < enabledCipherSuites.length; i++ )
+	hash = hash ^ enabledCipherSuites[i].hashCode();
+    if( enabledProtocols != null )
+      for(int i = 0; i < enabledProtocols.length; i++ )
+	hash = hash ^ enabledProtocols[i].hashCode();
+    hash = ( needClientAuth ) ? (hash^0xFFFF) : hash;
+    return hash;
+ }
+}
\ No newline at end of file

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/AuthPermission.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/AuthPermission.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/AuthPermission.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/AuthPermission.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,146 @@
+/* AuthPermission.java -- permissions related to authentication.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth;
+
+import java.security.BasicPermission;
+
+/**
+ * <p>A permission controlling access to authentication service. The
+ * <i>actions</i> field of auth permission objects is ignored; the whole
+ * of the permission is defined by the <i>target</i>.</p>
+ *
+ * <p>The authentication permission targets recognized are:</p>
+ *
+ * <dl>
+ * <dt><code>doAs</code></dt>
+ *
+ * <dd><p>Allows access to the {@link
+ * Subject#doAs(javax.security.auth.Subject  java.security.PrivilegedAction)}
+ * methods.</p></dd>
+ *
+ * <dt><code>doAsPrivileged</code></dt>
+ *
+ * <dd><p>Allows access to the {@link
+ * Subject#doAsPrivileged(javax.security.auth.Subject,
+ * java.security.PrivilegedAction, java.security.AccessControlContext)}
+ * methods.</p></dd>
+ *
+ * <dt><code>getSubject</code></dt>
+ *
+ * <dd><p>Allows access to the {@link Subject} associated with a
+ * thread.</p></dd>
+ *
+ * <dt><code>getSubjectFromDomainCombiner</code></dt>
+ *
+ * <dd><p>Allows access to the {@link Subject} associated with a
+ * {@link SubjectDomainCombiner}.</p></dd>
+ *
+ * <dt><code>setReadOnly</code></dt>
+ *
+ * <dd><p>Allows a {@link Subject} to be marked as read-only.</p></dd>
+ *
+ * <dt><code>modifyPrincipals</code></dt>
+ *
+ * <dd><p>Allows the set of principals of a subject to be modified.</p></dd>
+ *
+ * <dt><code>modifyPublicCredentials</code></dt>
+ *
+ * <dd><p>Allows the set of public credentials of a subject to be
+ * modified.</p></dd>
+ *
+ * <dt><code>modifyPrivateCredentials</code></dt>
+ *
+ * <dd><p>Allows the set of private credentials of a subject to be
+ * modified.</p></dd>
+ *
+ * <dt><code>refreshCredential</code></dt>
+ *
+ * <dd><p>Allows a {@link Refreshable} credential to be refreshed.</p></dd>
+ *
+ * <dt><code>destroyCredential</code></dt>
+ *
+ * <dd><p>Allows a {@link Destroyable} credential to be destroyed.</p></dd>
+ *
+ * <dt><code>createLoginContext.<i>name</i></code></dt>
+ *
+ * <dd><p>Allows a {@link javax.security.auth.login.LoginContext} for the
+ * given <i>name</i>. <i>name</i> can also be a wildcard (<code>'*'</code>),
+ * which allows the creation of a context with any name.</p></dd>
+ *
+ * <dt><code>getLoginConfiguration</code></dt>
+ *
+ * <dd><p>Allows the system-wide login {@link
+ * javax.security.auth.login.Configuration} to be retrieved.</p></dd>
+ *
+ * <dt><code>setLoginConfiguration</code></dt>
+ *
+ * <dd><p>Allows the system-wide login {@link
+ * javax.security.auth.login.Configuration} to be set.</p></dd>
+ *
+ * <dt><code>refreshLoginConfiguration</code></dt>
+ *
+ * <dd><p>Allows the system-wide login {@link
+ * javax.security.auth.login.Configuration} to be refreshed.</p></dd>
+ * </dl>
+ */
+public final class AuthPermission extends BasicPermission
+{
+
+  /**
+   * Creates a new authentication permission for the given target name.
+   *
+   * @param name The target name.
+   */
+  public AuthPermission (String name)
+  {
+    super (name);
+  }
+
+  /**
+   * Creates a new authentication permission for the given target name.
+   * The actions list is not used by this class.
+   *
+   * @param name The target name.
+   * @param actions The action list.
+   */
+  public AuthPermission (String name, String actions)
+  {
+    super (name, actions);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/DestroyFailedException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/DestroyFailedException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/DestroyFailedException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/DestroyFailedException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,67 @@
+/* DestroyFailedException.java -- signals an object could not be destroyed.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth;
+
+/**
+ * An exception thrown when the {@link Destroyable#destroy()} method
+ * fails for a credential.
+ *
+ * @see Destroyable
+ */
+public class DestroyFailedException extends Exception
+{
+
+  /**
+   * Creates a new DestroyFailedException with no detail message.
+   */
+  public DestroyFailedException()
+  {
+    super();
+  }
+
+  /**
+   * Creates a new DestroyFailedException with a detail message.
+   *
+   * @param message The detail message.
+   */
+  public DestroyFailedException (String message)
+  {
+    super (message);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Destroyable.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Destroyable.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Destroyable.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Destroyable.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,64 @@
+/* Destroyable.java -- an immutable object that may be destroyed.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth;
+
+/**
+ * An interface for objects that are immutable but whose sensitive
+ * data may be wiped out.
+ */
+public interface Destroyable
+{
+
+  /**
+   * Destroy this object, clearing all sensitive fields appropriately.
+   *
+   * @throws DestroyFailedException If this object could not be
+   *   destroyed.
+   * @throws SecurityException If the caller does not have permission
+   *   to destroy this object.
+   */
+  void destroy() throws DestroyFailedException;
+
+  /**
+   * Tells whether or not this object has been destroyed.
+   *
+   * @return True if this object has been destroyed.
+   */
+  boolean isDestroyed();
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Policy.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Policy.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Policy.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Policy.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,79 @@
+/* Policy.java -- deprecated precursor to java.security.Policy.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth;
+
+import java.security.CodeSource;
+import java.security.PermissionCollection;
+
+/**
+ * @deprecated The classes java.security.Policy and
+ * java.security.ProtectionDomain provide the functionality of this class.
+ */
+public abstract class Policy
+{
+
+  private static Policy policy;
+
+  protected Policy()
+  {
+  }
+
+  public static synchronized Policy getPolicy()
+  {
+    SecurityManager sm = System.getSecurityManager();
+    if (sm != null)
+      {
+        sm.checkPermission (new AuthPermission ("getPolicy"));
+      }
+    return policy;
+  }
+
+  public static synchronized void setPolicy (Policy p)
+  {
+    SecurityManager sm = System.getSecurityManager();
+    if (sm != null)
+      {
+        sm.checkPermission (new AuthPermission ("setPolicy"));
+      }
+    policy = p;
+  }
+
+  public abstract PermissionCollection getPermissions (Subject subject, CodeSource source);
+  public abstract void refresh();
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/PrivateCredentialPermission.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/PrivateCredentialPermission.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/PrivateCredentialPermission.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/PrivateCredentialPermission.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,326 @@
+/* PrivateCredentialPermission.java -- permissions governing private credentials.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth;
+
+import java.io.Serializable;
+
+import java.security.Permission;
+import java.security.PermissionCollection;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+/**
+ * A permission governing access to a private credential. The action of this
+ * permission is always "read" -- meaning that the private credential
+ * information can be read from an object.
+ *
+ * <p>The target of this permission is formatted as follows:</p>
+ *
+ * <p><code>CredentialClassName ( PrinicpalClassName PrincipalName )*</code></p>
+ *
+ * <p><i>CredentialClassName</i> is either the name of a private credential
+ * class name, or a wildcard character (<code>'*'</code>).
+ * <i>PrinicpalClassName</i> is the class name of a principal object, and
+ * <i>PrincipalName</i> is a string representing the principal, or the
+ * wildcard character.</p>
+ */
+public final class PrivateCredentialPermission extends Permission
+  implements Serializable
+{
+  /**
+   * For compatability with Sun's JDK 1.4.2 rev. 5
+   */
+  private static final long serialVersionUID = 5284372143517237068L;
+
+  // Fields.
+  // -------------------------------------------------------------------------
+
+  /**
+   * @serial The credential class name.
+   */
+  private final String credentialClass;
+
+  /**
+   * @serial The principals, a set of CredOwner objects (an undocumented
+   *  inner class of this class).
+   */
+  private final Set principals;
+
+  /**
+   * @serial Who knows?
+   */
+  private final boolean testing;
+
+  // Constructor.
+  // -------------------------------------------------------------------------
+
+  /**
+   * Create a new private credential permission.
+   *
+   * @param name The permission target name.
+   * @param actions The list of actions, which, for this class, must be
+   *  <code>"read"</code>.
+   */
+  public PrivateCredentialPermission (final String name, String actions)
+  {
+    super(name);
+    actions = actions.trim().toLowerCase();
+    if (!"read".equals (actions))
+      {
+        throw new IllegalArgumentException("actions must be \"read\"");
+      }
+    StringTokenizer st = new StringTokenizer (name, " \"'");
+    principals = new HashSet();
+    if (st.countTokens() < 3 || (st.countTokens() & 1) == 0)
+      {
+        throw new IllegalArgumentException ("badly formed credential name");
+      }
+    credentialClass = st.nextToken();
+    while (st.hasMoreTokens())
+      {
+        principals.add (new CredOwner (st.nextToken(), st.nextToken()));
+      }
+    testing = false; // WTF ever.
+  }
+
+  // Instance methods.
+  // -------------------------------------------------------------------------
+
+  public boolean equals (Object o)
+  {
+    if (! (o instanceof PrivateCredentialPermission))
+      {
+        return false;
+      }
+    PrivateCredentialPermission that = (PrivateCredentialPermission) o;
+    if (!that.getActions().equals (getActions()))
+      {
+        return false;
+      }
+    if (!that.getCredentialClass().equals (getCredentialClass()))
+      {
+        return false;
+      }
+
+    final String[][] principals = getPrincipals();
+    final String[][] that_principals = that.getPrincipals();
+    if (that_principals == null)
+      {
+        return false;
+      }
+    if (that_principals.length != principals.length)
+      {
+        return false;
+      }
+    for (int i = 0; i < principals.length; i++)
+      {
+        if (!principals[i][0].equals (that_principals[i][0]) ||
+            !principals[i][1].equals (that_principals[i][1]))
+          {
+            return false;
+          }
+      }
+    return true;
+  }
+
+  /**
+   * Returns the actions this permission encompasses. For private credential
+   * permissions, this is always the string <code>"read"</code>.
+   *
+   * @return The list of actions.
+   */
+  public String getActions()
+  {
+    return "read";
+  }
+
+  /**
+   * Returns the credential class name that was embedded in this permission's
+   * target name.
+   *
+   * @return The credential class name.
+   */
+  public String getCredentialClass()
+  {
+    return credentialClass;
+  }
+
+  /**
+   * Returns the principal list that was embedded in this permission's target
+   * name.
+   *
+   * <p>Each element of the returned array is a pair; the first element is the
+   * principal class name, and the second is the principal name.
+   *
+   * @return The principal list.
+   */
+  public String[][] getPrincipals()
+  {
+    String[][] ret = new String[principals.size()][];
+    Iterator it = principals.iterator();
+    for (int i = 0; i < principals.size() && it.hasNext(); i++)
+      {
+        CredOwner co = (CredOwner) it.next();
+        ret[i] = new String[] { co.getPrincipalClass(), co.getPrincipalName() };
+      }
+    return ret;
+  }
+
+  public int hashCode()
+  {
+    return credentialClass.hashCode() + principals.hashCode();
+  }
+
+  /**
+   * Test if this permission implies another. This method returns true if:
+   *
+   * <ol>
+   * <li><i>p</i> is an instance of PrivateCredentialPermission</li>.
+   * <li>The credential class name of this instance matches that of <i>p</i>,
+   * and one of the principals of <i>p</i> is contained in the principals of
+   * this class. Thus,
+   *   <ul>
+   *   <li><code>[ * P "foo" ]  implies [ C P "foo" ]</code></li>
+   *   <li><code>[ C P1 "foo" ] implies [ C P1 "foo" P2 "bar" ]</code></li>
+   *   <li><code>[ C P1 "*" ]   implies [ C P1 "foo" ]</code></li>
+   *   </ul>
+   * </ol>
+   *
+   * @param p The permission to check.
+   * @return True if this permission implies <i>p</i>.
+   */
+  public boolean implies (Permission p)
+  {
+    if (! (p instanceof PrivateCredentialPermission))
+      {
+        return false;
+      }
+    PrivateCredentialPermission that = (PrivateCredentialPermission) p;
+    if (!credentialClass.equals ("*")
+        && !credentialClass.equals (that.getCredentialClass()))
+      {
+        return false;
+      }
+    String[][] principals = getPrincipals();
+    String[][] that_principals = that.getPrincipals();
+    if (that_principals == null)
+      {
+        return false;
+      }
+    for (int i = 0; i < principals.length; i++)
+      {
+        for (int j = 0; j < that_principals.length; j++)
+          {
+            if (principals[i][0].equals (that_principals[j][0]) &&
+                (principals[i][1].equals ("*") ||
+                 principals[i][1].equals (that_principals[j][1])))
+              {
+                return true;
+              }
+          }
+      }
+    return false;
+  }
+
+  /**
+   * This method is not necessary for this class, thus it always returns null.
+   *
+   * @return null.
+   */
+  public PermissionCollection newPermissionCollection()
+  {
+    return null;
+  }
+
+  // Inner class.
+  // -------------------------------------------------------------------------
+
+  /**
+   * An undocumented inner class present for serialization compatibility.
+   */
+  private static class CredOwner implements Serializable
+  {
+
+    // Fields.
+    // -----------------------------------------------------------------------
+
+    private final String principalClass;
+    private final String principalName;
+
+    // Constructor.
+    // -----------------------------------------------------------------------
+
+    CredOwner (final String principalClass, final String principalName)
+    {
+      this.principalClass = principalClass;
+      this.principalName = principalName;
+    }
+
+    // Instance methods.
+    // -----------------------------------------------------------------------
+
+    public boolean equals (Object o)
+    {
+      if (!(o instanceof CredOwner))
+        {
+          return false;
+        }
+      return principalClass.equals (((CredOwner) o).getPrincipalClass()) &&
+        principalName.equals (((CredOwner) o).getPrincipalName());
+    }
+
+    public int hashCode()
+    {
+      return principalClass.hashCode() + principalName.hashCode();
+    }
+
+    public String getPrincipalClass()
+    {
+      return principalClass;
+    }
+
+    public String getPrincipalName()
+    {
+      return principalName;
+    }
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/RefreshFailedException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/RefreshFailedException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/RefreshFailedException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/RefreshFailedException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,63 @@
+/* RefreshFailedException.java -- signals a failed refresh.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth;
+
+/**
+ * A signal that a call to {@link Refreshable#refresh()} failed.
+ */
+public class RefreshFailedException extends Exception
+{
+
+  /**
+   * Create a new RefreshFailedException with no detail message.
+   */
+  public RefreshFailedException()
+  {
+  }
+
+  /**
+   * Create a new RefreshFailedException with a detail message.
+   *
+   * @param message The detail message.
+   */
+  public RefreshFailedException (String message)
+  {
+    super (message);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Refreshable.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Refreshable.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Refreshable.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Refreshable.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,65 @@
+/* Refreshable.java -- an object whose state may be refreshed.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth;
+
+/**
+ * An object whose internal state may be <em>refreshed:</em> as in a
+ * credential object with a expiry date.
+ */
+public interface Refreshable
+{
+
+  /**
+   * Tells whether or not this object is current. Refreshable objects that
+   * are not current may need to be refreshed.
+   *
+   * @return Whether this object is current.
+   */
+  boolean isCurrent();
+
+  /**
+   * Refresh this object. The process involved in refreshing an object is
+   * per-implementation dependent.
+   *
+   * @throws RefreshFailedException If refreshing this object fails.
+   * @throws SecurityException If the caller does not have permission to
+   *  refresh, or to take the steps involved in refreshing, this object.
+   */
+  void refresh() throws RefreshFailedException;
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Subject.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Subject.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Subject.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/Subject.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,556 @@
+/* Subject.java -- a single entity in the system.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.DomainCombiner;
+import java.security.Principal;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+import java.util.AbstractSet;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Set;
+
+public final class Subject implements Serializable
+{
+  // Fields.
+  // -------------------------------------------------------------------------
+
+  private static final long serialVersionUID = -8308522755600156056L;
+
+  /**
+   * @serial The set of principals. The type of this field is SecureSet, a
+   *  private inner class.
+   */
+  private final Set principals;
+
+  /**
+   * @serial The read-only flag.
+   */
+  private boolean readOnly;
+
+  private final transient SecureSet pubCred;
+  private final transient SecureSet privCred;
+
+  // Constructors.
+  // -------------------------------------------------------------------------
+
+  public Subject()
+  {
+    principals = new SecureSet (this, SecureSet.PRINCIPALS);
+    pubCred = new SecureSet (this, SecureSet.PUBLIC_CREDENTIALS);
+    privCred = new SecureSet (this, SecureSet.PRIVATE_CREDENTIALS);
+    readOnly = false;
+  }
+
+  public Subject (final boolean readOnly, final Set principals,
+                  final Set pubCred, final Set privCred)
+  {
+    if (principals == null || pubCred == null || privCred == null)
+      {
+        throw new NullPointerException();
+      }
+    this.principals = new SecureSet (this, SecureSet.PRINCIPALS, principals);
+    this.pubCred = new SecureSet (this, SecureSet.PUBLIC_CREDENTIALS, pubCred);
+    this.privCred = new SecureSet (this, SecureSet.PRIVATE_CREDENTIALS, privCred);
+    this.readOnly = readOnly;
+  }
+
+  // Class methods.
+  // -------------------------------------------------------------------------
+
+  /**
+   * <p>Returns the subject associated with the given {@link
+   * AccessControlContext}.</p>
+   *
+   * <p>All this method does is retrieve the Subject object from the supplied
+   * context's {@link DomainCombiner}, if any, and if it is an instance of
+   * a {@link SubjectDomainCombiner}.
+   *
+   * @param context The context to retrieve the subject from.
+   * @return The subject assoctiated with the context, or <code>null</code>
+   *  if there is none.
+   * @throws NullPointerException If <i>subject</i> is null.
+   * @throws SecurityException If the caller does not have permission to get
+   *  the subject (<code>"getSubject"</code> target of {@link AuthPermission}.
+   */
+  public static Subject getSubject (final AccessControlContext context)
+  {
+    final SecurityManager sm = System.getSecurityManager();
+    if (sm != null)
+      {
+        sm.checkPermission (new AuthPermission ("getSubject"));
+      }
+    DomainCombiner dc = context.getDomainCombiner();
+    if (!(dc instanceof SubjectDomainCombiner))
+      {
+        return null;
+      }
+    return ((SubjectDomainCombiner) dc).getSubject();
+  }
+
+  /**
+   * <p>Run a method as another subject. This method will obtain the current
+   * {@link AccessControlContext} for this thread, then creates another with
+   * a {@link SubjectDomainCombiner} with the given subject. The supplied
+   * action will then be run with the modified context.</p>
+   *
+   * @param subject The subject to run as.
+   * @param action The action to run.
+   * @return The value returned by the privileged action.
+   * @throws SecurityException If the caller is not allowed to run under a
+   *  different identity (<code>"doAs"</code> target of {@link AuthPermission}.
+   */
+  public static Object doAs (final Subject subject, final PrivilegedAction action)
+  {
+    final SecurityManager sm = System.getSecurityManager();
+    if (sm != null)
+      {
+        sm.checkPermission (new AuthPermission ("doAs"));
+      }
+    AccessControlContext context =
+      new AccessControlContext (AccessController.getContext(),
+                                new SubjectDomainCombiner (subject));
+    return AccessController.doPrivileged (action, context);
+  }
+
+  /**
+   * <p>Run a method as another subject. This method will obtain the current
+   * {@link AccessControlContext} for this thread, then creates another with
+   * a {@link SubjectDomainCombiner} with the given subject. The supplied
+   * action will then be run with the modified context.</p>
+   *
+   * @param subject The subject to run as.
+   * @param action The action to run.
+   * @return The value returned by the privileged action.
+   * @throws SecurityException If the caller is not allowed to run under a
+   *  different identity (<code>"doAs"</code> target of {@link AuthPermission}.
+   * @throws PrivilegedActionException If the action throws an exception.
+   */
+  public static Object doAs (final Subject subject,
+                             final PrivilegedExceptionAction action)
+    throws PrivilegedActionException
+  {
+    final SecurityManager sm = System.getSecurityManager();
+    if (sm != null)
+      {
+        sm.checkPermission (new AuthPermission ("doAs"));
+      }
+    AccessControlContext context =
+      new AccessControlContext (AccessController.getContext(),
+                                new SubjectDomainCombiner(subject));
+    return AccessController.doPrivileged (action, context);
+  }
+
+  /**
+   * <p>Run a method as another subject. This method will create a new
+   * {@link AccessControlContext} derived from the given one, with a
+   * {@link SubjectDomainCombiner} with the given subject. The supplied
+   * action will then be run with the modified context.</p>
+   *
+   * @param subject The subject to run as.
+   * @param action The action to run.
+   * @param acc The context to use.
+   * @return The value returned by the privileged action.
+   * @throws SecurityException If the caller is not allowed to run under a
+   *  different identity (<code>"doAsPrivileged"</code> target of {@link
+   *  AuthPermission}.
+   */
+  public static Object doAsPrivileged (final Subject subject,
+                                       final PrivilegedAction action,
+                                       final AccessControlContext acc)
+  {
+    final SecurityManager sm = System.getSecurityManager();
+    if (sm != null)
+      {
+        sm.checkPermission (new AuthPermission ("doAsPrivileged"));
+      }
+    AccessControlContext context =
+      new AccessControlContext (acc, new SubjectDomainCombiner (subject));
+    return AccessController.doPrivileged (action, context);
+  }
+
+  /**
+   * <p>Run a method as another subject. This method will create a new
+   * {@link AccessControlContext} derived from the given one, with a
+   * {@link SubjectDomainCombiner} with the given subject. The supplied
+   * action will then be run with the modified context.</p>
+   *
+   * @param subject The subject to run as.
+   * @param action The action to run.
+   * @param acc The context to use.
+   * @return The value returned by the privileged action.
+   * @throws SecurityException If the caller is not allowed to run under a
+   *  different identity (<code>"doAsPrivileged"</code> target of
+   *  {@link AuthPermission}.
+   * @throws PrivilegedActionException If the action throws an exception.
+   */
+  public static Object doAsPrivileged (final Subject subject,
+                                       final PrivilegedExceptionAction action,
+				       AccessControlContext acc)
+    throws PrivilegedActionException
+  {
+    final SecurityManager sm = System.getSecurityManager();
+    if (sm != null)
+      {
+        sm.checkPermission (new AuthPermission ("doAsPrivileged"));
+      }
+    if (acc == null)
+      acc = new AccessControlContext (new java.security.ProtectionDomain[0]);
+    AccessControlContext context =
+      new AccessControlContext (acc, new SubjectDomainCombiner (subject));
+    return AccessController.doPrivileged (action, context);
+  }
+
+  // Instance methods.
+  // -------------------------------------------------------------------------
+
+  public boolean equals (Object o)
+  {
+    if (!(o instanceof Subject))
+      {
+        return false;
+      }
+    Subject that = (Subject) o;
+    return principals.containsAll (that.getPrincipals()) &&
+      pubCred.containsAll (that.getPublicCredentials()) &&
+      privCred.containsAll (that.getPrivateCredentials());
+  }
+
+  public Set getPrincipals()
+  {
+    return principals;
+  }
+
+  public Set getPrincipals(Class clazz)
+  {
+    HashSet result = new HashSet (principals.size());
+    for (Iterator it = principals.iterator(); it.hasNext(); )
+      {
+        Object o = it.next();
+        if (o != null && clazz.isAssignableFrom (o.getClass()))
+          {
+            result.add(o);
+          }
+      }
+    return Collections.unmodifiableSet (result);
+  }
+
+  public Set getPrivateCredentials()
+  {
+    return privCred;
+  }
+
+  public Set getPrivateCredentials (Class clazz)
+  {
+    HashSet result = new HashSet (privCred.size());
+    for (Iterator it = privCred.iterator(); it.hasNext(); )
+      {
+        Object o = it.next();
+        if (o != null && clazz.isAssignableFrom (o.getClass()))
+          {
+            result.add(o);
+          }
+      }
+    return Collections.unmodifiableSet (result);
+  }
+
+  public Set getPublicCredentials()
+  {
+    return pubCred;
+  }
+
+  public Set getPublicCredentials (Class clazz)
+  {
+    HashSet result = new HashSet (pubCred.size());
+    for (Iterator it = pubCred.iterator(); it.hasNext(); )
+      {
+        Object o = it.next();
+        if (o != null && clazz.isAssignableFrom (o.getClass()))
+          {
+            result.add(o);
+          }
+      }
+    return Collections.unmodifiableSet (result);
+  }
+
+  public int hashCode()
+  {
+    return principals.hashCode() + privCred.hashCode() + pubCred.hashCode();
+  }
+
+  /**
+   * <p>Returns whether or not this subject is read-only.</p>
+   *
+   * @return True is this subject is read-only.
+   */
+  public boolean isReadOnly()
+  {
+    return readOnly;
+  }
+
+  /**
+   * <p>Marks this subject as read-only.</p>
+   *
+   * @throws SecurityException If the caller does not have permission to
+   *  set this subject as read-only (<code>"setReadOnly"</code> target of
+   *  {@link AuthPermission}.
+   */
+  public void setReadOnly()
+  {
+    final SecurityManager sm = System.getSecurityManager();
+    if (sm != null)
+      {
+        sm.checkPermission (new AuthPermission ("setReadOnly"));
+      }
+    readOnly = true;
+  }
+
+  public String toString()
+  {
+    return Subject.class.getName() + " [ principals=" + principals +
+      ", private credentials=" + privCred + ", public credentials=" +
+      pubCred + ", read-only=" + readOnly + " ]";
+  }
+
+// Inner class.
+  // -------------------------------------------------------------------------
+
+  /**
+   * An undocumented inner class that is used for sets in the parent class.
+   */
+  private static class SecureSet extends AbstractSet implements Serializable
+  {
+    // Fields.
+    // -----------------------------------------------------------------------
+
+    private static final long serialVersionUID = 7911754171111800359L;
+
+    static final int PRINCIPALS = 0;
+    static final int PUBLIC_CREDENTIALS = 1;
+    static final int PRIVATE_CREDENTIALS = 2;
+
+    private final Subject subject;
+    private final LinkedList elements;
+    private final transient int type;
+
+    // Constructors.
+    // -----------------------------------------------------------------------
+
+    SecureSet (final Subject subject, final int type, final Collection inElements)
+    {
+      this (subject, type);
+      for (Iterator it = inElements.iterator(); it.hasNext(); )
+        {
+          Object o = it.next();
+          if (type == PRINCIPALS && !(o instanceof Principal))
+            {
+              throw new IllegalArgumentException(o+" is not a Principal");
+            }
+          if (!this.elements.contains (o))
+            {
+              this.elements.add (o);
+            }
+        }
+    }
+
+    SecureSet (final Subject subject, final int type)
+    {
+      this.subject = subject;
+      this.type = type;
+      this.elements = new LinkedList();
+    }
+
+    // Instance methods.
+    // -----------------------------------------------------------------------
+
+    public synchronized int size()
+    {
+      return elements.size();
+    }
+
+    public Iterator iterator()
+    {
+      return elements.iterator();
+    }
+
+    public synchronized boolean add(Object element)
+    {
+      if (subject.isReadOnly())
+        {
+          throw new IllegalStateException ("subject is read-only");
+        }
+      final SecurityManager sm = System.getSecurityManager();
+      switch (type)
+        {
+        case PRINCIPALS:
+          if (sm != null)
+            {
+              sm.checkPermission (new AuthPermission ("modifyPrincipals"));
+            }
+          if (!(element instanceof Principal))
+            {
+              throw new IllegalArgumentException ("element is not a Principal");
+            }
+          break;
+
+        case PUBLIC_CREDENTIALS:
+          if (sm != null)
+            {
+              sm.checkPermission (new AuthPermission ("modifyPublicCredentials"));
+            }
+          break;
+
+        case PRIVATE_CREDENTIALS:
+          if (sm != null)
+            {
+              sm.checkPermission (new AuthPermission ("modifyPrivateCredentials"));
+            }
+          break;
+
+        default:
+          throw new Error ("this statement should be unreachable");
+        }
+
+      if (elements.contains (element))
+        {
+          return false;
+        }
+
+      return elements.add (element);
+    }
+
+    public synchronized boolean remove (final Object element)
+    {
+      if (subject.isReadOnly())
+        {
+          throw new IllegalStateException ("subject is read-only");
+        }
+      final SecurityManager sm = System.getSecurityManager();
+      switch (type)
+        {
+        case PRINCIPALS:
+          if (sm != null)
+            {
+              sm.checkPermission (new AuthPermission ("modifyPrincipals"));
+            }
+          if (!(element instanceof Principal))
+            {
+              throw new IllegalArgumentException ("element is not a Principal");
+            }
+          break;
+
+        case PUBLIC_CREDENTIALS:
+          if (sm != null)
+            {
+              sm.checkPermission (new AuthPermission ("modifyPublicCredentials"));
+            }
+          break;
+
+        case PRIVATE_CREDENTIALS:
+          if (sm != null)
+            {
+              sm.checkPermission (new AuthPermission ("modifyPrivateCredentials"));
+            }
+          break;
+
+        default:
+          throw new Error("this statement should be unreachable");
+        }
+
+      return elements.remove(element);
+    }
+
+    public synchronized boolean contains (final Object element)
+    {
+      return elements.contains (element);
+    }
+
+    public boolean removeAll (final Collection c)
+    {
+      if (subject.isReadOnly())
+        {
+          throw new IllegalStateException ("subject is read-only");
+        }
+      return super.removeAll (c);
+    }
+
+    public boolean retainAll (final Collection c)
+    {
+      if (subject.isReadOnly())
+        {
+          throw new IllegalStateException ("subject is read-only");
+        }
+      return super.retainAll (c);
+    }
+
+    public void clear()
+    {
+      if (subject.isReadOnly())
+        {
+          throw new IllegalStateException ("subject is read-only");
+        }
+      elements.clear();
+    }
+
+    private synchronized void writeObject (ObjectOutputStream out)
+      throws IOException
+    {
+      throw new UnsupportedOperationException ("FIXME: determine serialization");
+    }
+
+    private void readObject (ObjectInputStream in)
+      throws ClassNotFoundException, IOException
+    {
+      throw new UnsupportedOperationException ("FIXME: determine serialization");
+    }
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/SubjectDomainCombiner.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/SubjectDomainCombiner.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/SubjectDomainCombiner.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/SubjectDomainCombiner.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,97 @@
+/* SubjectDomainCombiner.java -- domain combiner for Subjects.
+   Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth;
+
+import java.security.DomainCombiner;
+import java.security.Principal;
+import java.security.ProtectionDomain;
+
+import java.util.LinkedList;
+
+public class SubjectDomainCombiner implements DomainCombiner
+{
+
+  // Field.
+  // -------------------------------------------------------------------------
+
+  private final Subject subject;
+
+  // Constructor.
+  // -------------------------------------------------------------------------
+
+  public SubjectDomainCombiner (final Subject subject)
+  {
+    this.subject = subject;
+  }
+
+  // Instance methods.
+  // -------------------------------------------------------------------------
+
+  public ProtectionDomain[] combine (final ProtectionDomain[] current,
+                                     final ProtectionDomain[] assigned)
+  {
+    LinkedList domains = new LinkedList();
+    Principal[] principals = null;
+    if (subject != null)
+      principals = (Principal[]) subject.getPrincipals().toArray (new Principal[0]);
+    if (current != null)
+      {
+        for (int i = 0; i < current.length; i++)
+          {
+            domains.add (new ProtectionDomain (current[i].getCodeSource(),
+                                               current[i].getPermissions(),
+                                               current[i].getClassLoader(),
+                                               principals));
+          }
+      }
+    if (assigned != null)
+      {
+        for (int i = 0; i < assigned.length; i++)
+          {
+            domains.add (assigned[i]);
+          }
+      }
+    return (ProtectionDomain[]) domains.toArray (new ProtectionDomain[domains.size()]);
+  }
+
+  public Subject getSubject()
+  {
+    return subject;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/Callback.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/Callback.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/Callback.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/Callback.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,64 @@
+/* Callback.java -- marker interface for callback classes
+   Copyright (C) 2003, Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.callback;
+
+/**
+ * <p>Implementations of this interface are passed to a {@link CallbackHandler},
+ * allowing underlying security services the ability to interact with a calling
+ * application to retrieve specific authentication data such as usernames and
+ * passwords, or to display certain information, such as error and warning
+ * messages.</p>
+ *
+ * <p><code>Callback</code> implementations do not retrieve or display the
+ * information requested by underlying security services. <code>Callback</code>
+ * implementations simply provide the means to pass such requests to
+ * applications, and for applications, if appropriate, to return requested
+ * information back to the underlying security services.</p>
+ *
+ * @see CallbackHandler
+ * @see ChoiceCallback
+ * @see ConfirmationCallback
+ * @see LanguageCallback
+ * @see NameCallback
+ * @see PasswordCallback
+ * @see TextInputCallback
+ * @see TextOutputCallback
+ */
+public interface Callback {
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/CallbackHandler.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/CallbackHandler.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/CallbackHandler.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/CallbackHandler.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,155 @@
+/* CallbackHandler.java -- base interface for callback handlers.
+   Copyright (C) 2003, Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.callback;
+
+import java.io.IOException;
+
+/**
+ * <p>An application implements a <code>CallbackHandler</code> and passes it to
+ * underlying security services so that they may interact with the application
+ * to retrieve specific authentication data, such as usernames and passwords, or
+ * to display certain information, such as error and warning messages.</p>
+ *
+ * <p><code>CallbackHandler</code>s are implemented in an application-dependent
+ * fashion. For example, implementations for an application with a graphical
+ * user interface (GUI) may pop up windows to prompt for requested information
+ * or to display error messages. An implementation may also choose to obtain
+ * requested information from an alternate source without asking the end user.</p>
+ *
+ * <p>Underlying security services make requests for different types of
+ * information by passing individual Callbacks to the <code>CallbackHandler</code>.
+ * The <code>CallbackHandler</code> implementation decides how to retrieve and
+ * display information depending on the {@link Callback}s passed to it. For
+ * example, if the underlying service needs a username and password to
+ * authenticate a user, it uses a {@link NameCallback} and
+ * {@link PasswordCallback}. The <code>CallbackHandler</code> can then choose
+ * to prompt for a username and password serially, or to prompt for both in a
+ * single window.</p>
+ *
+ * <p>A default <code>CallbackHandler</code> class implementation may be
+ * specified in the <code>auth.login.defaultCallbackHandler</code> security
+ * property. The security property can be set in the Java security properties
+ * file located in the file named
+ * <code><JAVA_HOME>/lib/security/java.security</code>, where
+ * <code><JAVA_HOME></code> refers to the directory where the SDK was
+ * installed.</p>
+ *
+ * <p>If the security property is set to the fully qualified name of a
+ * <code>CallbackHandler</code> implementation class, then a
+ * <code>LoginContext</code>will load the specified <code>CallbackHandler</code>
+ * and pass it to the underlying <code>LoginModules</code>. The
+ * <code>LoginContext</code> only loads the default handler if one was not
+ * provided.</p>
+ *
+ * <p>All default handler implementations must provide a public zero-argument
+ * constructor.</p>
+ *
+ */
+public interface CallbackHandler
+{
+
+  /**
+   * <p>Retrieve or display the information requested in the provided
+   * {@link Callback}s.</p>
+   *
+   * <p>The <code>handle()</code> method implementation checks the instance(s)
+   * of the {@link Callback} object(s) passed in to retrieve or display the
+   * requested information. The following example is provided to help
+   * demonstrate what an <code>handle()</code> method implementation might look
+   * like. This example code is for guidance only. Many details, including
+   * proper error handling, are left out for simplicity.</p>
+   *
+   * <pre>
+   *public void handle(Callback[] callbacks)
+   *throws IOException, UnsupportedCallbackException {
+   *   for (int i = 0; i < callbacks.length; i++) {
+   *      if (callbacks[i] instanceof TextOutputCallback) {
+   *         // display the message according to the specified type
+   *         TextOutputCallback toc = (TextOutputCallback)callbacks[i];
+   *         switch (toc.getMessageType()) {
+   *         case TextOutputCallback.INFORMATION:
+   *            System.out.println(toc.getMessage());
+   *            break;
+   *         case TextOutputCallback.ERROR:
+   *            System.out.println("ERROR: " + toc.getMessage());
+   *            break;
+   *         case TextOutputCallback.WARNING:
+   *            System.out.println("WARNING: " + toc.getMessage());
+   *            break;
+   *         default:
+   *            throw new IOException("Unsupported message type: "
+   *                  + toc.getMessageType());
+   *         }
+   *      } else if (callbacks[i] instanceof NameCallback) {
+   *         // prompt the user for a username
+   *         NameCallback nc = (NameCallback)callbacks[i];
+   *         // ignore the provided defaultName
+   *         System.err.print(nc.getPrompt());
+   *         System.err.flush();
+   *         nc.setName((new BufferedReader(
+   *               new InputStreamReader(System.in))).readLine());
+   *      } else if (callbacks[i] instanceof PasswordCallback) {
+   *         // prompt the user for sensitive information
+   *         PasswordCallback pc = (PasswordCallback)callbacks[i];
+   *         System.err.print(pc.getPrompt());
+   *         System.err.flush();
+   *         pc.setPassword(readPassword(System.in));
+   *      } else {
+   *         throw new UnsupportedCallbackException(
+   *               callbacks[i], "Unrecognized Callback");
+   *      }
+   *   }
+   *}
+   *
+   * // Reads user password from given input stream.
+   *private char[] readPassword(InputStream in) throws IOException {
+   *   // insert code to read a user password from the input stream
+   *}
+   * </pre>
+   *
+   * @param callbacks an array of {@link Callback} objects provided by an
+   * underlying security service which contains the information requested to
+   * be retrieved or displayed.
+   * @throws IOException if an input or output error occurs.
+   * @throws UnsupportedCallbackException if the implementation of this method
+   * does not support one or more of the Callbacks specified in the
+   * <code>callbacks</code> parameter.
+   */
+  void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException;
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/ChoiceCallback.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/ChoiceCallback.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/ChoiceCallback.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/ChoiceCallback.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,236 @@
+/* ChoiceCallback.java -- callback for a choice of values.
+   Copyright (C) 2003, Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.callback;
+
+import java.io.Serializable;
+
+/**
+ * Underlying security services instantiate and pass a
+ * <code>ChoiceCallback</code> to the <code>handle()</code> method of a
+ * {@link CallbackHandler} to display a list of choices and to retrieve the
+ * selected choice(s).
+ *
+ * @see CallbackHandler
+ */
+public class ChoiceCallback implements Callback, Serializable
+{
+
+  // Constants and variables
+  // -------------------------------------------------------------------------
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private String prompt;
+
+  /**
+   * @serial the list of choices.
+   * @since 1.4
+   */
+  private String[] choices;
+
+  /**
+   * @serial the choice to be used as the default choice.
+   * @since 1.4
+   */
+  private int defaultChoice;
+
+  /**
+   * @serial whether multiple selections are allowed from the list of choices.
+   * @since 1.4
+   */
+  private boolean multipleSelectionsAllowed;
+
+  /**
+   * @serial the selected choices, represented as indexes into the choices list.
+   * @since 1.4
+   */
+  private int[] selections;
+
+  // Constructor(s)
+  //--------------------------------------------------------------------------
+
+  /**
+   * Construct a <code>ChoiceCallback</code> with a prompt, a list of choices,
+   * a default choice, and a boolean specifying whether or not multiple
+   * selections from the list of choices are allowed.
+   *
+   * @param prompt the prompt used to describe the list of choices.
+   * @param choices the list of choices.
+   * @param defaultChoice the choice to be used as the default choice when the
+   * list of choices are displayed. This value is represented as an index into
+   * the <code>choices</code> array.
+   * @param multipleSelectionsAllowed boolean specifying whether or not
+   * multiple selections can be made from the list of choices.
+   * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
+   * if <code>prompt</code> has a length of <code>0</code>, if <code>choices</code>
+   * is <code>null</code>, if <code>choices</code> has a length of <code>0</code>,
+   * if any element from <code>choices</code> is <code>null</code>, if any
+   * element from <code>choices</code> has a length of <code>0</code> or if
+   * <code>defaultChoice</code> does not fall within the array boundaries of
+   * <code>choices</code>.
+   */
+  public ChoiceCallback(String prompt, String[] choices, int defaultChoice,
+			boolean multipleSelectionsAllowed)
+  {
+    super();
+
+    setPrompt(prompt);
+    setChoices(choices);
+    if (defaultChoice < 0 || defaultChoice >= this.choices.length)
+      {
+	throw new IllegalArgumentException("default choice is out of bounds");
+      }
+    this.defaultChoice = defaultChoice;
+    this.multipleSelectionsAllowed = multipleSelectionsAllowed;
+  }
+
+  // Instance methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Get the prompt.
+   *
+   * @return the prompt.
+   */
+  public String getPrompt()
+  {
+    return prompt;
+  }
+
+  /**
+   * Get the list of choices.
+   *
+   * @return the list of choices.
+   */
+  public String[] getChoices()
+  {
+    return choices;
+  }
+
+  /**
+   * Get the defaultChoice.
+   *
+   * @return the defaultChoice, represented as an index into the choices list.
+   */
+  public int getDefaultChoice()
+  {
+    return defaultChoice;
+  }
+
+  /**
+   * Get the boolean determining whether multiple selections from the choices
+   * list are allowed.
+   *
+   * @return whether multiple selections are allowed.
+   */
+  public boolean allowMultipleSelections()
+  {
+    return multipleSelectionsAllowed;
+  }
+
+  /**
+   * Set the selected choice.
+   *
+   * @param selection the selection represented as an index into the choices
+   * list.
+   * @see #getSelectedIndexes()
+   */
+  public void setSelectedIndex(int selection)
+  {
+    this.selections = new int[1];
+    this.selections[0] = selection;
+  }
+
+  /**
+   * Set the selected choices.
+   *
+   * @param selections the selections represented as indexes into the choices
+   * list.
+   * @throws UnsupportedOperationException if multiple selections are not
+   * allowed, as determined by <code>allowMultipleSelections</code>.
+   * @see #getSelectedIndexes()
+   */
+  public void setSelectedIndexes(int[] selections)
+  {
+    if (!multipleSelectionsAllowed)
+      {
+	throw new UnsupportedOperationException("not allowed");
+      }
+
+    this.selections = selections;
+  }
+
+  /**
+   * Get the selected choices.
+   *
+   * @return the selected choices, represented as indexes into the choices list.
+   * @see #setSelectedIndexes(int[])
+   */
+  public int[] getSelectedIndexes()
+  {
+    return selections;
+  }
+
+  private void setPrompt(String prompt) throws IllegalArgumentException
+  {
+    if ((prompt == null) || (prompt.length() == 0))
+      {
+	throw new IllegalArgumentException("invalid prompt");
+      }
+    this.prompt = prompt;
+  }
+
+  private void setChoices(String[] choices) throws IllegalArgumentException
+  {
+    if (choices == null || choices.length == 0)
+      {
+	throw new IllegalArgumentException("invalid choices");
+      }
+    for (int i = 0; i < choices.length; i++)
+      {
+	if (choices[i] == null || choices[i].length() == 0)
+	  {
+	    throw new IllegalArgumentException("invalid choice at index #"+i);
+	  }
+      }
+    this.choices = choices;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/ConfirmationCallback.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/ConfirmationCallback.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/ConfirmationCallback.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/ConfirmationCallback.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,505 @@
+/* ConfirmationCallback.java -- callback for confirmations.
+   Copyright (C) 2003, Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.callback;
+
+import java.io.Serializable;
+
+/**
+ * Underlying security services instantiate and pass a
+ * <code>ConfirmationCallback</code> to the <code>handle()</code> method of a
+ * {@link CallbackHandler} to ask for YES/NO, OK/CANCEL, YES/NO/CANCEL or other
+ * similar confirmations.
+ *
+ * @see CallbackHandler
+ */
+public class ConfirmationCallback implements Callback, Serializable
+{
+
+  // Constants and variables
+  // -------------------------------------------------------------------------
+
+  /**
+   * <p>Unspecified option type.</p>
+   *
+   * <p>The <code>getOptionType</code> method returns this value if this
+   * <code>ConfirmationCallback</code> was instantiated with <code>options</code>
+   * instead of an <code>optionType</code>.</p>
+   */
+  public static final int UNSPECIFIED_OPTION = -1;
+
+  /**
+   * <p>YES/NO confirmation option.</p>
+   *
+   * <p>An underlying security service specifies this as the <code>optionType</code>
+   * to a <code>ConfirmationCallback</code> constructor if it requires a
+   * confirmation which can be answered with either <code>YES</code> or
+   * <code>NO</code>.</p>
+   */
+  public static final int YES_NO_OPTION = 0;
+
+  /**
+   * <p>YES/NO/CANCEL confirmation confirmation option.</p>
+   *
+   * <p>An underlying security service specifies this as the <code>optionType</code>
+   * to a <code>ConfirmationCallback</code> constructor if it requires a
+   * confirmation which can be answered with either <code>YES</code>,
+   * <code>NO</code> or <code>CANCEL</code>.
+   */
+  public static final int YES_NO_CANCEL_OPTION = 1;
+
+  /**
+   * <p>OK/CANCEL confirmation confirmation option.</p>
+   *
+   * <p>An underlying security service specifies this as the <code>optionType</code>
+   * to a <code>ConfirmationCallback</code> constructor if it requires a
+   * confirmation which can be answered with either <code>OK</code> or
+   * <code>CANCEL</code>.</p>
+   */
+  public static final int OK_CANCEL_OPTION = 2;
+
+  /**
+   * <p>YES option.</p>
+   *
+   * <p>If an <code>optionType</code> was specified to this
+   * <code>ConfirmationCallback</code>, this option may be specified as a
+   * <code>defaultOption</code> or returned as the selected index.</p>
+   */
+  public static final int YES = 0;
+
+  /**
+   * <p>NO option.</p>
+   *
+   * <p>If an <code>optionType</code> was specified to this
+   * <code>ConfirmationCallback</code>, this option may be specified as a
+   * <code>defaultOption</code> or returned as the selected index.</p>
+   */
+  public static final int NO = 1;
+
+  /**
+   * <p>CANCEL option.</p>
+   *
+   * <p>If an <code>optionType</code> was specified to this
+   * <code>ConfirmationCallback</code>, this option may be specified as a
+   * <code>defaultOption</code> or returned as the selected index.</p>
+   */
+  public static final int CANCEL = 2;
+
+  /**
+   * <p>OK option.</p>
+   *
+   * <p>If an <code>optionType</code> was specified to this
+   * <code>ConfirmationCallback</code>, this option may be specified as a
+   * <code>defaultOption</code> or returned as the selected index.</p>
+   */
+  public static final int OK = 3;
+
+  /** INFORMATION message type. */
+  public static final int INFORMATION = 0;
+
+  /** WARNING message type. */
+  public static final int WARNING = 1;
+
+  /** ERROR message type. */
+  public static final int ERROR = 2;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private String prompt;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private int messageType;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private int optionType;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private int defaultOption;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private String[] options = null;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private int selection;
+
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * <p>Construct a <code>ConfirmationCallback</code> with a message type, an
+   * option type and a default option.</p>
+   *
+   * <p>Underlying security services use this constructor if they require
+   * either a YES/NO, YES/NO/CANCEL or OK/CANCEL confirmation.</p>
+   *
+   * @param messageType the message type (INFORMATION, WARNING or ERROR).
+   * @param optionType the option type (YES_NO_OPTION, YES_NO_CANCEL_OPTION or
+   * OK_CANCEL_OPTION).
+   * @param defaultOption the default option from the provided optionType (YES,
+   * NO, CANCEL or OK).
+   * @throws IllegalArgumentException if <code>messageType</code> is not either
+   * <code>INFORMATION</code>, <code>WARNING</code>, or <code>ERROR</code>, if
+   * <code>optionType</code> is not either <code>YES_NO_OPTION</code>,
+   * <code>YES_NO_CANCEL_OPTION</code>, or <code>OK_CANCEL_OPTION</code>, or if
+   * <code>defaultOption</code> does not correspond to one of the options in
+   * <code>optionType</code>.
+   */
+  public ConfirmationCallback(int messageType, int optionType, int defaultOption)
+    throws IllegalArgumentException
+  {
+    super();
+
+    setMessageType(messageType);
+    setOptionType(optionType, defaultOption);
+    this.defaultOption = defaultOption;
+  }
+
+  /**
+   * <p>Construct a <code>ConfirmationCallback</code> with a message type, a
+   * list of options and a default option.</p>
+   *
+   * <p>Underlying security services use this constructor if they require a
+   * confirmation different from the available preset confirmations provided
+   * (for example, CONTINUE/ABORT or STOP/GO). The confirmation options are
+   * listed in the <code>options</code> array, and are displayed by the
+   * {@link CallbackHandler} implementation in a manner consistent with the
+   * way preset options are displayed.</p>
+   *
+   * @param messageType the message type (INFORMATION, WARNING or ERROR).
+   * @param options the list of confirmation options.
+   * @param defaultOption the default option, represented as an index into the
+   * <code>options</code> array.
+   * @throws IllegalArgumentException if <code>messageType</code> is not either
+   * <code>INFORMATION</code>, <code>WARNING</code>, or <code>ERROR</code>, if
+   * <code>options</code> is <code>null</code>, if <code>options</code> has a
+   * length of <code>0</code>, if any element from <code>options</code> is
+   * <code>null</code>, if any element from <code>options</code> has a length
+   * of <code>0</code>, or if <code>defaultOption</code> does not lie within
+   * the array boundaries of <code>options</code>.
+   */
+  public ConfirmationCallback(int messageType, String[] options, int defaultOption)
+  {
+    super();
+
+    setMessageType(messageType);
+    setOptions(options, defaultOption);
+    this.defaultOption = defaultOption;
+  }
+
+  /**
+   * <p>Construct a <code>ConfirmationCallback</code> with a prompt, message
+   * type, an option type and a default option.</p>
+   *
+   * <p>Underlying security services use this constructor if they require
+   * either a YES/NO, YES/NO/CANCEL or OK/CANCEL confirmation.</p>
+   *
+   * @param prompt the prompt used to describe the list of options.
+   * @param messageType the message type (INFORMATION, WARNING or ERROR).
+   * @param optionType the option type (YES_NO_OPTION, YES_NO_CANCEL_OPTION or
+   * OK_CANCEL_OPTION).
+   * @param defaultOption the default option from the provided optionType (YES,
+   * NO, CANCEL or OK).
+   * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
+   * if <code>prompt</code> has a length of <code>0</code>, if
+   * <code>messageType</code> is not either <code>INFORMATION</code>,
+   * <code>WARNING</code>, or <code>ERROR</code>, if <code>optionType</code> is
+   * not either <code>YES_NO_OPTION</code>, <code>YES_NO_CANCEL_OPTION</code>,
+   * or <code>OK_CANCEL_OPTION</code>, or if <code>defaultOption</code> does
+   * not correspond to one of the options in <code>optionType</code>.
+   */
+  public ConfirmationCallback(String prompt, int messageType, int optionType,
+			      int defaultOption)
+  {
+    super();
+
+    setPrompt(prompt);
+    setMessageType(messageType);
+    setOptionType(optionType, defaultOption);
+    this.defaultOption = defaultOption;
+  }
+
+  /**
+   * <p>Construct a <code>ConfirmationCallback</code> with a prompt, message
+   * type, a list of options and a default option.</p>
+   *
+   * <p>Underlying security services use this constructor if they require a
+   * confirmation different from the available preset confirmations provided
+   * (for example, CONTINUE/ABORT or STOP/GO). The confirmation options are
+   * listed in the <code>options</code> array, and are displayed by the
+   * {@link CallbackHandler} implementation in a manner consistent with the
+   * way preset options are displayed.</p>
+   *
+   * @param prompt the prompt used to describe the list of options.
+   * @param messageType the message type (INFORMATION, WARNING or ERROR).
+   * @param options the list of confirmation options.
+   * @param defaultOption the default option, represented as an index into the
+   * <code>options</code> array.
+   * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
+   * if <code>prompt</code> has a length of <code>0</code>, if
+   * <code>messageType</code> is not either <code>INFORMATION</code>,
+   * <code>WARNING</code>, or <code>ERROR</code>, if <code>options</code> is
+   * <code>null</code>, if <code>options</code> has a length of <code>0</code>,
+   * if any element from <code>options</code> is <code>null</code>, if any
+   * element from <code>options</code> has a length of <code>0</code>, or if
+   * <code>defaultOption</code> does not lie within the array boundaries of
+   * <code>options</code>.
+   */
+  public ConfirmationCallback(String prompt, int messageType, String[] options,
+			      int defaultOption)
+  {
+    super();
+
+    setPrompt(prompt);
+    setMessageType(messageType);
+    setOptions(options, defaultOption);
+    this.defaultOption = defaultOption;
+  }
+
+  // Class methods
+  // -------------------------------------------------------------------------
+
+  // Instance methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Get the prompt.
+   *
+   * @return the prompt, or <code>null</code> if this
+   * <code>ConfirmationCallback</code> was instantiated without a prompt.
+   */
+  public String getPrompt()
+  {
+    return prompt;
+  }
+
+  /**
+   * Get the message type.
+   *
+   * @return the message type (INFORMATION, WARNING or ERROR).
+   */
+  public int getMessageType()
+  {
+    return messageType;
+  }
+
+  /**
+   * <p>Get the option type.</p>
+   *
+   * <p>If this method returns {@link #UNSPECIFIED_OPTION}, then this
+   * <code>ConfirmationCallback</code> was instantiated with <code>options</code>
+   * instead of an <code>optionType</code>. In this case, invoke the
+   * {@link #getOptions()} method to determine which confirmation options to
+   * display.</p>
+   *
+   * @return the option type (YES_NO_OPTION, YES_NO_CANCEL_OPTION or
+   * OK_CANCEL_OPTION), or UNSPECIFIED_OPTION if this
+   * <code>ConfirmationCallback</code> was instantiated with <code>options</code>
+   * instead of an <code>optionType</code>.
+   */
+  public int getOptionType()
+  {
+    if (options != null)
+      {
+	return UNSPECIFIED_OPTION;
+      }
+    return optionType;
+  }
+
+  /**
+   * Get the confirmation options.
+   *
+   * @return the list of confirmation options, or <code>null</code> if this
+   * <code>ConfirmationCallback</code> was instantiated with an
+   * <code>optionType</code> instead of <code>options</code>.
+   */
+  public String[] getOptions()
+  {
+    return options;
+  }
+
+  /**
+   * Get the default option.
+   *
+   * @return the default option, represented as <code>YES</code>, <code>NO</code>,
+   * <code>OK</code> or <code>CANCEL</code> if an <code>optionType</code> was
+   * specified to the constructor of this <code>ConfirmationCallback</code>.
+   * Otherwise, this method returns the default option as an index into the
+   * <code>options</code> array specified to the constructor of this
+   * <code>ConfirmationCallback</code>.
+   */
+  public int getDefaultOption()
+  {
+    return defaultOption;
+  }
+
+  /**
+   * Set the selected confirmation option.
+   *
+   * @param selection the selection represented as <code>YES</code>,
+   * <code>NO</code>, <code>OK</code> or <code>CANCEL</code> if an
+   * <code>optionType</code> was specified to the constructor of this
+   * <code>ConfirmationCallback</code>. Otherwise, the <code>selection</code>
+   * represents the index into the <code>options</code> array specified to the
+   * constructor of this <code>ConfirmationCallback</code>.
+   * @see #getSelectedIndex()
+   */
+  public void setSelectedIndex(int selection)
+  {
+    if (options != null)
+      {
+	setOptions(options, selection);
+      }
+    else
+      {
+	setOptionType(optionType, selection);
+      }
+  }
+
+  /**
+   * Get the selected confirmation option.
+   *
+   * @return the selected confirmation option represented as <code>YES</code>,
+   * <code>NO</code>, <code>OK</code> or <code>CANCEL</code> if an
+   * <code>optionType</code> was specified to the constructor of this
+   * <code>ConfirmationCallback</code>. Otherwise, this method returns the
+   * selected confirmation option as an index into the <code>options</code>
+   * array specified to the constructor of this <code>ConfirmationCallback</code>.
+   * @see #setSelectedIndex(int)
+   */
+  public int getSelectedIndex()
+  {
+    return this.selection;
+  }
+
+  private void setMessageType(int messageType) throws IllegalArgumentException
+  {
+    switch (messageType)
+      {
+      case INFORMATION:
+      case WARNING:
+      case ERROR: this.messageType = messageType; break;
+      default: throw new IllegalArgumentException("illegal message type");
+      }
+  }
+
+  private void setOptionType(int optionType, int selectedOption)
+    throws IllegalArgumentException
+  {
+    switch (optionType)
+      {
+      case YES_NO_OPTION:
+	this.optionType = optionType;
+	switch (selectedOption)
+	  {
+	  case YES:
+	  case NO: this.selection = selectedOption; break;
+	  default: throw new IllegalArgumentException("invalid option");
+	  }
+	break;
+      case YES_NO_CANCEL_OPTION:
+	this.optionType = optionType;
+	switch (selectedOption)
+	  {
+	  case YES:
+	  case NO:
+	  case CANCEL: this.selection = selectedOption; break;
+	  default: throw new IllegalArgumentException("invalid option");
+	  }
+	break;
+      case OK_CANCEL_OPTION:
+	this.optionType = optionType;
+	switch (selectedOption)
+	  {
+	  case OK:
+	  case CANCEL: this.selection = selectedOption; break;
+	  default: throw new IllegalArgumentException("invalid option");
+	  }
+	break;
+      default:
+	throw new IllegalArgumentException("illegal option type");
+      }
+  }
+
+  private void setOptions(String[] options, int selectedOption)
+    throws IllegalArgumentException
+  {
+    if ((selectedOption < 0) || (selectedOption > options.length - 1))
+      {
+	throw new IllegalArgumentException("invalid selection");
+      }
+    if ((options == null) || (options.length == 0))
+      {
+	throw new IllegalArgumentException("options is null or empty");
+      }
+    for (int i = 0; i < options.length; i++)
+      {
+	if ((options[i] == null) || (options[i].length() == 0))
+	  {
+	    throw new IllegalArgumentException("options[" + i + "] is null or empty");
+	  }
+      }
+    this.options = options;
+    this.selection = selectedOption;
+  }
+
+  private void setPrompt(String prompt) throws IllegalArgumentException
+  {
+    if ((prompt == null) || (prompt.length() == 0))
+      {
+	throw new IllegalArgumentException("prompt is null or empty");
+      }
+    this.prompt = prompt;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/LanguageCallback.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/LanguageCallback.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/LanguageCallback.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/LanguageCallback.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,100 @@
+/* LanguageCallback.java -- callback for language choices.
+   Copyright (C) 2003, Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.callback;
+
+import java.io.Serializable;
+import java.util.Locale;
+
+/**
+ * Underlying security services instantiate and pass a <code>LanguageCallback</code>
+ * to the <code>handle()</code> method of a {@link CallbackHandler} to retrieve
+ * the {@link Locale} used for localizing text.
+ *
+ * @see CallbackHandler
+ */
+public class LanguageCallback implements Callback, Serializable
+{
+
+  // Constants and variables
+  // -------------------------------------------------------------------------
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private Locale locale;
+
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /** Construct a <code>LanguageCallback</code>. */
+  public LanguageCallback()
+  {
+    super();
+  }
+
+  // Class methods
+  // -------------------------------------------------------------------------
+
+  // Instance methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Set the retrieved Locale.
+   *
+   * @param locale the retrieved Locale.
+   * @see #getLocale()
+   */
+  public void setLocale(Locale locale)
+  {
+    this.locale = locale;
+  }
+
+  /**
+   * Get the retrieved Locale.
+   *
+   * @return the retrieved Locale, or <code>null</code> if no Locale could be
+   * retrieved.
+   * @see #setLocale(Locale)
+   */
+  public Locale getLocale()
+  {
+    return locale;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/NameCallback.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/NameCallback.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/NameCallback.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/NameCallback.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,178 @@
+/* NameCallback.java -- callback for user names.
+   Copyright (C) 2003, Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.callback;
+
+import java.io.Serializable;
+
+/**
+ * Underlying security services instantiate and pass a <code>NameCallback</code>
+ * to the <code>handle()</code> method of a {@link CallbackHandler} to retrieve
+ * name information.
+ *
+ * @see CallbackHandler
+ */
+public class NameCallback implements Callback, Serializable
+{
+
+  // Constants and variables
+  // -------------------------------------------------------------------------
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private String prompt;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private String defaultName;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private String inputName;
+
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Construct a <code>NameCallback</code> with a prompt.
+   *
+   * @param prompt the prompt used to request the name.
+   * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>
+   * or if <code>prompt</code> has a length of <code>0</code>.
+   */
+  public NameCallback(String prompt)
+  {
+    super();
+
+    setPrompt(prompt);
+  }
+
+  /**
+   * Construct a <code>NameCallback</code> with a prompt and default name.
+   *
+   * @param prompt the prompt used to request the information.
+   * @param defaultName the name to be used as the default name displayed with
+   * the prompt.
+   * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>
+   * or if <code>prompt</code> has a length of <code>0</code>, if
+   * <code>defaultName</code> is <code>null</code>, or if <code>defaultName</code>
+   * has a length of <code>0</code>.
+   */
+  public NameCallback(String prompt, String defaultName)
+    throws IllegalArgumentException
+  {
+    super();
+
+    setPrompt(prompt);
+    setDefaultName(defaultName);
+  }
+
+  // Class methods
+  // -------------------------------------------------------------------------
+
+  // Instance methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Get the prompt.
+   *
+   * @return the prompt.
+   */
+  public String getPrompt()
+  {
+    return prompt;
+  }
+
+  /**
+   * Get the default name.
+   *
+   * @return the default name, or <code>null</code> if this
+   * <code>NameCallback</code> was not instantiated with a
+   * <code>defaultName</code>.
+   */
+  public String getDefaultName()
+  {
+    return defaultName;
+  }
+
+  /**
+   * Set the retrieved name.
+   *
+   * @param name the retrieved name (which may be <code>null</code>).
+   * @see #getName()
+   */
+  public void setName(String name)
+  {
+    this.inputName = name;
+  }
+
+  /**
+   * Get the retrieved name.
+   *
+   * @return the retrieved name (which may be <code>null</code>)
+   * @see #setName(String)
+   */
+  public String getName()
+  {
+    return inputName;
+  }
+
+  private void setPrompt(String prompt) throws IllegalArgumentException
+  {
+    if ((prompt == null) || (prompt.length() == 0))
+      {
+	throw new IllegalArgumentException("invalid prompt");
+      }
+    this.prompt = prompt;
+  }
+
+  private void setDefaultName(String defaultName) throws IllegalArgumentException
+  {
+    if ((defaultName == null) || (defaultName.length() == 0))
+      {
+	throw new IllegalArgumentException("invalid default name");
+      }
+    this.defaultName = defaultName;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/PasswordCallback.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/PasswordCallback.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/PasswordCallback.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/PasswordCallback.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,168 @@
+/* PasswordCallback.java -- callback for passwords.
+   Copyright (C) 2003, Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.callback;
+
+import java.io.Serializable;
+
+/**
+ * Underlying security services instantiate and pass a <code>PasswordCallback</code>
+ * to the <code>handle()</code> method of a {@link CallbackHandler} to retrieve
+ * password information.
+ *
+ * @see CallbackHandler,
+ */
+public class PasswordCallback implements Callback, Serializable
+{
+
+  // Constants and variables
+  // -------------------------------------------------------------------------
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private String prompt;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private boolean echoOn;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private char[] inputPassword;
+
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Construct a <code>PasswordCallback</code> with a prompt and a boolean
+   * specifying whether the password should be displayed as it is being typed.
+   *
+   * @param prompt the prompt used to request the password.
+   * @param echoOn <code>true</code> if the password should be displayed as it
+   * is being typed.
+   * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>
+   * or if <code>prompt</code> has a length of <code>0</code>.
+   */
+  public PasswordCallback(String prompt, boolean echoOn)
+  {
+    super();
+
+    setPrompt(prompt);
+    this.echoOn = echoOn;
+  }
+
+  // Class methods
+  // -------------------------------------------------------------------------
+
+  // Instance methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Get the prompt.
+   *
+   * @return the prompt.
+   */
+  public String getPrompt()
+  {
+    return prompt;
+  }
+
+  /**
+   * Return whether the password should be displayed as it is being typed.
+   *
+   * @return the whether the password should be displayed as it is being typed.
+   */
+  public boolean isEchoOn()
+  {
+    return echoOn;
+  }
+
+  /**
+   * <p>Set the retrieved password.</p>
+   *
+   * <p>This method makes a copy of the input password before storing it.</p>
+   *
+   * @param password the retrieved password, which may be <code>null</code>.
+   * @see #getPassword()
+   */
+  public void setPassword(char[] password)
+  {
+    inputPassword = (password == null ? null : (char[]) password.clone());
+  }
+
+  /**
+   * <p>Get the retrieved password.</p>
+   *
+   * <p>This method returns a copy of the retrieved password.</p>
+   *
+   * @return the retrieved password, which may be <code>null</code>.
+   * @see #setPassword(char[])
+   */
+  public char[] getPassword()
+  {
+    return (inputPassword == null ? null : (char[]) inputPassword.clone());
+  }
+
+  /** Clear the retrieved password. */
+  public void clearPassword()
+  {
+    if (inputPassword != null)
+      {
+	for (int i = 0; i < inputPassword.length; i++)
+	  {
+	    inputPassword[i] = '\0';
+	  }
+	inputPassword = null;
+      }
+  }
+
+  private void setPrompt(String prompt) throws IllegalArgumentException
+  {
+    if ((prompt == null) || (prompt.length() == 0))
+      {
+	throw new IllegalArgumentException("invalid prompt");
+      }
+    this.prompt = prompt;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/TextInputCallback.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/TextInputCallback.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/TextInputCallback.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/TextInputCallback.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,177 @@
+/* TextInputCallback.java -- callbacks for user input.
+   Copyright (C) 2003, Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.callback;
+
+import java.io.Serializable;
+
+/**
+ * Underlying security services instantiate and pass a <code>TextInputCallback</code>
+ * to the <code>handle()</code> method of a {@link CallbackHandler} to retrieve
+ * generic text information.
+ *
+ * @see CallbackHandler
+ */
+public class TextInputCallback implements Callback, Serializable
+{
+
+  // Constants and variables
+  // -------------------------------------------------------------------------
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private String prompt;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private String defaultText;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private String inputText;
+
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Construct a <code>TextInputCallback</code> with a prompt.
+   *
+   * @param prompt the prompt used to request the information.
+   * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>
+   * or if <code>prompt</code> has a length of <code>0</code>.
+   */
+  public TextInputCallback(String prompt) throws IllegalArgumentException
+  {
+    super();
+
+    setPrompt(prompt);
+  }
+
+  /**
+   * Construct a <code>TextInputCallback</code> with a prompt and default
+   * input value.
+   *
+   * @param prompt the prompt used to request the information.
+   * @param defaultText the text to be used as the default text displayed with
+   * the prompt.
+   * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
+   * if <code>prompt</code> has a length of <code>0</code>, if
+   * <code>defaultText</code> is <code>null</code> or if <code>defaultText</code>
+   * has a length of <code>0</code>.
+   */
+  public TextInputCallback(String prompt, String defaultText)
+    throws IllegalArgumentException
+  {
+    super();
+
+    setPrompt(prompt);
+    setDefaultText(defaultText);
+  }
+
+  // Class methods
+  // -------------------------------------------------------------------------
+
+  // Instance methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Get the prompt.
+   *
+   * @return the prompt.
+   */
+  public String getPrompt()
+  {
+    return prompt;
+  }
+
+  /**
+   * Get the default text.
+   *
+   * @return the default text, or <code>null</code> if this
+   * <code>TextInputCallback</code> was not instantiated with
+   * <code>defaultText</code>.
+   */
+  public String getDefaultText()
+  {
+    return defaultText;
+  }
+
+  /**
+   * Set the retrieved text.
+   *
+   * @param text the retrieved text, which may be <code>null</code>.
+   */
+  public void setText(String text)
+  {
+    this.inputText = text;
+  }
+
+  /**
+   * Get the retrieved text.
+   *
+   * @return the retrieved text, which may be <code>null</code>.
+   */
+  public String getText()
+  {
+    return inputText;
+  }
+
+  private void setPrompt(String prompt) throws IllegalArgumentException
+  {
+    if ((prompt == null) || (prompt.length() == 0))
+      {
+	throw new IllegalArgumentException("invalid prompt");
+      }
+    this.prompt = prompt;
+  }
+
+  private void setDefaultText(String defaultText) throws IllegalArgumentException
+  {
+    if ((defaultText == null) || (defaultText.length() == 0))
+      {
+	throw new IllegalArgumentException("invalid default text");
+      }
+    this.defaultText = defaultText;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/TextOutputCallback.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/TextOutputCallback.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/TextOutputCallback.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/TextOutputCallback.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,140 @@
+/* TextOutputCallback.java -- callback for text output.
+   Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.callback;
+
+import java.io.Serializable;
+
+/**
+ * <p>Underlying security services instantiate and pass a
+ * <code>TextOutputCallback</code> to the <code>handle()</code> method of a
+ * {@link CallbackHandler} to display information messages, warning messages and
+ * error messages.</p>
+ *
+ * @see CallbackHandler
+ */
+public class TextOutputCallback implements Callback, Serializable
+{
+
+  // Constants and variables
+  // -------------------------------------------------------------------------
+
+  /** Information message */
+  public static final int INFORMATION = 0;
+
+  /** Warning message */
+  public static final int WARNING = 1;
+
+  /** Error message */
+  public static final int ERROR = 2;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private int messageType;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private String message;
+
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * <p>Construct a <code>TextOutputCallback</code> with a message type and
+   * message to be displayed.</p>
+   *
+   * @param messageType the message type (INFORMATION, WARNING or ERROR).
+   * @param message the message to be displayed.
+   * @throws IllegalArgumentException if <code>messageType</code> is not either
+   * <code>INFORMATION</code>, <code>WARNING</code> or <code>ERROR</code>, if
+   * <code>message</code> is <code>null</code>, or if <code>message</code> has
+   * a length of <code>0</code>.
+   */
+  public TextOutputCallback(int messageType, String message)
+    throws IllegalArgumentException
+  {
+    switch (messageType)
+      {
+      case INFORMATION:
+      case WARNING:
+      case ERROR: this.messageType = messageType; break;
+      default: throw new IllegalArgumentException("invalid message type");
+      }
+
+    setMessage(message);
+  }
+
+  // Class methods
+  // -------------------------------------------------------------------------
+
+  // Instance methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * <p>Returns the message's <code>messageType</code>.</p>
+   *
+   * @return the message type (INFORMATION, WARNING or ERROR).
+   */
+  public int getMessageType()
+  {
+    return messageType;
+  }
+
+  /**
+   * <p>Returns the <code>message</code> to be displayed.</p>
+   *
+   * @return the message to be displayed.
+   */
+  public String getMessage()
+  {
+    return message;
+  }
+
+  private void setMessage(String message) throws IllegalArgumentException
+  {
+    if ((message == null) || (message.length() == 0))
+      {
+	throw new IllegalArgumentException("invalid message");
+      }
+    this.message = message;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/UnsupportedCallbackException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/UnsupportedCallbackException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/UnsupportedCallbackException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/UnsupportedCallbackException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,101 @@
+/* UnsupportedCallbackException.java -- signals an unsupported callback type.
+   Copyright (C) 2003, Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.callback;
+
+/**
+ * Signals that a {@link CallbackHandler} does not recognize a particular
+ * {@link Callback}.
+ *
+ */
+public class UnsupportedCallbackException extends Exception
+{
+
+  // Constants and variables
+  // -------------------------------------------------------------------------
+
+  /** @serial */
+  private Callback callback;
+
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs an <code>UnsupportedCallbackException</code> with no detail
+   * message.
+   *
+   * @param callback the unrecognized {@link Callback}.
+   */
+  public UnsupportedCallbackException(Callback callback)
+  {
+    super();
+
+    this.callback = callback;
+  }
+
+  /**
+   * Constructs an <code>UnsupportedCallbackException</code> with the specified
+   * detail message. A detail message is a {@link String} that describes this
+   * particular exception.
+   *
+   * @param callback the unrecognized {@link Callback}.
+   * @param msg the detail message.
+   */
+  public UnsupportedCallbackException(Callback callback, String msg)
+  {
+    super(msg);
+
+    this.callback = callback;
+  }
+
+  // Class methods
+  // -------------------------------------------------------------------------
+
+  // Instance methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Get the unrecognized {@link Callback}.
+   *
+   * @return the unrecognized {@link Callback}.
+   */
+  public Callback getCallback()
+  {
+    return this.callback;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/package.html
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/package.html?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/package.html (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/callback/package.html Thu Nov  8 16:56:19 2007
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.security.auth.callback package.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.security.auth.callback</title></head>
+
+<body>
+<p></p>
+
+</body>
+</html>

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/DelegationPermission.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/DelegationPermission.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/DelegationPermission.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/DelegationPermission.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,136 @@
+/* DelegationPermission.java -- kerberos delegation permission
+   Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.kerberos;
+
+import java.security.BasicPermission;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.util.Enumeration;
+import java.util.Vector;
+
+/**
+ * @since 1.4
+ */
+public final class DelegationPermission
+    extends BasicPermission
+{
+  // FIXME: Enable this when serialization works.
+  // private static final long serialVersionUID = 883133252142523922L;
+
+  /**
+   * Create a new instance with the given name.
+   */
+  public DelegationPermission(String name)
+  {
+    super(name);
+    checkSyntax(name);
+  }
+
+  /**
+   * Create a new instance with the given name and actions.
+   * 
+   * The name consists of two parts: first the subordinate
+   * service principal, then the target service principal.
+   * Each principal is surrounded by quotes; the two are separated
+   * by a space.
+   * 
+   * @param name the name
+   * @param actions the actions; this is ignored
+   */
+  public DelegationPermission(String name, String actions)
+  {
+    super(name, actions);
+    checkSyntax(name);
+  }
+
+  private static void checkSyntax(String name)
+  {
+    int index = name.indexOf('"', 1);
+    int len = name.length();
+    if (name.charAt(0) != '"' || name.charAt(len - 1) != '"'
+        || index == -1 || index + 3 >= len
+        || name.charAt(index + 1) != ' '
+        || name.charAt(index + 2) != '"')
+      // FIXME: better message here.
+      throw new IllegalArgumentException("invalid syntax for principals");
+  }
+
+  public boolean implies(Permission perm)
+  {
+    return equals(perm);
+  }
+
+  public PermissionCollection newPermissionCollection()
+  {
+    // FIXME: don't know how to serialize here.  I suspect this
+    // class has to have a particular name, etc ...
+    return new PermissionCollection()
+    {
+      private Vector permissions = new Vector();
+
+      public void add(Permission perm)
+      {
+        if (isReadOnly())
+          throw new SecurityException("readonly");
+        if (! (perm instanceof DelegationPermission))
+          throw new IllegalArgumentException("can only add DelegationPermissions");
+        permissions.add(perm);
+      }
+
+      public boolean implies(Permission perm)
+      {
+        if (! (perm instanceof DelegationPermission))
+          return false;
+        Enumeration e = elements();
+        while (e.hasMoreElements())
+          {
+            DelegationPermission dp = (DelegationPermission) e.nextElement();
+            if (dp.implies(perm))
+              return true;
+          }
+        return false;
+      }
+
+      public Enumeration elements()
+      {
+        return permissions.elements();
+      }
+    };
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KerberosKey.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KerberosKey.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KerberosKey.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KerberosKey.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,180 @@
+/* KerberosKey.java -- kerberos key
+   Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.kerberos;
+
+import gnu.classpath.NotImplementedException;
+
+import java.io.Serializable;
+
+import javax.crypto.SecretKey;
+import javax.security.auth.DestroyFailedException;
+import javax.security.auth.Destroyable;
+
+/**
+ * This class represents a Kerberos key.  See the Kerberos
+ * authentication RFC for more information:
+ * <a href="http://www.ietf.org/rfc/rfc1510.txt">RFC 1510</a>.
+ * 
+ * @since 1.4
+ */
+public class KerberosKey
+    implements Serializable, SecretKey, Destroyable
+{
+  private static final long serialVersionUID = -4625402278148246993L;
+
+  private KerberosPrincipal principal;
+  private int versionNum;
+  private KeyImpl key;
+
+  /**
+   * Construct a new key with the indicated principal and key.
+   * @param principal the principal
+   * @param key the key's data
+   * @param type the key's type
+   * @param version the key's version number
+   */
+  public KerberosKey(KerberosPrincipal principal, byte[] key, int type,
+                     int version)
+  {
+    this.principal = principal;
+    this.versionNum = version;
+    this.key = new KeyImpl(key, type);
+  }
+
+  /**
+   * Construct a new key with the indicated principal and a password.
+   * @param principal the principal
+   * @param passwd the password to use
+   * @param algo the algorithm; if null the "DES" algorithm is used
+   */
+  public KerberosKey(KerberosPrincipal principal, char[] passwd, String algo)
+  // Not implemented because KeyImpl really does nothing here.
+    throws NotImplementedException
+  {
+    this.principal = principal;
+    this.versionNum = 0; // FIXME: correct?
+    this.key = new KeyImpl(passwd, algo);
+  }
+
+  /**
+   * Return the name of the algorithm used to create this key.
+   */
+  public final String getAlgorithm()
+  {
+    checkDestroyed();
+    return key.algorithm;
+  }
+
+  /**
+   * Return the format of this key.  This implementation always returns "RAW".
+   */
+  public final String getFormat()
+  {
+    checkDestroyed();
+    // Silly, but specified.
+    return "RAW";
+  }
+
+  /**
+   * Return the principal associated with this key.
+   */
+  public final KerberosPrincipal getPrincipal()
+  {
+    checkDestroyed();
+    return principal;
+  }
+
+  /**
+   * Return the type of this key.
+   */
+  public final int getKeyType()
+  {
+    checkDestroyed();
+    return key.type;
+  }
+
+  /**
+   * Return the version number of this key.
+   */
+  public final int getVersionNumber()
+  {
+    checkDestroyed();
+    return versionNum;
+  }
+
+  /**
+   * Return the encoded form of this key.
+   */
+  public final byte[] getEncoded()
+  {
+    checkDestroyed();
+    return (byte[]) key.key.clone();
+  }
+
+  /**
+   * Destroy this key.
+   */
+  public void destroy() throws DestroyFailedException
+  {
+    if (key == null)
+      throw new DestroyFailedException("already destroyed");
+    key = null;
+  }
+
+  /**
+   * Return true if this key has been destroyed.  After this has been
+   * called, other methods on this object will throw IllegalStateException.
+   */
+  public boolean isDestroyed()
+  {
+    return key == null;
+  }
+
+  private void checkDestroyed()
+  {
+    if (key == null)
+      throw new IllegalStateException("key is destroyed");
+  }
+
+  public String toString()
+  {
+    // FIXME: random choice here.
+    return principal + ":" + versionNum;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KerberosPrincipal.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KerberosPrincipal.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KerberosPrincipal.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KerberosPrincipal.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,207 @@
+/* KerberosPrincipal.java -- a kerberos principal
+   Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.kerberos;
+
+import gnu.classpath.NotImplementedException;
+import gnu.classpath.SystemProperties;
+
+import java.io.Serializable;
+import java.security.Principal;
+
+/**
+ * This represents a Kerberos principal.  See the Kerberos
+ * authentication RFC for more information:
+ * <a href="http://www.ietf.org/rfc/rfc1510.txt">RFC 1510</a>.
+ *
+ * @since 1.4
+ */
+public final class KerberosPrincipal
+    implements Serializable, Principal
+{
+  // Uncomment when serialization is correct.
+  // private static final long serialVersionUID = -7374788026156829911L;
+
+  /**
+   * Constant from the RFC: "Just the name of the principal as in DCE, or
+   * for users".
+   */
+  public static final int KRB_NT_PRINCIPAL = 1;
+
+  /**
+   * Constant from the RFC: "Service and other unique instance (krbtgt)".
+   */
+  public static final int KRB_NT_SRV_HST = 3;
+
+  /**
+   * Constant from the RFC: "Service with host name as instance (telnet,
+   * rcommands)".
+   */
+  public static final int KRB_NT_SRV_INST = 2;
+
+  /**
+   * Constant from the RFC: "Service with host as remaining components".
+   */
+  public static final int KRB_NT_SRV_XHST = 4;
+
+  /**
+   * Constant from the RFC: "Unique ID".
+   */
+  public static final int KRB_NT_UID = 5;
+
+  /**
+   * Constant from the RFC: "Name type not known".
+   */
+  public static final int KRB_NT_UNKNOWN = 0;
+
+  private String name;
+  private int type;
+  private String realm;
+
+  /**
+   * Create a new instance with the given name and a type of
+   * {@link #KRB_NT_PRINCIPAL}.
+   * @param name the principal's name
+   */
+  public KerberosPrincipal(String name)
+  {
+    this(name, KRB_NT_PRINCIPAL);
+  }
+
+  /**
+   * Create a new instance with the given name and type.  The name is
+   * parsed according to the rules in the RFC.  If there is no realm,
+   * then the local realm is used instead.
+   * 
+   * @param name the principal's name
+   * @param type the principal's type
+   */
+  public KerberosPrincipal(String name, int type)
+  // Marked as unimplemented because we don't look for the realm as needed.
+    throws NotImplementedException
+  {
+    if (type < KRB_NT_UNKNOWN || type > KRB_NT_UID)
+      throw new IllegalArgumentException("unknown type: " + type);
+    this.name = name;
+    this.type = type;
+    this.realm = parseRealm();
+  }
+
+  private String parseRealm()
+  {
+    // Handle quoting as specified by the Kerberos RFC.
+    int i, len = name.length();
+    boolean quoted = false;
+    for (i = 0; i < len; ++i)
+      {
+        if (quoted)
+          {
+            quoted = false;
+            continue;
+          }
+        char c = name.charAt(i);
+        if (c == '\\')
+          {
+            quoted = true;
+            continue;
+          }
+        if (c == '@')
+          break;
+      }
+    if (quoted || i == len - 1)
+      throw new IllegalArgumentException("malformed principal: " + name);
+    if (i < len)
+      {
+        // We have the realm.  FIXME: verify its syntax?
+        return name.substring(i + 1);
+      }
+    // Try to find the default realm.
+    String def = SystemProperties.getProperty("java.security.krb5.realm");
+    if (def != null)
+      return def;
+    // Now ask the system.
+    // FIXME: use java.security.krb5.conf,
+    // or $JAVA_HOME/lib/security/krb5.conf to find the krb config file.
+    // Then pass to native code using krb5_set_config_files() and
+    // krb5_get_default_realm().  But... what about /etc/krb5.conf?
+    throw new IllegalArgumentException("default realm can't be found");
+  }
+
+  /**
+   * Return the name of this principal.
+   */
+  public String getName()
+  {
+    return name;
+  }
+
+  /**
+   * Return the realm of this principal.
+   */
+  public String getRealm()
+  {
+    return realm;
+  }
+
+  /**
+   * Return the type of this principal.
+   */
+  public int getNameType()
+  {
+    return type;
+  }
+
+  public int hashCode()
+  {
+    return name.hashCode();
+  }
+
+  public boolean equals(Object other)
+  {
+    if (! (other instanceof KerberosPrincipal))
+      return false;
+    KerberosPrincipal kp = (KerberosPrincipal) other;
+    return name.equals(kp.name) && type == kp.type;
+  }
+
+  public String toString()
+  {
+    // This is what came to mind.
+    return name + ":" + type; 
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KerberosTicket.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KerberosTicket.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KerberosTicket.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KerberosTicket.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,339 @@
+/* KerberosTicket.java -- a kerberos ticket
+   Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.kerberos;
+
+import gnu.classpath.NotImplementedException;
+
+import java.io.Serializable;
+import java.net.InetAddress;
+import java.util.Date;
+
+import javax.crypto.SecretKey;
+import javax.security.auth.DestroyFailedException;
+import javax.security.auth.Destroyable;
+import javax.security.auth.RefreshFailedException;
+import javax.security.auth.Refreshable;
+
+/**
+ * This class represents a Kerberos ticket.  See the Kerberos
+ * authentication RFC for more information:
+ * <a href="http://www.ietf.org/rfc/rfc1510.txt">RFC 1510</a>.
+ * 
+ * @since 1.4
+ */
+public class KerberosTicket
+    implements Destroyable, Serializable, Refreshable
+{
+  private static final long serialVersionUID = 7395334370157380539L;
+
+  // Indices of the various flags.  From the kerberos spec.
+  // We only list the ones we use.
+  private static final int FORWARDABLE = 1;
+  private static final int FORWARDED = 2;
+  private static final int PROXIABLE = 3;
+  private static final int PROXY = 4;
+  private static final int POSTDATED = 6;
+  private static final int RENEWABLE = 8;
+  private static final int INITIAL = 9;
+  private static final int NUM_FLAGS = 12;
+
+  private byte[] asn1Encoding;
+  private KeyImpl sessionKey;
+  private boolean[] flags;
+  private Date authTime;
+  private Date startTime;
+  private Date endTime;
+  private Date renewTill;
+  private KerberosPrincipal client;
+  private KerberosPrincipal server;
+  private InetAddress[] clientAddresses;
+
+  /**
+   * Create a new ticket given all the facts about it.
+   * 
+   * Note that flags may be null or "short"; any flags not specified
+   * will be taken to be false.
+   * 
+   * If the key is not renewable, then renewTill may be null.
+   * 
+   * If authTime is null, then it is taken to be the same as startTime.
+   * 
+   * If clientAddresses is null, then the ticket can be used anywhere.
+   * 
+   * @param asn1Encoding the contents of the ticket, as ASN1
+   * @param client the client principal
+   * @param server the server principal
+   * @param key the contents of the session key
+   * @param type the type of the key
+   * @param flags an array of flags, as specified by the RFC
+   * @param authTime when the client was authenticated
+   * @param startTime starting time at which the ticket is valid
+   * @param endTime ending time, after which the ticket is invalid
+   * @param renewTill for a rewewable ticket, the time before which it must
+   * be renewed
+   * @param clientAddresses a possibly-null array of addresses where this
+   * ticket may be used
+   */
+  public KerberosTicket(byte[] asn1Encoding, KerberosPrincipal client,
+                        KerberosPrincipal server, byte[] key, int type,
+                        boolean[] flags, Date authTime, Date startTime,
+                        Date endTime, Date renewTill,
+                        InetAddress[] clientAddresses)
+  {
+    this.asn1Encoding = (byte[]) asn1Encoding.clone();
+    this.sessionKey = new KeyImpl(key, type);
+    this.flags = new boolean[NUM_FLAGS];
+    if (flags != null)
+      System.arraycopy(flags, 0, this.flags, 0,
+                       Math.min(flags.length, NUM_FLAGS));
+    this.flags = (boolean[]) flags.clone();
+    this.authTime = (Date) authTime.clone();
+    this.startTime = (Date) ((startTime == null)
+                              ? authTime : startTime).clone();
+    this.endTime = (Date) endTime.clone();
+    this.renewTill = (Date) renewTill.clone();
+    this.client = client;
+    this.server = server;
+    this.clientAddresses = (clientAddresses == null
+                            ? null
+                            : (InetAddress[]) clientAddresses.clone());
+  }
+
+  /**
+   * Destroy this ticket.  This discards secret information.  After this
+   * method is called, other methods will throw IllegalStateException.
+   */
+  public void destroy() throws DestroyFailedException
+  {
+    if (sessionKey == null)
+      throw new DestroyFailedException("already destroyed");
+    sessionKey = null;
+    asn1Encoding = null;
+  }
+
+  /**
+   * Return true if this ticket has been destroyed.
+   */
+  public boolean isDestroyed()
+  {
+    return sessionKey == null;
+  }
+
+  /**
+   * Return true if the ticket is currently valid.  This is true if
+   * the system time is between the ticket's start and end times.
+   */
+  public boolean isCurrent()
+  {
+    long now = System.currentTimeMillis();
+    return startTime.getTime() <= now && now <= endTime.getTime();
+  }
+
+  /**
+   * If the ticket is renewable, and the renewal time has not yet elapsed,
+   * attempt to renew the ticket.
+   * @throws RefreshFailedException if the renewal fails for any reason
+   */
+  public void refresh() throws RefreshFailedException, NotImplementedException
+  {
+    if (! isRenewable())
+      throw new RefreshFailedException("not renewable");
+    if (renewTill != null
+        && System.currentTimeMillis() >= renewTill.getTime())
+      throw new RefreshFailedException("renewal time elapsed");
+    // FIXME: must contact the KDC.
+    // Use the java.security.krb5.kdc property...
+    throw new RefreshFailedException("not implemented");
+  }
+
+  /**
+   * Return the client principal for this ticket.
+   */
+  public final KerberosPrincipal getClient()
+  {
+    return client;
+  }
+
+  /**
+   * Return the server principal for this ticket.
+   */
+  public final KerberosPrincipal getServer()
+  {
+    return server;
+  }
+
+  /**
+   * Return true if this ticket is forwardable.
+   */
+  public final boolean isForwardable()
+  {
+    return flags[FORWARDABLE];
+  }
+
+  /**
+   * Return true if this ticket has been forwarded.
+   */
+  public final boolean isForwarded()
+  {
+    return flags[FORWARDED];
+  }
+
+  /**
+   * Return true if this ticket is proxiable.
+   */
+  public final boolean isProxiable()
+  {
+    return flags[PROXIABLE];
+  }
+
+  /**
+   * Return true if this ticket is a proxy ticket.
+   */
+  public final boolean isProxy()
+  {
+    return flags[PROXY];
+  }
+
+  /**
+   * Return true if this ticket was post-dated.
+   */
+  public final boolean isPostdated()
+  {
+    return flags[POSTDATED];
+  }
+
+  /**
+   * Return true if this ticket is renewable.
+   */
+  public final boolean isRenewable()
+  {
+    return flags[RENEWABLE];
+  }
+
+  /**
+   * Return true if this ticket was granted by an application
+   * server, and not via a ticket-granting ticket.
+   */
+  public final boolean isInitial()
+  {
+    return flags[INITIAL];
+  }
+
+  /**
+   * Return the flags for this ticket as a boolean array.
+   * See the RFC to understand what the different entries mean.
+   */
+  public final boolean[] getFlags()
+  {
+    return (boolean[]) flags.clone();
+  }
+
+  /**
+   * Return the authentication time for this ticket.
+   */
+  public final Date getAuthTime()
+  {
+    return (Date) authTime.clone();
+  }
+
+  /**
+   * Return the start time for this ticket.
+   */
+  public final Date getStartTime()
+  {
+    return (Date) startTime.clone();
+  }
+  
+  /**
+   * Return the end time for this ticket.
+   */
+  public final Date getEndTime()
+  {
+    return (Date) endTime.clone();
+  }
+  
+  /**
+   * Return the renewal time for this ticket.  For a non-renewable
+   * ticket, this will return null.
+   */
+  public final Date getRenewTill()
+  {
+    return flags[RENEWABLE] ? ((Date) renewTill.clone()) : null;
+  }
+
+  /**
+   * Return the allowable client addresses for this ticket.  This will
+   * return null if the ticket can be used anywhere.
+   */
+  public final InetAddress[] getClientAddresses()
+  {
+    return (clientAddresses == null
+            ? null
+            : (InetAddress[]) clientAddresses.clone());
+  }
+
+  /**
+   * Return the encoded form of this ticket.
+   */
+  public final byte[] getEncoded()
+  {
+    checkDestroyed();
+    return (byte[]) sessionKey.key.clone();
+  }
+
+  /**
+   * Return the secret key associated with this ticket.
+   */
+  public final SecretKey getSessionKey()
+  {
+    checkDestroyed();
+    return sessionKey;
+  }
+
+  private void checkDestroyed()
+  {
+    if (sessionKey == null)
+      throw new IllegalStateException("key is destroyed");
+  }
+
+  public String toString()
+  {
+    return "FIXME bob";
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KeyImpl.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KeyImpl.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KeyImpl.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/KeyImpl.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,93 @@
+/* KeyImpl.java -- kerberos key implementation
+   Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.kerberos;
+
+import java.io.Serializable;
+
+import javax.crypto.SecretKey;
+
+/**
+ * Note that the name of this class is fixed by the serialization
+ * spec, even though the class itself is not public.
+ */
+final class KeyImpl implements Serializable, SecretKey
+{
+  // Enable this when serialization works.
+  // private static final long serialVersionUID = -7889313790214321193L;
+
+  public String algorithm;
+  public int type;
+  public byte[] key;
+
+  public KeyImpl(byte[] key, int type)
+  {
+    // From kerberos spec.
+    if (type == 0)
+      this.algorithm = null;
+    else if (type == 1)
+      this.algorithm = "DES";
+    else
+      this.algorithm = "FIXME";
+    this.type = type;
+    this.key = (byte[]) key.clone();
+  }
+
+  public KeyImpl(char[] passwd, String algo)
+  {
+    this.algorithm = (algo == null) ? "DES" : algo;
+    this.type = 0; // FIXME
+    this.key = null; // double FIXME
+  }
+
+  public String getAlgorithm()
+  {
+    return algorithm;
+  }
+
+  public byte[] getEncoded()
+  {
+    return key;
+  }
+
+  public String getFormat()
+  {
+    // FIXME.
+    return null;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/ServicePermission.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/ServicePermission.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/ServicePermission.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/kerberos/ServicePermission.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,172 @@
+/* ServicePermission.java -- kerberos service permission
+   Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.kerberos;
+
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.util.Enumeration;
+import java.util.StringTokenizer;
+import java.util.Vector;
+
+/**
+ * This represents permission to access to a Kerberos service principal.
+ * See the Kerberos authentication RFC for more information:
+ * <a href="http://www.ietf.org/rfc/rfc1510.txt">RFC 1510</a>.
+ * 
+ * @since 1.4
+ */
+public final class ServicePermission
+    extends Permission
+{
+  // FIXME: Enable this when serialization works.
+  // private static final long serialVersionUID = -1227585031618624935L;
+
+  private static final int INITIATE = 1;
+  private static final int ACCEPT = 2;
+
+  private int flags;
+
+  /**
+   * Create a new service permission with the indicated name and actions.
+   * 
+   * The name is the name of the kerberos principal for the service.
+   * 
+   * The actions are a comma-separated list of strings.  The recognized
+   * actions are "initiate" and "accept".  The "initiate" action means
+   * that the holder of the permission can access the service.  The
+   * "accept" action means that the holder of the permission can operate
+   * as this service.
+   * 
+   * @param name the prinicpal's name
+   * @param action the allowed actions
+   */
+  public ServicePermission(String name, String action)
+  {
+    super(name);
+    parseActions(action);
+  }
+
+  public boolean implies(Permission perm)
+  {
+    if (! (perm instanceof ServicePermission))
+      return false;
+    ServicePermission sp = (ServicePermission) perm;
+    if ((flags & sp.flags) != sp.flags)
+      return false;
+    return getName().equals(sp.getName());
+  }
+
+  public boolean equals(Object obj)
+  {
+    if (! (obj instanceof ServicePermission))
+      return false;
+    ServicePermission sp = (ServicePermission) obj;
+    return flags == sp.flags && getName().equals(sp.getName());
+  }
+
+  public int hashCode()
+  {
+    return getName().hashCode() + flags;
+  }
+
+  /**
+   * Return a string representing the actions.
+   */
+  public String getActions()
+  {
+    if (flags == (INITIATE | ACCEPT))
+      return "initiate,accept";
+    if (flags == INITIATE)
+      return "initiate";
+    if (flags == ACCEPT)
+      return "accept";
+    return "";
+  }
+
+  public PermissionCollection newPermissionCollection()
+  {
+    return new PermissionCollection()
+    {
+      private Vector permissions = new Vector();
+
+      public void add(Permission perm)
+      {
+        if (isReadOnly())
+          throw new SecurityException("readonly");
+        if (! (perm instanceof ServicePermission))
+          throw new IllegalArgumentException("can only add DelegationPermissions");
+        permissions.add(perm);
+      }
+
+      public boolean implies(Permission perm)
+      {
+        if (! (perm instanceof ServicePermission))
+          return false;
+        Enumeration e = elements();
+        while (e.hasMoreElements())
+          {
+            ServicePermission sp = (ServicePermission) e.nextElement();
+            if (sp.implies(perm))
+              return true;
+          }
+        return false;
+      }
+
+      public Enumeration elements()
+      {
+        return permissions.elements();
+      }
+    };
+  }
+
+  private void parseActions(String actions)
+  {
+    StringTokenizer tok = new StringTokenizer(actions, ",");
+    while (tok.hasMoreTokens())
+      {
+        String token = tok.nextToken();
+        if ("accept".equals(token))
+          flags |= ACCEPT;
+        else if ("initiate".equals(token))
+          flags |= INITIATE;
+        else
+          throw new IllegalArgumentException("unrecognized token: " + token);
+      }
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,64 @@
+/* AccountException.java -- generic account exception
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.login;
+
+/**
+ * This is the base class for various account-related exceptions.
+ * @since 1.5
+ */
+public class AccountException extends LoginException
+{
+  private static final long serialVersionUID = -2112878680072211787L;
+
+  /**
+   * Create a new exception object.
+   */
+  public AccountException()
+  {
+  }
+
+  /**
+   * Create a new exception with the indicated detail message.
+   * @param message the detail message
+   */
+  public AccountException(String message)
+  {
+    super(message);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountExpiredException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountExpiredException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountExpiredException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountExpiredException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,64 @@
+/* AccountExpiredException.java
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.login;
+
+/**
+ * An exception that signals that an attempt was made to login to an account
+ * that has expired.
+ */
+public class AccountExpiredException extends AccountException
+{
+
+  // Constant.
+  // -------------------------------------------------------------------------
+
+  private static final long serialVersionUID = -6064064890162661560L;
+
+  // Constructors.
+  // -------------------------------------------------------------------------
+
+  public AccountExpiredException()
+  {
+  }
+
+  public AccountExpiredException (String message)
+  {
+    super (message);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountLockedException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountLockedException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountLockedException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountLockedException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,64 @@
+/* AccountLockedException.java -- exception indicating locked account
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.login;
+
+/**
+ * An exception indicating that an account is locked.
+ * @since 1.5
+ */
+public class AccountLockedException extends AccountException
+{
+  private static final long serialVersionUID = 8280345554014066334L;
+
+  /**
+   * Create a new exception object.
+   */
+  public AccountLockedException()
+  {
+  }
+
+  /**
+   * Create a new exception with the indicated detail message.
+   * @param message the detail message
+   */
+  public AccountLockedException(String message)
+  {
+    super(message);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountNotFoundException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountNotFoundException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountNotFoundException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AccountNotFoundException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,64 @@
+/* AccountNotFoundException.java -- exception indicating account not found
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.login;
+
+/**
+ * An exception indicating that an account was not found.
+ * @since 1.5 
+ */
+public class AccountNotFoundException extends AccountException
+{
+  private static final long serialVersionUID = 1498349563916294614L;
+
+  /**
+   * Create a new exception object.
+   */
+  public AccountNotFoundException()
+  {
+  }
+
+  /**
+   * Create a new exception with the given detail message.
+   * @param message the detail message
+   */
+  public AccountNotFoundException(String message)
+  {
+    super(message);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AppConfigurationEntry.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AppConfigurationEntry.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AppConfigurationEntry.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/AppConfigurationEntry.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,143 @@
+/* AppConfigurationEntry.java
+   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.login;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+public class AppConfigurationEntry
+{
+  // Fields.
+  // -------------------------------------------------------------------------
+
+  private final String loginModuleName;
+  private final LoginModuleControlFlag controlFlag;
+  private final Map options;
+
+  // Constructor.
+  // -------------------------------------------------------------------------
+
+  public AppConfigurationEntry (final String loginModuleName,
+                                final LoginModuleControlFlag controlFlag,
+                                final Map options)
+  {
+    if (loginModuleName == null || loginModuleName.length() == 0)
+      throw new IllegalArgumentException ("module name cannot be null nor empty");
+
+    if (LoginModuleControlFlag.OPTIONAL != controlFlag &&
+        LoginModuleControlFlag.REQUIRED != controlFlag &&
+        LoginModuleControlFlag.REQUISITE != controlFlag &&
+        LoginModuleControlFlag.SUFFICIENT != controlFlag)
+      throw new IllegalArgumentException ("invalid controlFlag");
+
+    if (options == null)
+      throw new IllegalArgumentException ("options cannot be null");
+
+    this.loginModuleName = loginModuleName;
+    this.controlFlag = controlFlag;
+    this.options = Collections.unmodifiableMap (new HashMap (options));
+  }
+
+  // Instance methods.
+  // -------------------------------------------------------------------------
+
+  public LoginModuleControlFlag getControlFlag()
+  {
+    return controlFlag;
+  }
+
+  public String getLoginModuleName()
+  {
+    return loginModuleName;
+  }
+
+  public Map getOptions()
+  {
+    return options;
+  }
+
+  // Object methods ----------------------------------------------------------
+
+  public String toString()
+  {
+    
+    return loginModuleName + "\t"
+        + String.valueOf(controlFlag) + "\t"
+        + String.valueOf(options);
+  }
+
+  // Inner class.
+  // -------------------------------------------------------------------------
+
+  public static class LoginModuleControlFlag
+  {
+
+    // Constants.
+    // -----------------------------------------------------------------------
+
+    public static final LoginModuleControlFlag OPTIONAL = new LoginModuleControlFlag();
+    public static final LoginModuleControlFlag REQUIRED = new LoginModuleControlFlag();
+    public static final LoginModuleControlFlag REQUISITE = new LoginModuleControlFlag();
+    public static final LoginModuleControlFlag SUFFICIENT = new LoginModuleControlFlag();
+
+    // Constructor.
+    // -----------------------------------------------------------------------
+
+    private LoginModuleControlFlag()
+    {
+    }
+
+    // Instance methods.
+    // -----------------------------------------------------------------------
+
+    public String toString()
+    {
+      if (this == LoginModuleControlFlag.REQUIRED)
+        return "REQUIRED";
+      if (this == LoginModuleControlFlag.REQUISITE)
+        return "REQUISITE";
+      if (this == LoginModuleControlFlag.SUFFICIENT)
+        return "SUFFICIENT";
+      if (this == LoginModuleControlFlag.OPTIONAL)
+        return "OPTIONAL";
+      return "???";
+    }
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/Configuration.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/Configuration.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/Configuration.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/Configuration.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,121 @@
+/* Configuration.java
+   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.login;
+
+import gnu.javax.security.auth.login.GnuConfiguration;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.Security;
+
+import javax.security.auth.AuthPermission;
+
+public abstract class Configuration
+{
+  // Fields.
+  // -------------------------------------------------------------------------
+
+  private static Configuration config;
+
+  // Constructors.
+  // -------------------------------------------------------------------------
+
+  protected Configuration()
+  {
+  }
+
+  // Class methods.
+  // -------------------------------------------------------------------------
+
+  public static synchronized Configuration getConfiguration()
+  {
+    SecurityManager sm = System.getSecurityManager();
+    if (sm != null)
+      sm.checkPermission (new AuthPermission ("getLoginConfiguration"));
+    return getConfig();
+  }
+
+  public static synchronized void setConfiguration (Configuration config)
+  {
+    SecurityManager sm = System.getSecurityManager();
+    if (sm != null)
+      sm.checkPermission (new AuthPermission ("setLoginConfiguration"));
+    Configuration.config = config;
+  }
+
+  // Abstract methods.
+  // -------------------------------------------------------------------------
+
+  public abstract AppConfigurationEntry[] getAppConfigurationEntry (String applicationName);
+
+  public abstract void refresh();
+
+  // Package-private methods.
+  // -------------------------------------------------------------------------
+
+  /**
+   * Get the current configuration, bypassing security checks.
+   */
+  static Configuration getConfig()
+  {
+    if (config == null)
+      {
+        String conf = (String) AccessController.doPrivileged
+          (new PrivilegedAction()
+            {
+              public Object run()
+              {
+                return Security.getProperty ("login.configuration.provider");
+              }
+            });
+        try
+          {
+            if (conf != null)
+              config = (Configuration) Class.forName (conf).newInstance();
+            else
+              config = new GnuConfiguration();
+          }
+        catch (Exception x)
+          {
+            config = new GnuConfiguration();
+          }
+      }
+    return config;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/CredentialException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/CredentialException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/CredentialException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/CredentialException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,64 @@
+/* CredentialException.java -- generic credential exception
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.login;
+
+/**
+ * This is the base class for various credential-related exceptions.
+ * @since 1.5
+ */
+public class CredentialException extends LoginException
+{
+  private static final long serialVersionUID = -4772893876810601859L;
+
+  /**
+   * Create a new exception object.
+   */
+  public CredentialException()
+  {
+  }
+
+  /**
+   * Create a new exception with the given detail message.
+   * @param message the detail message
+   */
+  public CredentialException(String message)
+  {
+    super(message);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/CredentialExpiredException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/CredentialExpiredException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/CredentialExpiredException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/CredentialExpiredException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,64 @@
+/* CredentialExpiredException.java
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.login;
+
+/**
+ * An exception that signals an attempt to login with a credential that
+ * has expired.
+ */
+public class CredentialExpiredException extends CredentialException
+{
+
+  // Constant.
+  // -------------------------------------------------------------------------
+
+  private static final long serialVersionUID = -5344739593859737937L;
+
+  // Constructors.
+  // -------------------------------------------------------------------------
+
+  public CredentialExpiredException()
+  {
+  }
+
+  public CredentialExpiredException (String message)
+  {
+    super (message);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/CredentialNotFoundException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/CredentialNotFoundException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/CredentialNotFoundException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/CredentialNotFoundException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,65 @@
+/* CredentialNotFoundException.java -- exception thrown when credentials
+   expire
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.login;
+
+/**
+ * An exception that indicates that a credential was not found.
+ * @since 1.5
+ */
+public class CredentialNotFoundException extends CredentialException
+{
+  private static final long serialVersionUID = -7779934467214319475L;
+
+  /**
+   * Create a new exception.
+   */
+  public CredentialNotFoundException()
+  {
+  }
+
+  /**
+   * Create a new exception with the given detail message.
+   * @param message the detail message
+   */
+  public CredentialNotFoundException(String message)
+  {
+    super(message);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/FailedLoginException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/FailedLoginException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/FailedLoginException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/FailedLoginException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,63 @@
+/* FailedLoginException.java
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.login;
+
+/**
+ * An exception that signals that an attempt to login was unsuccessful.
+ */
+public class FailedLoginException extends LoginException
+{
+
+  // Constant.
+  // -------------------------------------------------------------------------
+
+  private static final long serialVersionUID = 802556922354616286L;
+
+  // Constructors.
+  // -------------------------------------------------------------------------
+
+  public FailedLoginException()
+  {
+  }
+
+  public FailedLoginException (String message)
+  {
+    super (message);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/LoginContext.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/LoginContext.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/LoginContext.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/LoginContext.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,265 @@
+/* LoginContext.java
+   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.login;
+
+import gnu.java.security.action.GetSecurityPropertyAction;
+
+import java.security.AccessController;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.security.auth.Subject;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.spi.LoginModule;
+
+public class LoginContext
+{
+
+  private static final String OTHER = "other";
+
+  private final String name;
+  private final CallbackHandler cbHandler;
+  private final Subject subject;
+  private final AppConfigurationEntry[] entries;
+  private final LoginModule[] modules;
+  private final Map sharedState;
+
+  public LoginContext (final String name) throws LoginException
+  {
+    this (name, new Subject(), defaultHandler());
+  }
+
+  public LoginContext (final String name, final CallbackHandler cbHandler)
+    throws LoginException
+  {
+    this (name, new Subject(), cbHandler);
+  }
+
+  public LoginContext (final String name, final Subject subject)
+    throws LoginException
+  {
+    this (name, subject, defaultHandler());
+  }
+
+  public LoginContext (final String name, final Subject subject,
+                       final CallbackHandler cbHandler)
+    throws LoginException
+  {
+    this (name, subject, cbHandler, null);
+  }
+
+  /** @since 1.5 */
+  public LoginContext (final String name, final Subject subject,
+                       final CallbackHandler cbHandler,
+                       Configuration config)
+    throws LoginException
+  {
+    this.name = name;
+    this.subject = subject;
+    this.cbHandler = cbHandler;
+    if (config == null)
+      config = Configuration.getConfig();
+    AppConfigurationEntry[] entries = config.getAppConfigurationEntry (name);
+    if (entries == null)
+      entries = config.getAppConfigurationEntry (OTHER);
+    if (entries == null)
+      throw new LoginException ("no configured modules for application "
+                                + name);
+    this.entries = entries;
+    modules = new LoginModule[entries.length];
+    sharedState = new HashMap();
+    for (int i = 0; i < entries.length; i++)
+      modules[i] = lookupModule (entries[i], subject, sharedState);
+  }
+
+  /**
+   * Returns the authenticated subject, or the parameter passed to one
+   * of the constructors. <code>null</code> is returned if the previous
+   * login attempt failed and there was no subject provided.
+   *
+   * @return The subject, or null.
+   */
+  public Subject getSubject()
+  {
+    return subject;
+  }
+
+  /**
+   * Logs a subject in, using all login modules configured for this
+   * application. This method will call the {@link LoginModule#login()}
+   * method of each module configured for this application, stopping
+   * if a REQUISITE module fails or if a SUFFICIENT module succeeds. If
+   * the overall login attempt fails, a {@link LoginException} will be
+   * thrown.
+   *
+   * @throws LoginException If logging in fails.
+   */
+  public void login() throws LoginException
+  {
+    boolean failure = false;
+    for (int i = 0; i < modules.length; i++)
+      {
+        try
+          {
+            boolean result = modules[i].login();
+            if (!result)
+              {
+                if (entries[i].getControlFlag() ==
+                    AppConfigurationEntry.LoginModuleControlFlag.REQUISITE)
+                  throw new LoginException ("REQUISITE module " + entries[i].getLoginModuleName()
+                                            + " failed");
+                else if (entries[i].getControlFlag() ==
+                         AppConfigurationEntry.LoginModuleControlFlag.REQUIRED)
+                  failure = true;
+              }
+            else
+              {
+                if (entries[i].getControlFlag() ==
+                    AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT)
+                  break;
+              }
+          }
+        catch (LoginException le)
+          {
+            if (entries[i].getControlFlag() !=
+                AppConfigurationEntry.LoginModuleControlFlag.REQUISITE)
+              continue;
+            for (int j = 0; j < modules.length; j++)
+              modules[i].abort();
+            throw le;
+          }
+      }
+    if (failure)
+      throw new LoginException ("not all REQUIRED modules succeeded");
+
+    for (int i = 0; i < modules.length; i++)
+      modules[i].commit();
+  }
+
+  /**
+   * Logs a subject out, cleaning up any state that may be in memory.
+   *
+   * @throws LoginException If logging out fails.
+   */
+  public void logout() throws LoginException
+  {
+    for (int i = 0; i < modules.length; i++)
+      modules[i].logout();
+  }
+
+  // Own methods.
+
+  /**
+   * Fetch the default callback handler, based on the
+   * auth.login.defaultCallbackHandler property, or null if it is not
+   * set.
+   */
+  private static CallbackHandler defaultHandler()
+  {
+    GetSecurityPropertyAction act =
+      new GetSecurityPropertyAction ("auth.login.defaultCallbackHandler");
+    String classname = (String) AccessController.doPrivileged (act);
+    if (classname != null)
+      {
+        try
+          {
+            return (CallbackHandler) Class.forName (classname).newInstance();
+          }
+        catch (ClassNotFoundException cnfe)
+          {
+            return null;
+          }
+        catch (ClassCastException cce)
+          {
+            return null;
+          }
+        catch (IllegalAccessException iae)
+          {
+            return null;
+          }
+        catch (InstantiationException ie)
+          {
+            return null;
+          }
+      }
+    return null;
+  }
+
+  private LoginModule lookupModule (AppConfigurationEntry entry,
+                                    Subject subject, Map sharedState)
+    throws LoginException
+  {
+    LoginModule module = null;
+    Exception cause = null;
+    try
+      {
+	ClassLoader cl = Thread.currentThread().getContextClassLoader();
+	Class c = Class.forName(entry.getLoginModuleName(), true, cl);
+	module = (LoginModule) c.newInstance();
+      }
+    catch (ClassNotFoundException cnfe)
+      {
+        cause = cnfe;
+      }
+    catch (ClassCastException cce)
+      {
+        cause = cce;
+      }
+    catch (IllegalAccessException iae)
+      {
+        cause = iae;
+      }
+    catch (InstantiationException ie)
+      {
+        cause = ie;
+      }
+
+    if (cause != null)
+      {
+        LoginException le = new LoginException ("could not load module "
+                                                + entry.getLoginModuleName());
+        le.initCause (cause);
+        throw le;
+      }
+
+    module.initialize (subject, cbHandler, sharedState, entry.getOptions());
+    return module;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/LoginException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/LoginException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/LoginException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/LoginException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,65 @@
+/* LoginException.java
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.login;
+
+import java.security.GeneralSecurityException;
+
+/**
+ * A general exception during authentication and authorization.
+ */
+public class LoginException extends GeneralSecurityException
+{
+
+  // Constant.
+  // -------------------------------------------------------------------------
+
+  private static final long serialVersionUID = -4679091624035232488L;
+
+  // Constructors.
+  // -------------------------------------------------------------------------
+
+  public LoginException()
+  {
+  }
+
+  public LoginException (String message)
+  {
+    super (message);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/NullConfiguration.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/NullConfiguration.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/NullConfiguration.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/NullConfiguration.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,62 @@
+/* NullConfiguration.java -- no-op default login configuration.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.login;
+
+final class NullConfiguration extends Configuration
+{
+
+  // Contructor.
+  // -------------------------------------------------------------------------
+
+  NullConfiguration()
+  {
+  }
+
+  // Instance methods.
+  // -------------------------------------------------------------------------
+
+  public AppConfigurationEntry[] getAppConfigurationEntry (String applicationName)
+  {
+    return null;
+  }
+
+  public void refresh()
+  {
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/package.html
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/package.html?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/package.html (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/login/package.html Thu Nov  8 16:56:19 2007
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.security.auth.login package.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.security.auth.login</title></head>
+
+<body>
+<p></p>
+
+</body>
+</html>

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/package.html
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/package.html?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/package.html (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/package.html Thu Nov  8 16:56:19 2007
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.security.auth package.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.security.auth</title></head>
+
+<body>
+<p></p>
+
+</body>
+</html>

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/spi/LoginModule.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/spi/LoginModule.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/spi/LoginModule.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/spi/LoginModule.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,122 @@
+/* LoginModule.java -- interface for login implementations.
+   Copyright (C) 2004  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.spi;
+
+import java.util.Map;
+
+import javax.security.auth.Subject;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.login.LoginException;
+
+/**
+ * The base interface for login methods in the Java Authentication and
+ * Authorization Service (JAAS).
+ *
+ * <p>This interface is used by service providers that implement login
+ * services, and is used internally by the JAAS system. It is not useful
+ * to application programmers, who should use the {@link
+ * javax.security.auth.login.LoginContext} instead.
+ *
+ * @author Casey Marshall (csm at gnu.org)
+ */
+public interface LoginModule
+{
+  /**
+   * Abort the current login attempt. This is called after {@link #login()}
+   * if the overall login attempt fails (that is, if one of the other login
+   * modules that is REQUIRED or REQUISITE fails). This method should clean
+   * up this module's saved state, if any.
+   *
+   * @return True if the abort succeeded, or false if this module should
+   * be ignored.
+   * @throws LoginException If the abort fails.
+   */
+  boolean abort() throws LoginException;
+
+  /**
+   * Commit the current login attempt. This is called after {@link
+   * #login()} if the overall login attempt succeeds (that is, all
+   * methods have satisfied all REQUIRED, REQUISITE, SUFFICIENT and
+   * OPTIONAL module requirements).
+   *
+   * @return True if the commit succeeded, or false if this module
+   * should be ignored.
+   * @throws LoginException If the commit fails.
+   */
+  boolean commit() throws LoginException;
+
+  /**
+   * Initializes this login module. This method is called when the
+   * instance implementing this interface is instantiated, and should
+   * perform any initialization based on the given parameters.
+   * Implementations should ignore state variables and options they do
+   * not recognize.
+   *
+   * @param subject The subject being authenticated.
+   * @param handler The callback handler for user input.
+   * @param sharedState A mapping that is shared between all login
+   * modules.
+   * @param options A mapping of options given to this module.
+   */
+  void initialize(Subject subject, CallbackHandler handler,
+                  Map sharedState, Map options);
+
+  /**
+   * Authenticates a subject to the system. This is the primary
+   * mechanism by which subjects are authenticated, and typically
+   * implementations will ask for credentials (for example, a user
+   * name and password) which will then be verified.
+   *
+   * @return True if the subject was authenticated, or false if this
+   * module should be ignored.
+   * @throws LoginException If this method fails.
+   */
+  boolean login() throws LoginException;
+
+  /**
+   * Logs a subject out. This is primarily used for modules that must
+   * destroy or remove the authentication state associated with a
+   * logged-in subject.
+   *
+   * @return True if the logout succeeds, or false if this module
+   * should be ignored.
+   * @throws LoginException If this method fails.
+   */
+  boolean logout() throws LoginException;
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/spi/package.html
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/spi/package.html?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/spi/package.html (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/spi/package.html Thu Nov  8 16:56:19 2007
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.security.auth.spi package.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.security.auth.spi</title></head>
+
+<body>
+<p></p>
+
+</body>
+</html>

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/x500/X500Principal.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/x500/X500Principal.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/x500/X500Principal.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/x500/X500Principal.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,554 @@
+/* X500Principal.java -- X.500 principal.
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.x500;
+
+import gnu.java.security.OID;
+import gnu.java.security.der.DER;
+import gnu.java.security.der.DERReader;
+import gnu.java.security.der.DERValue;
+
+import java.io.ByteArrayInputStream;
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.NotActiveException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Reader;
+import java.io.Serializable;
+import java.io.StringReader;
+
+import java.security.Principal;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+public final class X500Principal implements Principal, Serializable
+{
+  private static final long serialVersionUID = -500463348111345721L;
+
+  // Constants and fields.
+  // ------------------------------------------------------------------------
+
+  public static final String CANONICAL = "CANONICAL";
+  public static final String RFC1779 = "RFC1779";
+  public static final String RFC2253 = "RFC2253";
+
+  private static final OID CN         = new OID("2.5.4.3");
+  private static final OID C          = new OID("2.5.4.6");
+  private static final OID L          = new OID("2.5.4.7");
+  private static final OID ST         = new OID("2.5.4.8");
+  private static final OID STREET     = new OID("2.5.4.9");
+  private static final OID O          = new OID("2.5.4.10");
+  private static final OID OU         = new OID("2.5.4.11");
+  private static final OID DC         = new OID("0.9.2342.19200300.100.1.25");
+  private static final OID UID        = new OID("0.9.2342.19200300.100.1.1");
+
+  private transient List components;
+  private transient Map currentRdn;
+  private transient boolean fixed;
+  private transient byte[] encoded;
+
+  // Constructors.
+  // ------------------------------------------------------------------------
+
+  private X500Principal()
+  {
+    components = new LinkedList();
+    currentRdn = new LinkedHashMap();
+    components.add (currentRdn);
+  }
+
+  public X500Principal (String name)
+  {
+    this();
+    if (name == null)
+      throw new NullPointerException();
+    try
+      {
+        parseString (name);
+      }
+    catch (IOException ioe)
+      {
+        IllegalArgumentException iae = new IllegalArgumentException("malformed name");
+        iae.initCause (ioe);
+        throw iae;
+      }
+  }
+
+  public X500Principal (byte[] encoded)
+  {
+    this(new ByteArrayInputStream (encoded));
+  }
+
+  public X500Principal (InputStream encoded)
+  {
+    this();
+    try
+      {
+        parseDer (encoded);
+      }
+    catch (IOException ioe)
+      {
+        throw new IllegalArgumentException (ioe.toString());
+      }
+  }
+
+  // Instance methods.
+  // ------------------------------------------------------------------------
+
+  public int hashCode()
+  {
+    int result = size();
+    for (int i = 0; i < size(); ++i)
+      {
+        Map m = (Map) components.get(i);
+        for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); )
+          {
+            Map.Entry e = (Map.Entry) it2.next();
+            // We don't bother looking at the value of the entry.
+            result = result * 31 + ((OID) e.getKey()).hashCode();
+          }
+      }
+    return result;
+  }
+
+  public boolean equals(Object o)
+  {
+    if (!(o instanceof X500Principal))
+      return false;
+    if (size() != ((X500Principal) o).size())
+      return false;
+    for (int i = 0; i < size(); i++)
+      {
+        Map m = (Map) components.get (i);
+        for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); )
+          {
+            Map.Entry e = (Map.Entry) it2.next();
+            OID oid = (OID) e.getKey();
+            String v1 = (String) e.getValue();
+            String v2 = ((X500Principal) o).getComponent (oid, i);
+            if (v2 == null)
+              return false;
+            if (!compressWS (v1).equalsIgnoreCase (compressWS (v2)))
+              return false;
+          }
+      }
+    return true;
+  }
+
+  public byte[] getEncoded()
+  {
+    if (encoded == null)
+      encodeDer();
+    return (byte[]) encoded.clone();
+  }
+
+  public String getName()
+  {
+    return getName (RFC2253);
+  }
+
+  public String getName (final String format)
+  {
+    boolean rfc2253 = RFC2253.equalsIgnoreCase (format) ||
+      CANONICAL.equalsIgnoreCase (format);
+    boolean rfc1779 = RFC1779.equalsIgnoreCase (format);
+    boolean canon   = CANONICAL.equalsIgnoreCase (format);
+    if (! (rfc2253 || rfc1779 || canon))
+      throw new IllegalArgumentException ("unsupported format " + format);
+    StringBuffer str = new StringBuffer();
+    for (Iterator it = components.iterator(); it.hasNext(); )
+      {
+        Map m = (Map) it.next();
+        for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); )
+          {
+            Map.Entry entry = (Map.Entry) it2.next();
+            OID oid = (OID) entry.getKey();
+            String value = (String) entry.getValue();
+            if (oid.equals (CN))
+              str.append ("CN");
+            else if (oid.equals (C))
+              str.append ("C");
+            else if (oid.equals (L))
+              str.append ("L");
+            else if (oid.equals (ST))
+              str.append ("ST");
+            else if (oid.equals (STREET))
+              str.append ("STREET");
+            else if (oid.equals (O))
+              str.append ("O");
+            else if (oid.equals (OU))
+              str.append ("OU");
+            else if (oid.equals (DC) && rfc2253)
+              str.append ("DC");
+            else if (oid.equals (UID) && rfc2253)
+              str.append ("UID");
+            else
+              str.append (oid.toString());
+            str.append('=');
+            str.append(value);
+            if (it2.hasNext())
+              str.append('+');
+          }
+        if (it.hasNext())
+          str.append(',');
+      }
+    if (canon)
+      return str.toString().toUpperCase (Locale.US).toLowerCase (Locale.US);
+    return str.toString();
+  }
+
+  public String toString()
+  {
+    return getName (RFC2253);
+  }
+
+  // Serialization methods.
+  // ------------------------------------------------------------------------
+
+  private void writeObject (ObjectOutputStream out) throws IOException
+  {
+    if (encoded != null)
+      encodeDer();
+    out.writeObject (encoded);
+  }
+
+  private void readObject (ObjectInputStream in)
+    throws IOException, NotActiveException, ClassNotFoundException
+  {
+    byte[] buf = (byte[]) in.readObject();
+    parseDer (new ByteArrayInputStream (buf));
+  }
+
+  // Own methods.
+  // -------------------------------------------------------------------------
+
+  private int size()
+  {
+    return components.size();
+  }
+
+  private String getComponent(OID oid, int rdn)
+  {
+    if (rdn >= size())
+      return null;
+    return (String) ((Map) components.get (rdn)).get (oid);
+  }
+
+  private void encodeDer()
+  {
+    ArrayList name = new ArrayList(components.size());
+    for (Iterator it = components.iterator(); it.hasNext(); )
+      {
+        Map m = (Map) it.next();
+        if (m.isEmpty())
+          continue;
+        Set rdn = new HashSet();
+        for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); )
+          {
+            Map.Entry e = (Map.Entry) it2.next();
+            ArrayList atav = new ArrayList(2);
+            atav.add(new DERValue(DER.OBJECT_IDENTIFIER, e.getKey()));
+            atav.add(new DERValue(DER.UTF8_STRING, e.getValue()));
+            rdn.add(new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, atav));
+          }
+        name.add(new DERValue(DER.SET|DER.CONSTRUCTED, rdn));
+      }
+    DERValue val = new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, name);
+    encoded = val.getEncoded();
+  }
+
+  private int sep;
+
+  private void parseString(String str) throws IOException
+  {
+    Reader in = new StringReader(str);
+    while (true)
+      {
+        String key = readAttributeType(in);
+        if (key == null)
+          break;
+        String value = readAttributeValue(in);
+        putComponent(key, value);
+        if (sep == ',')
+          newRelativeDistinguishedName();
+        if (sep == -1)
+          break;
+      }
+  }
+
+  private String readAttributeType(Reader in) throws IOException
+  {
+    StringBuffer buf = new StringBuffer();
+    int ch;
+    while ((ch = in.read()) != '=')
+      {
+        if (ch == -1)
+          {
+            if (buf.length() > 0)
+              throw new EOFException("partial name read: " + buf);
+            return null;
+          }
+        if (ch > 127)
+          throw new IOException("Invalid char: " + (char) ch);
+        if (Character.isLetterOrDigit((char) ch) || ch == '-' || ch == '.')
+          buf.append((char) ch);
+        else
+          throw new IOException("Invalid char: " + (char) ch);
+      }
+    return buf.toString();
+  }
+
+  private String readAttributeValue(Reader in) throws IOException
+  {
+    StringBuffer buf = new StringBuffer();
+    int ch = in.read();
+    if (ch == '#')
+      {
+        while (true)
+          {
+            ch = in.read();
+            if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
+                || Character.isDigit((char) ch))
+              buf.append((char) ch);
+            else if (ch == '+' || ch == ',')
+              {
+                sep = ch;
+                String hex = buf.toString();
+                return new String(toByteArray(hex));
+              }
+            else
+              throw new IOException("illegal character: " + (char) ch);
+          }
+      }
+    else if (ch == '"')
+      {
+        while (true)
+          {
+            ch = in.read();
+            if (ch == '"')
+              break;
+            else if (ch == '\\')
+              {
+                ch = in.read();
+                if (ch == -1)
+                  throw new EOFException();
+                if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
+                    || Character.isDigit((char) ch))
+                  {
+                    int i = Character.digit((char) ch, 16) << 4;
+                    ch = in.read();
+                    if (!(('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
+                          || Character.isDigit((char) ch)))
+                      throw new IOException("illegal hex char");
+                    i |= Character.digit((char) ch, 16);
+                    buf.append((char) i);
+                  }
+                else
+                  buf.append((char) ch);
+              }
+            else
+              buf.append((char) ch);
+          }
+        sep = in.read();
+        if (sep != '+' && sep != ',')
+          throw new IOException("illegal character: " + (char) ch);
+        return buf.toString();
+      }
+    else
+      {
+        while (true)
+          {
+            switch (ch)
+              {
+              case '+':
+              case ',':
+                sep = ch;
+                return buf.toString();
+              case '\\':
+                ch = in.read();
+                if (ch == -1)
+                  throw new EOFException();
+                if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
+                    || Character.isDigit((char) ch))
+                  {
+                    int i = Character.digit((char) ch, 16) << 4;
+                    ch = in.read();
+                    if (!(('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F')
+                          || Character.isDigit((char) ch)))
+                      throw new IOException("illegal hex char");
+                    i |= Character.digit((char) ch, 16);
+                    buf.append((char) i);
+                  }
+                else
+                  buf.append((char) ch);
+                break;
+              case '=':
+              case '<':
+              case '>':
+              case '#':
+              case ';':
+                throw new IOException("illegal character: " + (char) ch);
+              case -1:
+                sep = -1;
+                return buf.toString ();
+              default:
+                buf.append((char) ch);
+              }
+            ch = in.read ();
+          }
+      }
+  }
+
+  private void parseDer (InputStream encoded) throws IOException
+  {
+    DERReader der = new DERReader (encoded);
+    DERValue name = der.read();
+    if (!name.isConstructed())
+      throw new IOException ("malformed Name");
+    this.encoded = name.getEncoded();
+    int len = 0;
+    while (len < name.getLength())
+      {
+        DERValue rdn = der.read();
+        if (!rdn.isConstructed())
+          throw new IOException ("badly formed RDNSequence");
+        int len2 = 0;
+        while (len2 < rdn.getLength())
+          {
+            DERValue atav = der.read();
+            if (!atav.isConstructed())
+              throw new IOException ("badly formed AttributeTypeAndValue");
+            DERValue val = der.read();
+            if (val.getTag() != DER.OBJECT_IDENTIFIER)
+              throw new IOException ("badly formed AttributeTypeAndValue");
+            OID oid = (OID) val.getValue();
+            val = der.read();
+            if (!(val.getValue() instanceof String))
+              throw new IOException ("badly formed AttributeTypeAndValue");
+            String value = (String) val.getValue();
+            putComponent(oid, value);
+            len2 += atav.getEncodedLength();
+          }
+        len += rdn.getEncodedLength();
+        if (len < name.getLength())
+          newRelativeDistinguishedName();
+      }
+  }
+
+  private void newRelativeDistinguishedName()
+  {
+    currentRdn = new LinkedHashMap();
+    components.add(currentRdn);
+  }
+
+  private void putComponent(OID oid, String value)
+  {
+    currentRdn.put(oid, value);
+  }
+
+  private void putComponent(String name, String value)
+  {
+    name = name.trim().toLowerCase();
+    if (name.equals("cn"))
+      putComponent(CN, value);
+    else if (name.equals("c"))
+      putComponent(C, value);
+    else if (name.equals("l"))
+      putComponent(L, value);
+    else if (name.equals("street"))
+      putComponent(STREET, value);
+    else if (name.equals("st"))
+      putComponent(ST, value);
+    else if (name.equals ("o"))
+      putComponent (O, value);
+    else if (name.equals ("ou"))
+      putComponent (OU, value);
+    else if (name.equals("dc"))
+      putComponent(DC, value);
+    else if (name.equals("uid"))
+      putComponent(UID, value);
+    else
+      putComponent(new OID(name), value);
+  }
+
+  private static String compressWS(String str)
+  {
+    StringBuffer buf = new StringBuffer();
+    char lastChar = 0;
+    for (int i = 0; i < str.length(); i++)
+      {
+        char c = str.charAt(i);
+        if (Character.isWhitespace(c))
+          {
+            if (!Character.isWhitespace(lastChar))
+              buf.append(' ');
+          }
+        else
+          buf.append(c);
+        lastChar = c;
+      }
+    return buf.toString().trim();
+  }
+
+  private static byte[] toByteArray (String str)
+  {
+    int limit = str.length();
+    byte[] result = new byte[((limit + 1) / 2)];
+    int i = 0, j = 0;
+    if ((limit % 2) == 1)
+      {
+        result[j++] = (byte) Character.digit (str.charAt(i++), 16);
+      }
+    while (i < limit)
+      {
+        result[j  ]  = (byte) (Character.digit (str.charAt(i++), 16) << 4);
+        result[j++] |= (byte)  Character.digit (str.charAt(i++), 16);
+      }
+    return result;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/x500/X500PrivateCredential.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/x500/X500PrivateCredential.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/x500/X500PrivateCredential.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/x500/X500PrivateCredential.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,149 @@
+/* X500PrivateCredential.java -- certificate and private key pair.
+   Copyright (C) 2003, 2004  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.auth.x500;
+
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+
+import javax.security.auth.Destroyable;
+
+/**
+ * A pairing of a {@link X509Certificate} and its corresponding {@link
+ * PrivateKey}, with an optional keystore alias.
+ */
+public final class X500PrivateCredential implements Destroyable
+{
+
+  // Fields.
+  // -------------------------------------------------------------------------
+
+  private PrivateKey key;
+  private X509Certificate certificate;
+  private String alias;
+
+  // Constructors.
+  // -------------------------------------------------------------------------
+
+  /**
+   * Creates a new private credential with no associated keystore alias.
+   *
+   * @param certificate The X.509 certificate.
+   * @param key The private key.
+   * @throws IllegalArgumentException If either parameter is null.
+   */
+  public X500PrivateCredential (X509Certificate certificate, PrivateKey key)
+  {
+    if (certificate == null || key == null)
+      throw new IllegalArgumentException();
+    this.certificate = certificate;
+    this.key = key;
+  }
+
+  /**
+   * Creates a new private credential with a keystore alias.
+   *
+   * @param certificate The X.509 certificate.
+   * @param key The private key.
+   * @param alias The keystore alias for this credential.
+   * @throws IllegalArgumentException If any parameter is null.
+   */
+  public X500PrivateCredential (X509Certificate certificate, PrivateKey key,
+                                String alias)
+  {
+    this (certificate, key);
+    if (alias == null)
+      throw new IllegalArgumentException();
+    this.alias = alias;
+  }
+
+  // Instance methods.
+  // -------------------------------------------------------------------------
+
+  /**
+   * Returns the certificate of this credential.
+   *
+   * @return The certificate of this credential.
+   */
+  public X509Certificate getCertificate()
+  {
+    return certificate;
+  }
+
+  /**
+   * Returns the private key of this credential.
+   *
+   * @return The private key of this credential.
+   */
+  public PrivateKey getPrivateKey()
+  {
+    return key;
+  }
+
+  /**
+   * Returns the keystore alias of this credential, or null if not present.
+   *
+   * @return The keystore alias, or null.
+   */
+  public String getAlias()
+  {
+    return alias;
+  }
+
+  /**
+   * Destroy the sensitive data of this credential, setting the certificate,
+   * private key, and keystore alias to null.
+   */
+  public void destroy()
+  {
+    certificate = null;
+    key = null;
+    alias = null;
+  }
+
+  /**
+   * Tells whether or not this credential has been destroyed, and that
+   * the certificate and private key fields are null.
+   *
+   * @return True if this object has been destroyed.
+   */
+  public boolean isDestroyed()
+  {
+    return certificate == null && key == null;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/x500/package.html
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/x500/package.html?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/x500/package.html (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/auth/x500/package.html Thu Nov  8 16:56:19 2007
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.security.auth.x500 package.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.security.auth.x500</title></head>
+
+<body>
+<p></p>
+
+</body>
+</html>

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/Certificate.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/Certificate.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/Certificate.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/Certificate.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,176 @@
+/* Certificate.java -- base class of public-key certificates.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.cert;
+
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.PublicKey;
+import java.security.SignatureException;
+
+import java.util.Arrays;
+import java.util.zip.Adler32;
+
+/**
+ * <p>The base class for public-key certificates.</p>
+ *
+ * <p><b>This class is deprecated in favor of the {@link
+ * java.security.cert.Certificate} class. It should not be used in new
+ * applications.</b></p>
+ */
+public abstract class Certificate
+{
+
+  // Constructors.
+  // -------------------------------------------------------------------------
+
+  public Certificate()
+  {
+    super();
+  }
+
+  // Instance methods.
+  // -------------------------------------------------------------------------
+
+  /**
+   * <p>Tests if this certificate equals another.</p>
+   *
+   * @param other The object to test.
+   * @return True if the certificates are equal.
+   */
+  public boolean equals(Object other)
+  {
+    if (other == null || !(other instanceof Certificate))
+      {
+        return false;
+      }
+    if (other == this)
+      {
+        return true;
+      }
+    try
+      {
+        return Arrays.equals(getEncoded(), ((Certificate) other).getEncoded());
+      }
+    catch (CertificateEncodingException cee)
+      {
+        return false;
+      }
+  }
+
+  /**
+   * <p>Computes a hash code for this certificate.</p>
+   *
+   * @return The hash code.
+   */
+  public int hashCode()
+  {
+    try
+      {
+        Adler32 csum = new Adler32();
+        csum.update(getEncoded());
+        return (int) csum.getValue();
+      }
+    catch (CertificateEncodingException cee)
+      {
+        return 0;
+      }
+  }
+
+  // Abstract methods.
+  // -------------------------------------------------------------------------
+
+  /**
+   * <p>Return the encoded form of this certificate.</p>
+   *
+   * @return The encoded form.
+   * @throws CertificateEncodingException If the certificate could not be
+   *   encoded.
+   */
+  public abstract byte[] getEncoded() throws CertificateEncodingException;
+
+  /**
+   * <p>Verifies the signature of this certificate.</p>
+   *
+   * @param key The signer's public key.
+   * @throws CertificateException
+   * @throws NoSuchAlgorithmException If the algorithm used to sign the
+   *   certificate is not available.
+   * @throws InvalidKeyException If the supplied key is not appropriate for the
+   *   certificate's signature algorithm.
+   * @throws NoSuchProviderException
+   * @throws SignatureException If the signature could not be verified.
+   */
+  public abstract void verify(PublicKey key)
+    throws CertificateException, NoSuchAlgorithmException, InvalidKeyException,
+           NoSuchProviderException, SignatureException;
+
+  /**
+   * <p>Verifies the signature of this certificate, using the specified security
+   * provider.</p>
+   *
+   * @param key The signer's public key.
+   * @param sigProvider The name of the signature provider.
+   * @throws CertificateException
+   * @throws NoSuchAlgorithmException If the algorithm used to sign the
+   *   certificate is not available.
+   * @throws InvalidKeyException If the supplied key is not appropriate for the
+   *   certificate's signature algorithm.
+   * @throws NoSuchProviderException If <i>sigProvider</i> is not the name of an
+   *   installed provider.
+   * @throws SignatureException If the signature could not be verified.
+   */
+  public abstract void verify(PublicKey key, String sigProvider)
+    throws CertificateException, NoSuchAlgorithmException, InvalidKeyException,
+           NoSuchProviderException, SignatureException;
+
+  /**
+   * <p>Returns a printable representation of this certificate.</p>
+   *
+   * @return The string.
+   */
+  public abstract String toString();
+
+  /**
+   * <p>Returns this certificate's public key.</p>
+   *
+   * @return The public key.
+   */
+  public abstract PublicKey getPublicKey();
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateEncodingException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateEncodingException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateEncodingException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateEncodingException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,60 @@
+/* CertificateEncodingException.java -- certificate encoding exception.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.cert;
+
+/**
+ * <p>Signals a problem when encoding certificates.</p>
+ *
+ * <p><b>This class is deprecated in favor of the {@link
+ * java.security.cert.CertificateEncodingException} class. It should not be used
+ * in new applications.</b></p>
+ */
+public class CertificateEncodingException extends CertificateException
+{
+
+  public CertificateEncodingException()
+  {
+    super();
+  }
+
+  public CertificateEncodingException(String msg)
+  {
+    super(msg);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,60 @@
+/* CertificateException.java -- certificate exception.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.cert;
+
+/**
+ * <p>Signals a generic problem with certificates.</p>
+ *
+ * <p><b>This class is deprecated in favor of the {@link
+ * java.security.cert.CertificateException} class. It should not be used in new
+ * applications.</b></p>
+ */
+public class CertificateException extends Exception
+{
+
+  public CertificateException()
+  {
+    super();
+  }
+
+  public CertificateException(String msg)
+  {
+    super(msg);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateExpiredException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateExpiredException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateExpiredException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateExpiredException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,60 @@
+/* CertificateExpiredException.java -- certificate expired exception.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.cert;
+
+/**
+ * <p>Signals that a certificate has expired.</p>
+ *
+ * <p><b>This class is deprecated in favor of the {@link
+ * java.security.cert.CertificateExpiredException} class. It should not be used
+ * in new applications.</b></p>
+ */
+public class CertificateExpiredException extends CertificateException
+{
+
+  public CertificateExpiredException()
+  {
+    super();
+  }
+
+  public CertificateExpiredException(String msg)
+  {
+    super(msg);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateNotYetValidException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateNotYetValidException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateNotYetValidException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateNotYetValidException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,60 @@
+/* CertificateNotYetValidException.java -- certificate not yet valid exception.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.cert;
+
+/**
+ * <p>Signals that a certificate is not yet valid.</p>
+ *
+ * <p><b>This class is deprecated in favor of the {@link
+ * java.security.cert.CertificateNotYetValidException} class. It should not be
+ * used in new applications.</b></p>
+ */
+public class CertificateNotYetValidException extends CertificateException
+{
+
+  public CertificateNotYetValidException()
+  {
+    super();
+  }
+
+  public CertificateNotYetValidException(String msg)
+  {
+    super(msg);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateParsingException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateParsingException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateParsingException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/CertificateParsingException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,59 @@
+/* CertificateParsingException.java -- certificate parsing exception.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.cert;
+
+/**
+ * <p>Signals a parsing error when decoding a certificate.</p>
+ *
+ * <p><b>This class is deprecated. It should not be used in new
+ * applications.</b></p>
+ */
+public class CertificateParsingException extends CertificateException
+{
+
+  public CertificateParsingException()
+  {
+    super();
+  }
+
+  public CertificateParsingException(String msg)
+  {
+    super(msg);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/X509CertBridge.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/X509CertBridge.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/X509CertBridge.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/X509CertBridge.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,201 @@
+/* X509CertBridge.java -- bridge between JDK and JSSE cert APIs.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.cert;
+
+import java.math.BigInteger;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.Principal;
+import java.security.PublicKey;
+import java.security.SignatureException;
+import java.util.Date;
+
+/**
+ * <p>An implementation of the {@link X509Certificate} class that delegates
+ * calls to a {@link java.security.cert.X509Certificate}.</p>
+ */
+final class X509CertBridge extends X509Certificate
+{
+
+  // Fields.
+  // -------------------------------------------------------------------------
+
+  private java.security.cert.X509Certificate cert;
+
+  // Constructor.
+  // -------------------------------------------------------------------------
+
+  X509CertBridge(java.security.cert.X509Certificate cert)
+  {
+    this.cert = cert;
+  }
+
+  // Instance methods.
+  // -------------------------------------------------------------------------
+
+  public byte[] getEncoded() throws CertificateEncodingException
+  {
+    try
+      {
+        return cert.getEncoded();
+      }
+    catch (java.security.cert.CertificateEncodingException cee)
+      {
+        throw new CertificateEncodingException(cee.getMessage());
+      }
+  }
+
+  public void verify(PublicKey key)
+    throws CertificateException, NoSuchAlgorithmException, InvalidKeyException,
+           NoSuchProviderException, SignatureException
+  {
+    try
+      {
+        cert.verify(key);
+      }
+    catch (java.security.cert.CertificateException ce)
+      {
+        throw new CertificateException(ce.getMessage());
+      }
+  }
+
+  public void verify(PublicKey key, String sigProvider)
+    throws CertificateException, NoSuchAlgorithmException, InvalidKeyException,
+           NoSuchProviderException, SignatureException
+  {
+    try
+      {
+        cert.verify(key, sigProvider);
+      }
+    catch (java.security.cert.CertificateException ce)
+      {
+        throw new CertificateException(ce.getMessage());
+      }
+  }
+
+  public String toString()
+  {
+    return cert.toString();
+  }
+
+  public PublicKey getPublicKey()
+  {
+    return cert.getPublicKey();
+  }
+
+  public void checkValidity()
+    throws CertificateExpiredException, CertificateNotYetValidException
+  {
+    try
+      {
+        cert.checkValidity();
+      }
+    catch (java.security.cert.CertificateExpiredException cee)
+      {
+        throw new CertificateExpiredException(cee.getMessage());
+      }
+    catch (java.security.cert.CertificateNotYetValidException cnyve)
+      {
+        throw new CertificateNotYetValidException(cnyve.getMessage());
+      }
+  }
+
+  public void checkValidity(Date date)
+    throws CertificateExpiredException, CertificateNotYetValidException
+  {
+    try
+      {
+        cert.checkValidity(date);
+      }
+    catch (java.security.cert.CertificateExpiredException cee)
+      {
+        throw new CertificateExpiredException(cee.getMessage());
+      }
+    catch (java.security.cert.CertificateNotYetValidException cnyve)
+      {
+        throw new CertificateNotYetValidException(cnyve.getMessage());
+      }
+  }
+
+  public int getVersion()
+  {
+    return cert.getVersion();
+  }
+
+  public BigInteger getSerialNumber()
+  {
+    return cert.getSerialNumber();
+  }
+
+  public Principal getIssuerDN()
+  {
+    return cert.getIssuerDN();
+  }
+
+  public Principal getSubjectDN()
+  {
+    return cert.getSubjectDN();
+  }
+
+  public Date getNotBefore()
+  {
+    return cert.getNotBefore();
+  }
+
+  public Date getNotAfter()
+  {
+    return cert.getNotAfter();
+  }
+
+  public String getSigAlgName()
+  {
+    return cert.getSigAlgName();
+  }
+
+  public String getSigAlgOID()
+  {
+    return cert.getSigAlgOID();
+  }
+
+  public byte[] getSigAlgParams()
+  {
+    return cert.getSigAlgParams();
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/X509Certificate.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/X509Certificate.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/X509Certificate.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/X509Certificate.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,189 @@
+/* X509Certificate.java -- base class of X.509 certificates.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.cert;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import java.math.BigInteger;
+
+import java.security.Principal;
+import java.security.cert.CertificateFactory;
+
+import java.util.Date;
+
+/**
+ * <p>The base class of all X.509 certificates.</p>
+ *
+ * <p><b>This class is deprecated in favor of the {@link
+ * java.security.cert.X509Certificate} class. It should not be used in new
+ * applications.</b></p>
+ */
+public abstract class X509Certificate extends Certificate
+{
+
+  // Class methods.
+  // -------------------------------------------------------------------------
+
+  /**
+   * <p>Get an instance of X509Certificate for the given encoded bytes.</p>
+   *
+   * @param encoded The encoded certificate.
+   * @return An instance of X509Certificate.
+   * @throws CertificateException If the encoded certificate cannot be parsed.
+   */
+  public static X509Certificate getInstance(byte[] encoded)
+    throws CertificateException
+  {
+    return getInstance(new ByteArrayInputStream(encoded));
+  }
+
+  /**
+   * <p>Get an instance of X509Certificate for the given encoded stream.</p>
+   *
+   * @param encoded The encoded certificate stream..
+   * @return An instance of X509Certificate.
+   * @throws CertificateException If the encoded certificate cannot be parsed.
+   */
+  public static X509Certificate getInstance(InputStream encoded)
+    throws CertificateException
+  {
+    try
+      {
+        CertificateFactory cf = CertificateFactory.getInstance("X.509");
+        return new X509CertBridge((java.security.cert.X509Certificate)
+                                  cf.generateCertificate(encoded));
+      }
+    catch (java.security.cert.CertificateException ce)
+      {
+        throw new CertificateException(ce.getMessage());
+      }
+  }
+
+  // Abstract methods.
+  // -------------------------------------------------------------------------
+
+  /**
+   * <p>Check if this certificate is valid now.</p>
+   *
+   * @throws CertificateExpiredException If the certificate has expired.
+   * @throws CertificateNotYetValidException If the certificate is not yet valid.
+   * @see #checkValidity(java.util.Date)
+   */
+  public abstract void checkValidity()
+    throws CertificateExpiredException, CertificateNotYetValidException;
+
+  /**
+   * <p>Check if this certificate is valid for the given date.</p>
+   *
+   * @param date The date to check.
+   * @throws CertificateExpiredException If the certificate has expired.
+   * @throws CertificateNotYetValidException If the certificate is not yet valid.
+   */
+  public abstract void checkValidity(Date date)
+    throws CertificateExpiredException, CertificateNotYetValidException;
+
+  /**
+   * <p>Returns the X.509 version number.</p>
+   *
+   * @return The version number.
+   */
+  public abstract int getVersion();
+
+  /**
+   * <p>Returns this certificate's serial number.</p>
+   *
+   * @return The serial number.
+   */
+  public abstract BigInteger getSerialNumber();
+
+  /**
+   * <p>Returns the distinguished name of this certificate's issuer.</p>
+   *
+   * @return The issuer's distinguished name.
+   */
+  public abstract Principal getIssuerDN();
+
+  /**
+   * <p>Returns the distinguished name of this certificate's subject.</p>
+   *
+   * @return The subject's distinguished name.
+   */
+  public abstract Principal getSubjectDN();
+
+  /**
+   * <p>Returns the <i>not before</i> portion of this certificate's validity
+   * period.</p>
+   *
+   * @return The not before date.
+   */
+  public abstract Date getNotBefore();
+
+  /**
+   * <p>Returns the <i>not after</i> portion of this certificate's validity
+   * period.</p>
+   *
+   * @return The not after date.
+   */
+  public abstract Date getNotAfter();
+
+  /**
+   * <p>Returns the name of this certificate's signature algorithm.</p>
+   *
+   * @return The name of the signature algorithm.
+   */
+  public abstract String getSigAlgName();
+
+  /**
+   * <p>Returns the object identifier (OID) of this certificate's signature
+   * algorithm. The returned string is a sequence of integers separated by
+   * periods.</p>
+   *
+   * @return The signature OID.
+   */
+  public abstract String getSigAlgOID();
+
+  /**
+   * <p>Returns the signature parameters. The returned byte array contains the
+   * raw DER-encoded parameters.</p>
+   *
+   * @return The signature parameters.
+   */
+  public abstract byte[] getSigAlgParams();
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/package.html
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/package.html?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/package.html (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/cert/package.html Thu Nov  8 16:56:19 2007
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.security.cert package.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.security.cert</title></head>
+
+<body>
+<p></p>
+
+</body>
+</html>

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/package.html
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/package.html?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/package.html (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/package.html Thu Nov  8 16:56:19 2007
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.security package.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.security</title></head>
+
+<body>
+<p></p>
+
+</body>
+</html>

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/AuthenticationException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/AuthenticationException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/AuthenticationException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/AuthenticationException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,107 @@
+/* AuthenticationException.java --
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.sasl;
+
+/**
+ * <p>This exception is thrown by a SASL mechanism implementation to indicate
+ * that the SASL exchange has failed due to reasons related to authentication,
+ * such as an invalid identity, passphrase, or key.</p>
+ *
+ * <p>Note that the lack of an <code>AuthenticationException</code> does not
+ * mean that the failure was not due to an authentication error. A SASL
+ * mechanism implementation might throw the more general {@link SaslException}
+ * instead of <code>AuthenticationException</code> if it is unable to determine
+ * the nature of the failure, or if does not want to disclose the nature of the
+ * failure, for example, due to security reasons.</p>
+ *
+ * @since 1.5
+ */
+public class AuthenticationException extends SaslException
+{
+
+  // Constants and variables
+  // -------------------------------------------------------------------------
+
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs a new instance of <code>AuthenticationException</code>. The
+   * root exception and the detailed message are <code>null</code>.
+   */
+  public AuthenticationException()
+  {
+    super();
+  }
+
+  /**
+   * Constructs a new instance of <code>AuthenticationException</code> with a
+   * detailed message. The root exception is <code>null</code>.
+   *
+   * @param detail a possibly <code>null</code> string containing details of
+   * the exception.
+   * @see Throwable#getMessage()
+   */
+  public AuthenticationException(String detail)
+  {
+    super(detail);
+  }
+
+  /**
+   * Constructs a new instance of <code>AuthenticationException</code> with a
+   * detailed message and a root exception.
+   *
+   * @param detail a possibly <code>null</code> string containing details of
+   * the exception.
+   * @param ex a possibly <code>null</code> root exception that caused this
+   * exception.
+   * @see Throwable#getMessage()
+   * @see SaslException#getCause()
+   */
+  public AuthenticationException(String detail, Throwable ex)
+  {
+    super(detail, ex);
+  }
+
+  // Class methods
+  // -------------------------------------------------------------------------
+
+  // Instance methods
+  // -------------------------------------------------------------------------
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/AuthorizeCallback.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/AuthorizeCallback.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/AuthorizeCallback.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/AuthorizeCallback.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,175 @@
+/* AuthorizeCallback.java --
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.sasl;
+
+import java.io.Serializable;
+import javax.security.auth.callback.Callback;
+
+/**
+ * This callback is used by {@link SaslServer} to determine whether one entity
+ * (identified by an authenticated authentication ID) can act on behalf of
+ * another entity (identified by an authorization ID).
+ *
+ * @since 1.5
+ */
+public class AuthorizeCallback implements Callback, Serializable
+{
+  // Constants and variables
+  // -------------------------------------------------------------------------
+
+  private static final long serialVersionUID = -2353344186490470805L;
+
+  /** @serial The (authenticated) authentication id to check. */
+  private String authenticationID = null;
+
+  /** @serial The authorization id to check. */
+  private String authorizationID  = null;
+
+  /**
+   * @serial The id of the authorized entity. If null, the id of the authorized
+   * entity is authorizationID.
+   */
+  private String authorizedID  = null;
+
+  /**
+   * @serial A flag indicating whether the authentication id is allowed to act
+   * on behalf of the authorization id.
+   */
+  private boolean authorized = false;
+
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs an instance of <code>AuthorizeCallback</code>.
+   *
+   * @param authnID the (authenticated) authentication ID.
+   * @param authzID the authorization ID.
+   */
+  public AuthorizeCallback(String authnID, String authzID)
+  {
+    super();
+
+    this.authenticationID = authnID;
+    this.authorizationID  = authzID;
+  }
+
+  // Class methods
+  // -------------------------------------------------------------------------
+
+  // Instance methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Returns the authentication ID to check.
+   *
+   * @return the authentication ID to check
+   */
+  public String getAuthenticationID()
+  {
+    return authenticationID;
+  }
+
+  /**
+   * Returns the authorization ID to check.
+   *
+   * @return the authorization ID to check.
+   */
+  public String getAuthorizationID()
+  {
+    return authorizationID;
+  }
+
+  /**
+   * Determines if the identity represented by authentication ID is allowed to
+   * act on behalf of the authorization ID.
+   *
+   * @return <code>true</code> if authorization is allowed; <code>false</code>
+   * otherwise.
+   * @see #setAuthorized(boolean)
+   * @see #getAuthorizedID()
+   */
+  public boolean isAuthorized()
+  {
+    return authorized;
+  }
+
+  /**
+   * Sets if authorization is allowed or not.
+   *
+   * @param authorized <code>true</code> if authorization is allowed;
+   * <code>false</code> otherwise.
+   * @see #isAuthorized()
+   * @see #setAuthorizedID(String)
+   */
+  public void setAuthorized(boolean authorized)
+  {
+    this.authorized = authorized;
+  }
+
+  /**
+   * Returns the ID of the authorized user.
+   *
+   * @return the ID of the authorized user. <code>null</code> means the
+   * authorization failed.
+   * @see #setAuthorized(boolean)
+   * @see #setAuthorizedID(String)
+   */
+  public String getAuthorizedID()
+  {
+    if (!authorized)
+      {
+        return null;
+      }
+    return (authorizedID != null ? authorizedID : authorizationID);
+  }
+
+  /**
+   * Sets the ID of the authorized entity. Called by handler only when the ID
+   * is different from {@link #getAuthorizationID()}. For example, the ID might
+   * need to be canonicalized for the environment in which it will be used.
+   *
+   * @see #setAuthorized(boolean)
+   * @see #getAuthorizedID()
+   */
+  public void setAuthorizedID(String id)
+  {
+    this.authorizedID = id;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/RealmCallback.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/RealmCallback.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/RealmCallback.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/RealmCallback.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,77 @@
+/* RealmCallback.java --
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.sasl;
+
+import javax.security.auth.callback.TextInputCallback;
+
+/**
+ * This callback is used by {@link SaslClient} and {@link SaslServer} to
+ * retrieve realm information.
+ *
+ * @since 1.5
+ */
+public class RealmCallback extends TextInputCallback
+{
+
+  /**
+   * Constructs a <code>RealmCallback</code> with a prompt.
+   *
+   * @param prompt the non-null prompt to use to request the realm information.
+   * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>
+   * or empty.
+   */
+  public RealmCallback(String prompt)
+  {
+    super(prompt);
+  }
+
+  /**
+   * Constructs a <code>RealmCallback</code> with a prompt and default realm
+   * information.
+   *
+   * @param prompt the non-null prompt to use to request the realm information.
+   * @param defaultRealmInfo the non-null default realm information to use.
+   * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>
+   * or empty, or if <code>defaultRealm</code> is empty or <code>null</code>.
+   */
+  public RealmCallback(String prompt, String defaultRealmInfo)
+  {
+    super(prompt, defaultRealmInfo);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/RealmChoiceCallback.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/RealmChoiceCallback.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/RealmChoiceCallback.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/RealmChoiceCallback.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,73 @@
+/* RealmChoiceCallback.java --
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.sasl;
+
+import javax.security.auth.callback.ChoiceCallback;
+
+/**
+ * This callback is used by {@link SaslClient} and {@link SaslServer} to obtain
+ * a realm given a list of realm choices.
+ *
+ * @since 1.5
+ */
+public class RealmChoiceCallback extends ChoiceCallback
+{
+
+  /**
+   * Constructs a <code>RealmChoiceCallback</code> with a prompt, a list of
+   * choices and a default choice.
+   *
+   * @param prompt the non-null prompt to use to request the realm.
+   * @param choices the non-null list of realms to choose from.
+   * @param defaultChoice the choice to be used as the default when the list of
+   * choices is displayed. It is an index into the <code>choices</code> array.
+   * @param multiple <code>true</code> if multiple choices allowed;
+   * <code>false</code> otherwise.
+   * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>
+   * or empty, if <code>choices</code> has a length of <code>0</code>, if any
+   * element from <code>choices</code> is <code>null</code> or empty, or if
+   * <code>defaultChoice</code> does not fall within the array boundary of
+   * <code>choices</code>.
+   */
+  public RealmChoiceCallback(String prompt, String[] choices, int defaultChoice,
+                             boolean multiple)
+  {
+    super(prompt, choices, defaultChoice, multiple);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/Sasl.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/Sasl.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/Sasl.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/Sasl.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,692 @@
+/* Sasl.java -- 
+   Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.sasl;
+
+import java.security.Provider;
+import java.security.Security;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Vector;
+
+import javax.security.auth.callback.CallbackHandler;
+
+/**
+ * <p>A static class for creating SASL clients and servers.</p>
+ *
+ * <p>This class defines the policy of how to locate, load, and instantiate SASL
+ * clients and servers.</p>
+ *
+ * <p>For example, an application or library gets a SASL client instance by
+ * doing something like:</p>
+ *
+ * <pre>
+ *SaslClient sc =
+ *      Sasl.createSaslClient(mechanisms, authorizationID, protocol,
+ *                            serverName, props, callbackHandler);
+ * </pre>
+ *
+ * <p>It can then proceed to use the instance to create an authenticated
+ * connection.</p>
+ *
+ * <p>Similarly, a server gets a SASL server instance by using code that looks
+ * as follows:</p>
+ *
+ * <pre>
+ *SaslServer ss =
+ *      Sasl.createSaslServer(mechanism, protocol, serverName, props,
+ *                            callbackHandler);
+ * </pre>
+ *
+ * @since 1.5
+ */
+public class Sasl
+{
+
+  // Constants and variables
+  // -------------------------------------------------------------------------
+
+  /**
+   * <p>The name of a property that specifies the quality-of-protection to use.
+   * The property contains a comma-separated, ordered list of quality-of-
+   * protection values that the client or server is willing to support. A qop
+   * value is one of:</p>
+   *
+   * <ul>
+   *    <li><code>"auth"</code> - authentication only,</li>
+   *    <li><code>"auth-int"</code> - authentication plus integrity
+   *    protection,</li>
+   *    <li><code>"auth-conf"</code> - authentication plus integrity and
+   *    confidentiality protection.</li>
+   * </ul>
+   *
+   * <p>The order of the list specifies the preference order of the client or
+   * server.</p>
+   *
+   * <p>If this property is absent, the default qop is <code>"auth"</code>.</p>
+   *
+   * <p>The value of this constant is <code>"javax.security.sasl.qop"</code>.</p>
+   */
+  public static final String QOP = "javax.security.sasl.qop";
+
+  /**
+   * <p>The name of a property that specifies the cipher strength to use. The
+   * property contains a comma-separated, ordered list of cipher strength
+   * values that the client or server is willing to support. A strength value
+   * is one of:</p>
+   *
+   * <ul>
+   *    <li><code>"low"</code>,</li>
+   *    <li><code>"medium"</code>,</li>
+   *    <li><code>"high"</code>.</li>
+   * </ul>
+   *
+   * <p>The order of the list specifies the preference order of the client or
+   * server. An implementation should allow configuration of the meaning of
+   * these values. An application may use the Java Cryptography Extension (JCE)
+   * with JCE-aware mechanisms to control the selection of cipher suites that
+   * match the strength values.</p>
+   *
+   * <p>If this property is absent, the default strength is
+   * <code>"high,medium,low"</code>.</p>
+   *
+   * <p>The value of this constant is <code>"javax.security.sasl.strength"</code>.
+   * </p>
+   */
+  public static final String STRENGTH = "javax.security.sasl.strength";
+
+  /**
+   * <p>The name of a property that specifies whether the server must authenticate
+   * to the client. The property contains <code>"true"</code> if the server
+   * must authenticate the to client; <code>"false"</code> otherwise. The
+   * default is <code>"false"</code>.</p>
+   *
+   * <p>The value of this constant is
+   * <code>"javax.security.sasl.server.authentication"</code>.</p>
+   */
+  public static final String SERVER_AUTH = "javax.security.sasl.server.authentication";
+
+  /**
+   * <p>The name of a property that specifies the maximum size of the receive
+   * buffer in bytes of {@link SaslClient}/{@link SaslServer}. The property
+   * contains the string representation of an integer.</p>
+   *
+   * <p>If this property is absent, the default size is defined by the
+   * mechanism.</p>
+   *
+   * <p>The value of this constant is <code>"javax.security.sasl.maxbuffer"</code>.
+   * </p>
+   */
+  public static final String MAX_BUFFER = "javax.security.sasl.maxbuffer";
+
+  /**
+   * <p>The name of a property that specifies the maximum size of the raw send
+   * buffer in bytes of {@link SaslClient}/{@link SaslServer}. The property
+   * contains the string representation of an integer. The value of this
+   * property is negotiated between the client and server during the
+   * authentication exchange.</p>
+   *
+   * <p>The value of this constant is <code>"javax.security.sasl.rawsendsize"</code>.
+   * </p>
+   */
+  public static final String RAW_SEND_SIZE = "javax.security.sasl.rawsendsize";
+
+  /**
+   * <p>The name of a property that specifies whether mechanisms susceptible
+   * to simple plain passive attacks (e.g., "PLAIN") are not permitted. The
+   * property contains <code>"true"</code> if such mechanisms are not
+   * permitted; <code>"false"</code> if such mechanisms are permitted. The
+   * default is <code>"false"</code>.</p>
+   *
+   * <p>The value of this constant is <code>"javax.security.sasl.policy.noplaintext"</code>.
+   * </p>
+   */
+  public static final String POLICY_NOPLAINTEXT = "javax.security.sasl.policy.noplaintext";
+
+  /**
+   * <p>The name of a property that specifies whether mechanisms susceptible to
+   * active (non-dictionary) attacks are not permitted. The property contains
+   * <code>"true"</code> if mechanisms susceptible to active attacks are not
+   * permitted; <code>"false"</code> if such mechanisms are permitted. The
+   * default is <code>"false"</code>.</p>
+   *
+   * <p>The value of this constant is <code>"javax.security.sasl.policy.noactive"</code>.
+   * </p>
+   */
+  public static final String POLICY_NOACTIVE = "javax.security.sasl.policy.noactive";
+
+  /**
+   * <p>The name of a property that specifies whether mechanisms susceptible to
+   * passive dictionary attacks are not permitted. The property contains
+   * <code>"true"</code> if mechanisms susceptible to dictionary attacks are
+   * not permitted; <code>"false"</code> if such mechanisms are permitted. The
+   * default is <code>"false"</code>.</p>
+   *
+   * <p>The value of this constant is <code>"javax.security.sasl.policy.nodictionary"</code>.
+   * </p>
+   */
+  public static final String POLICY_NODICTIONARY = "javax.security.sasl.policy.nodictionary";
+
+  /**
+   * <p>The name of a property that specifies whether mechanisms that accept
+   * anonymous login are not permitted. The property contains <code>"true"</code>
+   * if mechanisms that accept anonymous login are not permitted; <code>"false"
+   * </code> if such mechanisms are permitted. The default is <code>"false"</code>.
+   * </p>
+   *
+   * <p>The value of this constant is <code>"javax.security.sasl.policy.noanonymous"</code>.
+   * </p>
+   */
+  public static final String POLICY_NOANONYMOUS = "javax.security.sasl.policy.noanonymous";
+
+  /**
+   * The name of a property that specifies whether mechanisms that implement
+   * forward secrecy between sessions are required. Forward secrecy means that
+   * breaking into one session will not automatically provide information for
+   * breaking into future sessions. The property contains <code>"true"</code>
+   * if mechanisms that implement forward secrecy between sessions are
+   * required; <code>"false"</code> if such mechanisms are not required. The
+   * default is <code>"false"</code>.
+   *
+   * <p>The value of this constant is <code>"javax.security.sasl.policy.forward"</code>.
+   * </p>
+   */
+  public static final String POLICY_FORWARD_SECRECY = "javax.security.sasl.policy.forward";
+
+  /**
+   * The name of a property that specifies whether mechanisms that pass client
+   * credentials are required. The property contains <code>"true"</code> if
+   * mechanisms that pass client credentials are required; <code>"false"</code>
+   * if such mechanisms are not required. The default is <code>"false"</code>.
+   *
+   * <p>The value of this constant is <code>"javax.security.sasl.policy.credentials"</code>.
+   * </p>
+   */
+  public static final String POLICY_PASS_CREDENTIALS = "javax.security.sasl.policy.credentials";
+
+  /**
+   * <p>The name of a property that specifies whether to reuse previously
+   * authenticated session information. The property contains <code>"true"</code>
+   * if the mechanism implementation may attempt to reuse previously
+   * authenticated session information; it contains <code>"false"</code> if the
+   * implementation must not reuse previously authenticated session information.
+   * A setting of <code>"true"</code> serves only as a hint; it does not
+   * necessarily entail actual reuse because reuse might not be possible due to
+   * a number of reasons, including, but not limited to, lack of mechanism
+   * support for reuse, expiration of reusable information, and the peer's
+   * refusal to support reuse. The property's default value is <code>"false"</code>.
+   * </p>
+   *
+   * <p>The value of this constant is <code>"javax.security.sasl.reuse"</code>.
+   * Note that all other parameters and properties required to create a SASL
+   * client/server instance must be provided regardless of whether this
+   * property has been supplied. That is, you cannot supply any less
+   * information in anticipation of reuse. Mechanism implementations that
+   * support reuse might allow customization of its implementation for factors
+   * such as cache size, timeouts, and criteria for reuseability. Such
+   * customizations are implementation-dependent.</p>
+   */
+  public static final String REUSE = "javax.security.sasl.reuse";
+
+  private static final String CLIENT_FACTORY_SVC = "SaslClientFactory.";
+  private static final String SERVER_FACTORY_SVC = "SaslServerFactory.";
+  private static final String ALIAS = "Alg.Alias.";
+
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  private Sasl()
+  {
+    super();
+  }
+
+  // Class methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Creates a {@link SaslClient} for the specified mechanism.
+   *
+   * <p>This method uses the JCA Security Provider Framework, described in the
+   * "Java Cryptography Architecture API Specification & Reference", for
+   * locating and selecting a {@link SaslClient} implementation.</p>
+   *
+   * <p>First, it obtains an ordered list of {@link SaslClientFactory}
+   * instances from the registered security providers for the
+   * <code>"SaslClientFactory"</code> service and the specified mechanism. It
+   * then invokes <code>createSaslClient()</code> on each factory instance on
+   * the list until one produces a non-null {@link SaslClient} instance. It
+   * returns the non-null {@link SaslClient} instance, or <code>null</code> if
+   * the search fails to produce a non-null {@link SaslClient} instance.</p>
+   *
+   * <p>A security provider for <code>SaslClientFactory</code> registers with
+   * the JCA Security Provider Framework keys of the form:</p>
+   *
+   * <pre>
+   *    SaslClientFactory.mechanism_name
+   * </pre>
+   *
+   * <p>and values that are class names of implementations of {@link
+   * SaslClientFactory}.</p>
+   *
+   * <p>For example, a provider that contains a factory class,
+   * <code>com.wiz.sasl.digest.ClientFactory</code>, that supports the
+   * <code>"DIGEST-MD5"</code> mechanism would register the following entry
+   * with the JCA:</p>
+   *
+   * <pre>
+   *    SaslClientFactory.DIGEST-MD5     com.wiz.sasl.digest.ClientFactory
+   * </pre>
+   *
+   * <p>See the "Java Cryptography Architecture API Specification &
+   * Reference" for information about how to install and configure security
+   * service providers.</p>
+   *
+   * @param mechanisms the non-null list of mechanism names to try. Each is the
+   * IANA-registered name of a SASL mechanism. (e.g. "GSSAPI", "CRAM-MD5").
+   * @param authorizationID the possibly <code>null</code> protocol-dependent
+   * identification to be used for authorization. If <code>null</code> or
+   * empty, the server derives an authorization ID from the client's
+   * authentication credentials. When the SASL authentication completes
+   * successfully, the specified entity is granted access.
+   * @param protocol the non-null string name of the protocol for which the
+   * authentication is being performed (e.g. "ldap").
+   * @param serverName the non-null fully-qualified host name of the server to
+   * authenticate to.
+   * @param props the possibly null set of properties used to select the SASL
+   * mechanism and to configure the authentication exchange of the selected
+   * mechanism. For example, if props contains the {@link Sasl#POLICY_NOPLAINTEXT}
+   * property with the value <code>"true"</code>, then the selected SASL
+   * mechanism must not be susceptible to simple plain passive attacks. In
+   * addition to the standard properties declared in this class, other,
+   * possibly mechanism-specific, properties can be included. Properties not
+   * relevant to the selected mechanism are ignored.
+   * @param cbh the possibly <code>null</code> callback handler to used by the
+   * SASL mechanisms to get further information from the application/library to
+   * complete the authentication. For example, a SASL mechanism might require
+   * the authentication ID, password and realm from the caller. The
+   * authentication ID is requested by using a
+   * {@link javax.security.auth.callback.NameCallback}. The password is
+   * requested by using a {@link javax.security.auth.callback.PasswordCallback}.
+   * The realm is requested by using a {@link RealmChoiceCallback} if there is
+   * a list of realms to choose from, and by using a {@link RealmCallback} if
+   * the realm must be entered.
+   * @return a possibly <code>null</code> {@link SaslClient} created using the
+   * parameters supplied. If <code>null</code>, the method could not find a
+   * {@link SaslClientFactory} that will produce one.
+   * @throws SaslException if a {@link SaslClient} cannot be created because
+   * of an error.
+   */
+  public static SaslClient createSaslClient(String[] mechanisms,
+                                            String authorizationID,
+                                            String protocol,
+                                            String serverName, Map props,
+                                            CallbackHandler cbh)
+    throws SaslException
+  {
+    if (mechanisms == null)
+      {
+        return null;
+      }
+    Provider[] providers = Security.getProviders();
+    if (providers == null || providers.length == 0)
+      {
+        return null;
+      }
+
+    SaslClient result = null;
+    SaslClientFactory factory = null;
+    String m, clazz = null, upper, alias;
+    int j;
+    Provider p;
+    for (int i = 0; i < mechanisms.length; i++)
+      {
+        m = mechanisms[i];
+        if (m == null)
+          continue;
+        for (j = 0; j < providers.length; j++)
+          {
+            p = providers[j];
+            if (p != null)
+              {
+                // try the name as is
+                clazz = p.getProperty(CLIENT_FACTORY_SVC + m);
+                if (clazz == null) // try all uppercase
+                  {
+                    upper = m.toUpperCase();
+                    clazz = p.getProperty(CLIENT_FACTORY_SVC + upper);
+                    if (clazz == null) // try if it's an alias
+                      {
+                        alias = p.getProperty(ALIAS + CLIENT_FACTORY_SVC + m);
+                        if (alias == null) // try all-uppercase alias name
+                          {
+                            alias = p.getProperty(ALIAS + CLIENT_FACTORY_SVC + upper);
+                            if (alias == null) // spit the dummy
+                              continue;
+                          }
+                        clazz = p.getProperty(CLIENT_FACTORY_SVC + alias);
+                      }
+                  }
+                if (clazz == null)
+                  continue;
+                else
+                  clazz = clazz.trim();
+              }
+
+            try
+              {
+                result = null;
+                factory = (SaslClientFactory) Class.forName(clazz).newInstance();
+                result = factory.createSaslClient(mechanisms, authorizationID,
+                                                  protocol, serverName, props, cbh);
+              }
+            catch (ClassCastException ignored) // ignore instantiation exceptions
+              {
+              }
+            catch (ClassNotFoundException ignored)
+              {
+              }
+            catch (InstantiationException ignored)
+              {
+              }
+            catch (IllegalAccessException ignored)
+              {
+              }
+            if (result != null)
+              return result;
+          }
+      }
+    return null;
+  }
+
+  /**
+   * Gets an enumeration of known factories for producing a {@link SaslClient}
+   * instance. This method uses the same sources for locating factories as
+   * <code>createSaslClient()</code>.
+   *
+   * @return a non-null {@link Enumeration} of known factories for producing a
+   * {@link SaslClient} instance.
+   * @see #createSaslClient(String[],String,String,String,Map,CallbackHandler)
+   */
+  public static Enumeration getSaslClientFactories()
+  {
+    Vector result = new Vector();
+    HashSet names = new HashSet();
+    Provider[] providers = Security.getProviders();
+    Iterator it;
+    if (providers != null)
+      {
+        Provider p;
+        String key;
+        for (int i = 0; i < providers.length; i++)
+          {
+            p = providers[i];
+            for (it = p.keySet().iterator(); it.hasNext(); )
+              {
+                key = (String) it.next();
+                // add key's binding (a) it is a class of a client factory,
+                // and (b) the key does not include blanks
+                if (key.startsWith(CLIENT_FACTORY_SVC) && key.indexOf(" ") == -1)
+                  {
+                    names.add(p.getProperty(key));
+                    break;
+                  }
+              }
+          }
+      }
+    // we have the factory class names in names; instantiate and enumerate
+    String c;
+    for (it = names.iterator(); it.hasNext(); )
+      {
+        c = (String) it.next();
+        try
+          {
+            SaslClientFactory f = (SaslClientFactory) Class.forName(c).newInstance();
+            if (f != null)
+              result.add(f);
+          } catch (ClassCastException ignored) { // ignore instantiation exceptions
+          } catch (ClassNotFoundException ignored) {
+          } catch (InstantiationException ignored) {
+          } catch (IllegalAccessException ignored) {
+          }
+      }
+
+    return result.elements();
+  }
+
+  /**
+   * Creates a {@link SaslServer} for the specified mechanism.
+   *
+   * <p>This method uses the JCA Security Provider Framework, described in the
+   * "Java Cryptography Architecture API Specification & Reference", for
+   * locating and selecting a SaslServer implementation.</p>
+   *
+   * <p>First, it obtains an ordered list of {@link SaslServerFactory}
+   * instances from the registered security providers for the
+   * <code>"SaslServerFactory"</code> service and the specified mechanism. It
+   * then invokes <code>createSaslServer()</code> on each factory instance on
+   * the list until one produces a non-null {@link SaslServer} instance. It
+   * returns the non-null {@link SaslServer} instance, or <code>null</code> if
+   * the search fails to produce a non-null {@link SaslServer} instance.</p>
+   *
+   * <p>A security provider for {@link SaslServerFactory} registers with the
+   * JCA Security Provider Framework keys of the form:</p>
+   *
+   * <pre>
+   *    SaslServerFactory.mechanism_name
+   * </pre>
+   *
+   * <p>and values that are class names of implementations of {@link
+   * SaslServerFactory}.</p>
+   *
+   * <p>For example, a provider that contains a factory class,
+   * <code>com.wiz.sasl.digest.ServerFactory</code>, that supports the
+   * <code>"DIGEST-MD5"</code> mechanism would register the following entry
+   * with the JCA:</p>
+   *
+   * <pre>
+   *    SaslServerFactory.DIGEST-MD5     com.wiz.sasl.digest.ServerFactory
+   * </pre>
+   *
+   * <p>See the "Java Cryptography Architecture API Specification &
+   * Reference" for information about how to install and configure security
+   * service providers.</p>
+   *
+   * @param mechanism the non-null mechanism name. It must be an
+   * IANA-registered name of a SASL mechanism. (e.g. "GSSAPI", "CRAM-MD5").
+   * @param protocol the non-null string name of the protocol for which the
+   * authentication is being performed (e.g. "ldap").
+   * @param serverName the non-null fully qualified host name of the server.
+   * @param props the possibly <code>null</code> set of properties used to
+   * select the SASL mechanism and to configure the authentication exchange of
+   * the selected mechanism. For example, if props contains the {@link
+   * Sasl#POLICY_NOPLAINTEXT} property with the value <code>"true"</code>, then
+   * the selected SASL mechanism must not be susceptible to simple plain
+   * passive attacks. In addition to the standard properties declared in this
+   * class, other, possibly mechanism-specific, properties can be included.
+   * Properties not relevant to the selected mechanism are ignored.
+   * @param cbh the possibly <code>null</code> callback handler to used by the
+   * SASL mechanisms to get further information from the application/library to
+   * complete the authentication. For example, a SASL mechanism might require
+   * the authentication ID, password and realm from the caller. The
+   * authentication ID is requested by using a
+   * {@link javax.security.auth.callback.NameCallback}. The password is
+   * requested by using a {@link javax.security.auth.callback.PasswordCallback}.
+   * The realm is requested by using a {@link RealmChoiceCallback} if there is
+   * a list of realms to choose from, and by using a {@link RealmCallback} if
+   * the realm must be entered.
+   * @return a possibly <code>null</code> {@link SaslServer} created using the
+   * parameters supplied. If <code>null</code>, the method cannot find a
+   * {@link SaslServerFactory} instance that will produce one.
+   * @throws SaslException if a {@link SaslServer} instance cannot be created
+   * because of an error.
+   */
+  public static SaslServer createSaslServer(String mechanism, String protocol,
+                                            String serverName,
+                                            Map props, CallbackHandler cbh)
+    throws SaslException
+  {
+    if (mechanism == null)
+      return null;
+    Provider[] providers = Security.getProviders();
+    if (providers == null || providers.length == 0)
+      return null;
+
+    SaslServer result = null;
+    SaslServerFactory factory = null;
+    String clazz = null, upper, alias = null;
+    int j;
+    Provider p;
+    for (j = 0; j < providers.length; j++)
+      {
+        p = providers[j];
+        if (p != null)
+          {
+            // try the name as is
+            clazz = p.getProperty(SERVER_FACTORY_SVC + mechanism);
+            if (clazz == null) // try all uppercase
+              {
+                upper = mechanism.toUpperCase();
+                clazz = p.getProperty(SERVER_FACTORY_SVC + upper);
+                if (clazz == null) // try if it's an alias
+                  {
+                    alias = p.getProperty(ALIAS + SERVER_FACTORY_SVC + mechanism);
+                    if (alias == null) // try all-uppercase alias name
+                      {
+                        alias = p.getProperty(ALIAS + SERVER_FACTORY_SVC + upper);
+                        if (alias == null) // spit the dummy
+                          continue;
+                      }
+                  }
+                clazz = p.getProperty(SERVER_FACTORY_SVC + alias);
+              }
+          }
+        if (clazz == null)
+          continue;
+        else
+          clazz = clazz.trim();
+
+        try
+          {
+            result = null;
+            factory = (SaslServerFactory) Class.forName(clazz).newInstance();
+            result =
+              factory.createSaslServer(mechanism, protocol, serverName, props, cbh);
+          }
+        catch (ClassCastException ignored) // ignore instantiation exceptions
+          {
+          }
+        catch (ClassNotFoundException ignored)
+          {
+          }
+        catch (InstantiationException ignored)
+          {
+          }
+        catch (IllegalAccessException ignored)
+          {
+          }
+        if (result != null)
+          return result;
+      }
+    return null;
+  }
+
+  /**
+   * Gets an enumeration of known factories for producing a {@link SaslServer}
+   * instance. This method uses the same sources for locating factories as
+   * <code>createSaslServer()</code>.
+   *
+   * @return a non-null {@link Enumeration} of known factories for producing a
+   * {@link SaslServer} instance.
+   * @see #createSaslServer(String,String,String,Map,CallbackHandler)
+   */
+  public static Enumeration getSaslServerFactories()
+  {
+    Vector result = new Vector();
+    HashSet names = new HashSet();
+    Provider[] providers = Security.getProviders();
+    Iterator it;
+    if (providers != null)
+      {
+        Provider p;
+        String key;
+        for (int i = 0; i < providers.length; i++)
+          {
+            p = providers[i];
+            for (it = p.keySet().iterator(); it.hasNext(); )
+              {
+                key = (String) it.next();
+                // add key's binding (a) it is a class of a server factory,
+                // and (b) the key does not include blanks
+                if (key.startsWith(SERVER_FACTORY_SVC) && key.indexOf(" ") == -1)
+                  {
+                    names.add(p.getProperty(key));
+                    break;
+                  }
+              }
+          }
+      }
+    // we have the factory class names in names; instantiate and enumerate
+    String c;
+    for (it = names.iterator(); it.hasNext(); )
+      {
+        c = (String) it.next();
+        try
+          {
+            SaslServerFactory f = (SaslServerFactory) Class.forName(c).newInstance();
+            if (f != null)
+              result.add(f);
+          }
+        catch (ClassCastException ignored) // ignore instantiation exceptions
+          {
+          }
+        catch (ClassNotFoundException ignored)
+          {
+          }
+        catch (InstantiationException ignored)
+          {
+          }
+        catch (IllegalAccessException ignored)
+          {
+          }
+      }
+
+    return result.elements();
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslClient.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslClient.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslClient.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslClient.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,232 @@
+/* SaslClient.java --
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.sasl;
+
+/**
+ * <p>Performs SASL authentication as a client.</p>
+ *
+ * <p>A protocol library such as one for LDAP gets an instance of this class in
+ * order to perform authentication defined by a specific SASL mechanism.
+ * Invoking methods on the <code>SaslClient</code> instance process challenges
+ * and create responses according to the SASL mechanism implemented by the
+ * <code>SaslClient</code>. As the authentication proceeds, the instance
+ * encapsulates the state of a SASL client's authentication exchange.</p>
+ *
+ * <p>Here's an example of how an LDAP library might use a <code>SaslClient</code>.
+ * It first gets an instance of a SaslClient:</p>
+ * <pre>
+ *SaslClient sc =
+ *      Sasl.createSaslClient(mechanisms, authorizationID, protocol,
+ *                            serverName, props, callbackHandler);
+ * </pre>
+ *
+ * <p>It can then proceed to use the client for authentication. For example, an
+ * LDAP library might use the client as follows:</p>
+ * <pre>
+ * // Get initial response and send to server
+ *byte[] response = sc.hasInitialResponse()
+ *      ? sc.evaluateChallenge(new byte[0]) : null;
+ *LdapResult res = ldap.sendBindRequest(dn, sc.getName(), response);
+ *while (!sc.isComplete()
+ *       && ((res.status == SASL_BIND_IN_PROGRESS) || (res.status == SUCCESS))) {
+ *   response = sc.evaluateChallenge( res.getBytes() );
+ *   if (res.status == SUCCESS) {
+ *      // we're done; don't expect to send another BIND
+ *      if ( response != null ) {
+ *         throw new SaslException(
+ *               "Protocol error: attempting to send response after completion");
+ *      }
+ *      break;
+ *   }
+ *   res = ldap.sendBindRequest(dn, sc.getName(), response);
+ *}
+ *if (sc.isComplete() && (res.status == SUCCESS) ) {
+ *   String qop = (String)sc.getNegotiatedProperty(Sasl.QOP);
+ *   if ((qop != null)
+ *         && (qop.equalsIgnoreCase("auth-int")
+ *            || qop.equalsIgnoreCase("auth-conf"))) {
+ *      // Use SaslClient.wrap() and SaslClient.unwrap() for future
+ *      // communication with server
+ *      ldap.in = new SecureInputStream(sc, ldap.in);
+ *      ldap.out = new SecureOutputStream(sc, ldap.out);
+ *   }
+ *}
+ * </pre>
+ *
+ * <p>If the mechanism has an initial response, the library invokes
+ * {@link #evaluateChallenge(byte[])} with an empty challenge to get the initial
+ * response. Protocols such as IMAP4, which do not include an initial response
+ * with their first authentication command to the server, initiate the
+ * authentication without first calling {@link #hasInitialResponse()} or
+ * {@link #evaluateChallenge(byte[])}. When the server responds to the command,
+ * it sends an initial challenge. For a SASL mechanism in which the client sends
+ * data first, the server should have issued a challenge with no data. This will
+ * then result in a call (on the client) to {@link #evaluateChallenge(byte[])}
+ * with an empty challenge.</p>
+ *
+ * @see Sasl
+ * @see SaslClientFactory
+ *
+ * @since 1.5
+ */
+public interface SaslClient
+{
+
+  /**
+   * Returns the IANA-registered mechanism name of this SASL client. (e.g.
+   * "CRAM-MD5", "GSSAPI").
+   *
+   * @return a non-null string representing the IANA-registered mechanism name.
+   */
+  String getMechanismName();
+
+  /**
+   * Determines if this mechanism has an optional initial response. If
+   * <code>true</code>, caller should call {@link #evaluateChallenge(byte[])}
+   * with an empty array to get the initial response.
+   *
+   * @return <code>true</code> if this mechanism has an initial response.
+   */
+  boolean hasInitialResponse();
+
+  /**
+   * Evaluates the challenge data and generates a response. If a challenge is
+   * received from the server during the authentication process, this method is
+   * called to prepare an appropriate next response to submit to the server.
+   *
+   * @param challenge the non-null challenge sent from the server. The
+   * challenge array may have zero length.
+   * @return the possibly <code>null</code> reponse to send to the server. It
+   * is <code>null</code> if the challenge accompanied a "SUCCESS" status and
+   * the challenge only contains data for the client to update its state and no
+   * response needs to be sent to the server. The response is a zero-length
+   * byte array if the client is to send a response with no data.
+   * @throws SaslException if an error occurred while processing the challenge
+   * or generating a response.
+   */
+  byte[] evaluateChallenge(byte[] challenge) throws SaslException;
+
+  /**
+   * Determines if the authentication exchange has completed. This method may
+   * be called at any time, but typically, it will not be called until the
+   * caller has received indication from the server (in a protocol-specific
+   * manner) that the exchange has completed.
+   *
+   * @return <code>true</code> if the authentication exchange has completed;
+   * <code>false</code> otherwise.
+   */
+  boolean isComplete();
+
+  /**
+   * <p>Unwraps a byte array received from the server. This method can be
+   * called only after the authentication exchange has completed (i.e., when
+   * {@link #isComplete()} returns <code>true</code>) and only if the
+   * authentication exchange has negotiated integrity and/or privacy as the
+   * quality of protection; otherwise, an {@link IllegalStateException} is
+   * thrown.</p>
+   *
+   * <p><code>incoming</code> is the contents of the SASL buffer as defined in
+   * RFC 2222 without the leading four octet field that represents the length.
+   * <code>offset</code> and <code>len</code> specify the portion of incoming
+   * to use.</p>
+   *
+   * @param incoming a non-null byte array containing the encoded bytes from
+   * the server.
+   * @param offset the starting position at <code>incoming</code> of the bytes
+   * to use.
+   * @param len the number of bytes from <code>incoming</code> to use.
+   * @return a non-null byte array containing the decoded bytes.
+   * @throws SaslException if <code>incoming</code> cannot be successfully
+   * unwrapped.
+   * @throws IllegalStateException if the authentication exchange has not
+   * completed, or if the negotiated quality of protection has neither
+   * integrity nor privacy.
+   */
+  byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException;
+
+  /**
+   * <p>Wraps a byte array to be sent to the server. This method can be called
+   * only after the authentication exchange has completed (i.e., when
+   * {@link #isComplete()} returns <code>true</code>) and only if the
+   * authentication exchange has negotiated integrity and/or privacy as the
+   * quality of protection; otherwise, an {@link IllegalStateException} is
+   * thrown.</p>
+   *
+   * <p>The result of this method will make up the contents of the SASL buffer
+   * as defined in RFC 2222 without the leading four octet field that
+   * represents the length. <code>offset</code> and <code>len</code> specify
+   * the portion of <code>outgoing</code> to use.</p>
+   *
+   * @param outgoing a non-null byte array containing the bytes to encode.
+   * @param offset the starting position at <code>outgoing</code> of the bytes
+   * to use.
+   * @param len the number of bytes from <code>outgoing</code> to use.
+   * @return a non-null byte array containing the encoded bytes.
+   * @throws SaslException if <code>outgoing</code> cannot be successfully
+   * wrapped.
+   * @throws IllegalStateException if the authentication exchange has not
+   * completed, or if the negotiated quality of protection has neither
+   * integrity nor privacy.
+   */
+  byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException;
+
+  /**
+   * Retrieves the negotiated property. This method can be called only after
+   * the authentication exchange has completed (i.e., when {@link #isComplete()}
+   * returns <code>true</code>); otherwise, an {@link IllegalStateException} is
+   * thrown.
+   *
+   * @param propName the non-null property name.
+   * @return the value of the negotiated property. If <code>null</code>, the
+   * property was not negotiated or is not applicable to this mechanism.
+   * @throws IllegalStateException if this authentication exchange has not
+   * completed.
+   */
+  Object getNegotiatedProperty(String propName);
+
+  /**
+   * Disposes of any system resources or security-sensitive information the
+   * <code>SaslClient</code> might be using. Invoking this method invalidates
+   * the <code>SaslClient</code> instance. This method is idempotent.
+   *
+   * @throws SaslException if a problem was encountered while disposing of the
+   * resources.
+   */
+  void dispose() throws SaslException;
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslClientFactory.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslClientFactory.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslClientFactory.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslClientFactory.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,118 @@
+/* SaslClientFactory.java
+   Copyright (C) 2003, 2005, Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.sasl;
+
+import java.util.Map;
+
+import javax.security.auth.callback.CallbackHandler;
+
+/**
+ * <p>An interface for creating instances of {@link SaslClient}. A class that
+ * implements this interface must be thread-safe and handle multiple
+ * simultaneous requests. It must also have a public constructor that accepts
+ * no arguments.</p>
+ *
+ * <p>This interface is not normally accessed directly by a client, which will
+ * use the {@link Sasl} static methods to create a client instance instead.
+ * However, a particular environment may provide and install a new or different
+ * <code>SaslClientFactory</code>.</p>
+ *
+ * @see SaslClient
+ * @see Sasl
+ *
+ * @since 1.5
+ */
+public interface SaslClientFactory
+{
+
+  /**
+   * Creates a {@link SaslClient} using the parameters supplied.
+   *
+   * @param mechanisms the non-null list of mechanism names to try. Each is the
+   * IANA-registered name of a SASL mechanism (e.g. "GSSAPI", "CRAM-MD5").
+   * @param authorizationID the possibly null protocol-dependent identification
+   * to be used for authorization. If <code>null</code> or empty, the server
+   * derives an authorization ID from the client's authentication credentials.
+   * When the SASL authentication completes successfully, the specified entity
+   * is granted access.
+   * @param protocol the non-null string name of the protocol for which the
+   * authentication is being performed (e.g. "ldap").
+   * @param serverName the non-null fully qualified host name of the server to
+   * authenticate to.
+   * @param props the possibly <code>null</code> set of properties used to
+   * select the SASL mechanism and to configure the authentication exchange of
+   * the selected mechanism. See the {@link Sasl} class for a list of standard
+   * properties. Other, possibly mechanism-specific, properties can be included.
+   * Properties not relevant to the selected mechanism are ignored.
+   * @param cbh the possibly <code>null</code> callback handler to used by the
+   * SASL mechanisms to get further information from the application/library to
+   * complete the authentication. For example, a SASL mechanism might require
+   * the authentication ID, password and realm from the caller. The
+   * authentication ID is requested by using a
+   * {@link javax.security.auth.callback.NameCallback}. The password is
+   * requested by using a {@link javax.security.auth.callback.PasswordCallback}.
+   * The realm is requested by using a {@link RealmChoiceCallback} if there is
+   * a list of realms to choose from, and by using a {@link RealmCallback} if
+   * the realm must be entered.
+   * @return a possibly <code>null</code> {@link SaslClient} created using the
+   * parameters supplied. If <code>null</code>, this factory cannot produce a
+   * {@link SaslClient} using the parameters supplied.
+   * @throws SaslException if a {@link SaslClient} instance cannot be created
+   * because of an error.
+   */
+  SaslClient createSaslClient(String[] mechanisms, String authorizationID,
+                              String protocol, String serverName, Map props,
+                              CallbackHandler cbh)
+    throws SaslException;
+
+  /**
+   * Returns an array of names of mechanisms that match the specified mechanism
+   * selection policies.
+   *
+   * @param props the possibly <code>null</code> set of properties used to
+   * specify the security policy of the SASL mechanisms. For example, if props
+   * contains the {@link Sasl#POLICY_NOPLAINTEXT} property with the value
+   * <code>"true"</code>, then the factory must not return any SASL mechanisms
+   * that are susceptible to simple plain passive attacks. See the {@link Sasl}
+   * class for a complete list of policy properties. Non-policy related
+   * properties, if present in props, are ignored.
+   * @return a non-null array containing IANA-registered SASL mechanism names.
+   */
+  String[] getMechanismNames(Map props);
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,187 @@
+/* SaslException.java
+   Copyright (C) 2003, 2005, Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.sasl;
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.Serializable;
+
+/**
+ * This class represents an error that has occurred when using SASL.
+ *
+ * @since 1.5
+ */
+public class SaslException extends IOException implements Serializable
+{
+
+  // Constants and variables
+  // -------------------------------------------------------------------------
+
+  private static final long serialVersionUID = 4579784287983423626L;
+
+  /**
+   * @serial The possibly null root cause exception.
+   */
+  private Throwable _exception = null;
+
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs a new instance of <code>SaslException</code>. The root
+   * exception and the detailed message are null.
+   */
+  public SaslException()
+  {
+    super();
+  }
+
+  /**
+   * Constructs a new instance of <code>SaslException</code> with a detailed
+   * message. The <code>root</code> exception is <code>null</code>.
+   *
+   * @param detail a possibly null string containing details of the exception.
+   * @see Throwable#getMessage()
+   */
+  public SaslException(String detail)
+  {
+    super(detail);
+  }
+
+  /**
+   * Constructs a new instance of <code>SaslException</code> with a detailed
+   * message and a root exception. For example, a <code>SaslException</code>
+   * might result from a problem with the callback handler, which might throw a
+   * {@link javax.security.auth.callback.UnsupportedCallbackException} if it
+   * does not support the requested callback, or throw an {@link IOException}
+   * if it had problems obtaining data for the callback. The
+   * <code>SaslException</code>'s root exception would be then be the exception
+   * thrown by the callback handler.
+   *
+   * @param detail a possibly <code>null</code> string containing details of
+   * the exception.
+   * @param ex a possibly <code>null</code> root exception that caused this
+   * exception.
+   * @see Throwable#getMessage()
+   * @see #getCause()
+   */
+  public SaslException(String detail, Throwable ex)
+  {
+    super(detail);
+    _exception = ex;
+  }
+
+  // Class methods
+  // -------------------------------------------------------------------------
+
+  // Instance methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Returns the cause of this throwable or <code>null</code> if the cause is
+   * nonexistent or unknown. The cause is the throwable that caused this
+   * exception to be thrown.
+   *
+   * @return the possibly <code>null</code> exception that caused this exception.
+   */
+  public Throwable getCause()
+  {
+    return _exception;
+  }
+
+  /**
+   * Prints this exception's stack trace to <code>System.err</code>. If this
+   * exception has a root exception; the stack trace of the root exception is
+   * also printed to <code>System.err</code>.
+   */
+  public void printStackTrace()
+  {
+    super.printStackTrace();
+    if (_exception != null)
+      _exception.printStackTrace();
+  }
+
+  /**
+   * Prints this exception's stack trace to a print stream. If this exception
+   * has a root exception; the stack trace of the root exception is also
+   * printed to the print stream.
+   *
+   * @param ps the non-null print stream to which to print.
+   */
+  public void printStackTrace(PrintStream ps)
+  {
+    super.printStackTrace(ps);
+    if (_exception != null)
+      _exception.printStackTrace(ps);
+  }
+
+  /**
+   * Prints this exception's stack trace to a print writer. If this exception
+   * has a root exception; the stack trace of the root exception is also
+   * printed to the print writer.
+   *
+   * @param pw the non-null print writer to use for output.
+   */
+  public void printStackTrace(PrintWriter pw)
+  {
+    super.printStackTrace(pw);
+    if (_exception != null)
+      _exception.printStackTrace(pw);
+  }
+
+  /**
+   * Returns the string representation of this exception. The string
+   * representation contains this exception's class name, its detailed
+   * messsage, and if it has a root exception, the string representation of the
+   * root exception. This string representation is meant for debugging and not
+   * meant to be interpreted programmatically.
+   *
+   * @return the non-null string representation of this exception.
+   * @see Throwable#getMessage()
+   */
+  public String toString()
+  {
+    StringBuffer sb = new StringBuffer(this.getClass().getName())
+      .append(": ").append(super.toString());
+    if (_exception != null)
+      sb.append("; caused by: ").append(_exception.toString());
+    return sb.toString();
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslServer.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslServer.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslServer.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslServer.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,227 @@
+/* SaslServer.java
+   Copyright (C) 2003, 2005, Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.sasl;
+
+/**
+ * <p>Performs SASL authentication as a server.</p>
+ *
+ * <p>A server such as an LDAP server gets an instance of this class in order to
+ * perform authentication defined by a specific SASL mechanism. Invoking methods
+ * on the <code>SaslServer</code> instance generates challenges corresponding to
+ * the SASL mechanism implemented by the <code>SaslServer</code> instance. As
+ * the authentication proceeds, the instance encapsulates the state of a SASL
+ * server's authentication exchange.</p>
+ *
+ * <p>Here's an example of how an LDAP server might use a <code>SaslServer</code>
+ * instance. It first gets an instance of a <code>SaslServer</code> for the SASL
+ * mechanism requested by the client:</p>
+ *
+ * <pre>
+ *SaslServer ss =
+ *      Sasl.createSaslServer(mechanism, "ldap", myFQDN, props, callbackHandler);
+ * </pre>
+ *
+ * <p>It can then proceed to use the server for authentication. For example,
+ * suppose the LDAP server received an LDAP BIND request containing the name of
+ * the SASL mechanism and an (optional) initial response. It then might use the
+ * server as follows:</p>
+ *
+ * <pre>
+ *while (!ss.isComplete()) {
+ *   try {
+ *      byte[] challenge = ss.evaluateResponse(response);
+ *      if (ss.isComplete()) {
+ *         status = ldap.sendBindResponse(mechanism, challenge, SUCCESS);
+ *      } else {
+ *         status = ldap.sendBindResponse(mechanism, challenge, SASL_BIND_IN_PROGRESS);
+ *         response = ldap.readBindRequest();
+ *      }
+ *   } catch (SaslException x) {
+ *      status = ldap.sendErrorResponse(x);
+ *      break;
+ *   }
+ *}
+ *if (ss.isComplete() && (status == SUCCESS)) {
+ *   String qop = (String) sc.getNegotiatedProperty(Sasl.QOP);
+ *   if (qop != null
+ *         && (qop.equalsIgnoreCase("auth-int")
+ *            || qop.equalsIgnoreCase("auth-conf"))) {
+ *      // Use SaslServer.wrap() and SaslServer.unwrap() for future
+ *      // communication with client
+ *      ldap.in = new SecureInputStream(ss, ldap.in);
+ *      ldap.out = new SecureOutputStream(ss, ldap.out);
+ *   }
+ *}
+ * </pre>
+ *
+ * @see Sasl
+ * @see SaslServerFactory
+ *
+ * @since 1.5
+ */
+public interface SaslServer
+{
+
+  /**
+   * Returns the IANA-registered mechanism name of this SASL server (e.g.
+   * "CRAM-MD5", "GSSAPI").
+   *
+   * @return a non-null string representing the IANA-registered mechanism name.
+   */
+  String getMechanismName();
+
+  /**
+   * Evaluates the response data and generates a challenge. If a response is
+   * received from the client during the authentication process, this method is
+   * called to prepare an appropriate next challenge to submit to the client.
+   * The challenge is <code>null</code> if the authentication has succeeded and
+   * no more challenge data is to be sent to the client. It is non-null if the
+   * authentication must be continued by sending a challenge to the client, or
+   * if the authentication has succeeded but challenge data needs to be
+   * processed by the client. {@link #isComplete()} should be called after each
+   * call to <code>evaluateResponse()</code>,to determine if any further
+   * response is needed from the client.
+   *
+   * @param response the non-null (but possibly empty) response sent by the
+   * client.
+   * @return the possibly <code>null</code> challenge to send to the client.
+   * It is <code>null</code> if the authentication has succeeded and there is
+   * no more challenge data to be sent to the client.
+   * @throws SaslException if an error occurred while processing the response
+   * or generating a challenge.
+   */
+  byte[] evaluateResponse(byte[] response) throws SaslException;
+
+  /**
+   * Determines if the authentication exchange has completed. This method is
+   * typically called after each invocation of {@link #evaluateResponse(byte[])}
+   * to determine whether the authentication has completed successfully or
+   * should be continued.
+   *
+   * @return <code>true</code> if the authentication exchange has completed;
+   * <code>false</code> otherwise.
+   */
+  boolean isComplete();
+
+  /**
+   * Reports the authorization ID in effect for the client of this session This
+   * method can only be called if {@link #isComplete()} returns <code>true</code>.
+   *
+   * @return the authorization ID of the client.
+   * @throws IllegalStateException if this authentication session has not
+   * completed.
+   */
+  String getAuthorizationID();
+
+  /**
+   * <p>Unwraps a byte array received from the client. This method can be called
+   * only after the authentication exchange has completed (i.e., when
+   * {@link #isComplete()} returns <code>true</code>) and only if the
+   * authentication exchange has negotiated integrity and/or privacy as the
+   * quality of protection; otherwise, an {@link IllegalStateException} is
+   * thrown.</p>
+   *
+   * <p><code>incoming</code> is the contents of the SASL buffer as defined in
+   * RFC 2222 without the leading four octet field that represents the length.
+   * <code>offset</code> and <code>len</code> specify the portion of incoming
+   * to use.</p>
+   *
+   * @param incoming a non-null byte array containing the encoded bytes from
+   * the client.
+   * @param offset the starting position at <code>incoming</code> of the bytes
+   * to use.
+   * @param len the number of bytes from <code>incoming</code> to use.
+   * @return a non-null byte array containing the decoded bytes.
+   * @throws SaslException if <code>incoming</code> cannot be successfully
+   * unwrapped.
+   * @throws IllegalStateException if the authentication exchange has not
+   * completed, or if the negotiated quality of protection has neither
+   * integrity nor privacy.
+   */
+  byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException;
+
+  /**
+   * <p>Wraps a byte array to be sent to the client. This method can be called
+   * only after the authentication exchange has completed (i.e., when
+   * {@link #isComplete()} returns <code>true</code>) and only if the
+   * authentication exchange has negotiated integrity and/or privacy as the
+   * quality of protection; otherwise, an {@link IllegalStateException} is
+   * thrown.</p>
+   *
+   * <p>The result of this method will make up the contents of the SASL buffer
+   * as defined in RFC 2222 without the leading four octet field that
+   * represents the length. <code>offset</code> and <code>len</code> specify
+   * the portion of <code>outgoing</code> to use.
+   *
+   * @param outgoing a non-null byte array containing the bytes to encode.
+   * @param offset the starting position at <code>outgoing</code> of the bytes
+   * to use.
+   * @param len the number of bytes from <code>outgoing</code> to use.
+   * @return a non-null byte array containing the encoded bytes.
+   * @throws SaslException if <code>outgoing</code> cannot be successfully
+   * wrapped.
+   * @throws IllegalStateException if the authentication exchange has not
+   * completed, or if the negotiated quality of protection has neither
+   * integrity nor privacy.
+   */
+  byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException;
+
+  /**
+   * Retrieves the negotiated property. This method can be called only after
+   * the authentication exchange has completed (i.e., when
+   * {@link #isComplete()} returns <code>true</code>); otherwise, an
+   * {@link IllegalStateException} is thrown.
+   *
+   * @return the value of the negotiated property. If <code>null</code>, the
+   * property was not negotiated or is not applicable to this mechanism.
+   * @throws IllegalStateException if this authentication exchange has not
+   * completed.
+   */
+  Object getNegotiatedProperty(String propName);
+
+  /**
+   * Disposes of any system resources or security-sensitive information the
+   * <code>SaslServer</code> might be using. Invoking this method invalidates
+   * the <code>SaslServer</code> instance. This method is idempotent.
+   *
+   * @throws SaslException if a problem was encountered while disposing of the
+   * resources.
+   */
+  void dispose() throws SaslException;
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslServerFactory.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslServerFactory.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslServerFactory.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/SaslServerFactory.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,115 @@
+/* SaslServerFactory.java
+   Copyright (C) 2003, 2005, Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.security.sasl;
+
+import java.util.Map;
+
+import javax.security.auth.callback.CallbackHandler;
+
+/**
+ * <p>An interface for creating instances of {@link SaslServer}. A class that
+ * implements this interface must be thread-safe and handle multiple
+ * simultaneous requests. It must also have a public constructor that accepts
+ * no arguments.</p>
+ *
+ * <p>This interface is not normally accessed directly by a server, which will
+ * use the {@link Sasl} static methods to create a {@link SaslServer} instance
+ * instead. However, a particular environment may provide and install a new or
+ * different <code>SaslServerFactory</code>.</p>
+ *
+ * @see SaslServer
+ * @see Sasl
+ *
+ * @since 1.5
+ */
+public interface SaslServerFactory
+{
+
+  /**
+   * Creates a {@link SaslServer} instance using the parameters supplied. It
+   * returns <code>null</code> if no {@link SaslServer} instance can be created
+   * using the parameters supplied. Throws {@link SaslException} if it cannot
+   * create a {@link SaslServer} because of an error.
+   *
+   * @param mechanism the non-null IANA-registered name of a SASL mechanism
+   * (e.g. "GSSAPI", "CRAM-MD5").
+   * @param protocol the non-null string name of the protocol for which the
+   * authentication is being performed (e.g. "ldap").
+   * @param serverName the non-null fully qualified host name of the server to
+   * authenticate to.
+   * @param props the possibly null set of properties used to select the SASL
+   * mechanism and to configure the authentication exchange of the selected
+   * mechanism. See the {@link Sasl} class for a list of standard properties.
+   * Other, possibly mechanism-specific, properties can be included. Properties
+   * not relevant to the selected mechanism are ignored.
+   * @param cbh the possibly null callback handler to used by the SASL
+   * mechanisms to get further information from the application/library to
+   * complete the authentication. For example, a SASL mechanism might require
+   * the authentication ID, password and realm from the caller. The
+   * authentication ID is requested by using a
+   * {@link javax.security.auth.callback.NameCallback}. The password is
+   * requested by using a {@link javax.security.auth.callback.PasswordCallback}.
+   * The realm is requested by using a {@link RealmChoiceCallback} if there is
+   * a list of realms to choose from, and by using a {@link RealmCallback} if
+   * the realm must be entered.
+   * @return a possibly null {@link SaslServer} created using the parameters
+   * supplied. If <code>null</code> is returned, it means that this factory
+   * cannot produce a {@link SaslServer} using the parameters supplied.
+   * @throws SaslException if a SaslServer instance cannot be created because
+   * of an error.
+   */
+  SaslServer createSaslServer(String mechanism, String protocol,
+                              String serverName, Map props, CallbackHandler cbh)
+    throws SaslException;
+
+  /**
+   * Returns an array of names of mechanisms that match the specified mechanism
+   * selection policies.
+   *
+   * @param props the possibly <code>null</code> set of properties used to
+   * specify the security policy of the SASL mechanisms. For example, if props
+   * contains the {@link Sasl#POLICY_NOPLAINTEXT} property with the value
+   * <code>"true"</code>, then the factory must not return any SASL mechanisms
+   * that are susceptible to simple plain passive attacks. See the {@link Sasl}
+   * class for a complete list of policy properties. Non-policy related
+   * properties, if present in props, are ignored.
+   * @return a non-null array containing IANA-registered SASL mechanism names.
+   */
+  String[] getMechanismNames(Map props);
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/package.html
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/package.html?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/package.html (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/security/sasl/package.html Thu Nov  8 16:56:19 2007
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.security.sasl package.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.security.sasl</title></head>
+
+<body>
+<p></p>
+
+</body>
+</html>

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/ControllerEventListener.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/ControllerEventListener.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/ControllerEventListener.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/ControllerEventListener.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,58 @@
+/* ControllerEventListener.java -- Listener for MIDI controller events
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+import java.util.EventListener;
+
+/**
+ * The interface defines the methods to be implemented by classes wanting 
+ * to be notified on MIDI controller events from a Sequencer.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public interface ControllerEventListener extends EventListener
+{
+  /**
+   * Called on MIDI controller events.
+   * @param event the controller change event message
+   */
+  public void controlChange(ShortMessage event);
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Instrument.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Instrument.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Instrument.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Instrument.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,77 @@
+/* Instrument.java -- A MIDI Instrument
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+/**
+ * The abstract base class for all MIDI instruments.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public abstract class Instrument extends SoundbankResource
+{
+  // The instrument patch.
+  private Patch patch;
+    
+  /**
+   * Create a new Instrument.
+   * 
+   * @param soundbank the Soundbank containing the instrument.
+   * @param patch the patch for this instrument
+   * @param name the name of this instrument
+   * @param dataClass the class used to represent sample data for this instrument
+   */
+  protected Instrument(Soundbank soundbank, Patch patch, 
+                       String name, Class dataClass)
+  {
+    super(soundbank, name, dataClass);
+    this.patch = patch; 
+  }
+  
+  /**
+   * Get the patch for this instrument.
+   * 
+   * @return the patch for this instrument
+   */
+  public Patch getPatch()
+  {
+    return patch;
+  } 
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/InvalidMidiDataException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/InvalidMidiDataException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/InvalidMidiDataException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/InvalidMidiDataException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,69 @@
+/* InvalidMidiDataException.java -- Thrown for invalid MIDI data.
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+/**
+ * This exception is thrown when we encounter bad MIDI data.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public class InvalidMidiDataException extends Exception
+{
+  private static final long serialVersionUID = 2780771756789932067L;
+ 
+  /**
+   * Create an InvalidMidiDataException object.
+   */
+  public InvalidMidiDataException()
+  {
+    super();
+  }
+
+  /**
+   * Create an InvalidMidiDataException object.
+   * 
+   * @param s the exception message string
+   */
+  public InvalidMidiDataException(String s)
+  {
+    super(s);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MetaEventListener.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MetaEventListener.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MetaEventListener.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MetaEventListener.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,58 @@
+/* MetaEventListener.java -- Listener for MIDI meta events
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+import java.util.EventListener;
+
+/**
+ * The interface defines the methods to be implemented by classes wanting 
+ * to be notified on MIDI meta events from a Sequencer.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public interface MetaEventListener extends EventListener
+{
+  /**
+   * Called on MIDI meta events.
+   * @param meta the meta event message
+   */
+  public void meta(MetaMessage meta);
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MetaMessage.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MetaMessage.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MetaMessage.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MetaMessage.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,176 @@
+/* MetaMessage.java -- A meta message for MIDI files.
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+/**
+ * A system exclusive MIDI message.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public class MetaMessage extends MidiMessage
+{
+  /**
+   * The META status code.  Only valid for MIDI files, not the wire protocol.
+   */
+  public static final int META = 0xFF;
+  
+  // The length of the variable length data length encoding.
+  private int lengthLength = 0;
+  
+  /**
+   * Create a default valid meta message.
+   * 
+   * The official specs don't specify what message is to be
+   * created.  For now, we create a zero length meta message 
+   * with a type code of 0.
+   */
+  public MetaMessage()
+  {
+    super(new byte[4]);
+    data[0] = (byte) META;
+    data[1] = (byte) 0; // Type
+    data[2] = (byte) 1; // Length length
+    data[3] = (byte) 0; // Length
+    lengthLength = 1;
+  }
+  
+  /**
+   * Create a MetaMessage object.
+   * @param data a complete system exclusive message
+   */
+  protected MetaMessage(byte[] data)
+  {
+    super(data);
+    int index = 2;
+    lengthLength = 1;
+    while ((data[index++] & 0x80) > 0)
+      lengthLength++;
+  }
+  
+  /**
+   * Set the meta message.
+   *  
+   * @param type the meta type byte (< 128)
+   * @param data the message data
+   * @param length the length of the message data
+   * @throws InvalidMidiDataException if this message is invalid
+   */
+  public void setMessage(int type, byte[] data, int length)
+    throws InvalidMidiDataException
+  {
+    if (type > 127)
+      throw new InvalidMidiDataException("Meta type 0x"
+                                         + Integer.toHexString(type)
+                                         + " must be less than 128");
+
+    // For a nice description of how variable length values are handled, 
+    // see http://www.borg.com/~jglatt/tech/midifile.htm
+    
+    // First compute the length of the length value
+    lengthLength = 0;
+    int lengthValue = length;
+    do {
+      lengthValue = lengthValue >> 7;
+      lengthLength++;
+    } while (lengthValue > 0);
+    
+    // Now allocate our data array
+    this.length = 2 + lengthLength + length;
+    this.data = new byte[this.length];
+    this.data[0] = (byte) META;
+    this.data[1] = (byte) type;
+    
+    // Now compute the length representation
+    long buffer = length & 0x7F;
+    while ((length >>= 7) > 0)
+    {
+      buffer <<= 8;
+      buffer |= ((length & 0x7F) | 0x80);
+    }
+    
+    // Now store the variable length length value
+    int index = 2;
+    do
+    {
+      this.data[index++] = (byte) (buffer & 0xFF);
+      if ((buffer & 0x80) == 0)
+        break;
+      buffer >>= 8;
+    } while (true);
+ 
+    // Now copy the real data.
+    System.arraycopy(data, 0, this.data, index, length);
+  }
+  
+  /**
+   * Get the meta message type.
+   * 
+   * @return the meta message type
+   */
+  public int getType()
+  {
+    return data[1];
+  }
+  
+  /**
+   * Get the data for this message, not including the status,
+   * type, or length information.
+   * 
+   * @return the message data, not including status, type or lenght info
+   */
+  public byte[] getData()
+  {
+    int dataLength = length - 2 - lengthLength;
+    byte[] result = new byte[dataLength];
+    System.arraycopy(data, 2 + lengthLength, result, 0, dataLength);
+    return result;
+  }
+  
+  /* Create a deep-copy clone of this object.
+   * @see java.lang.Object#clone()
+   */
+  public Object clone()
+  {
+    byte message[] = new byte[length];
+    System.arraycopy(data, 0, message, 0, length);
+    return new MetaMessage(message); 
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiChannel.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiChannel.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiChannel.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiChannel.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,236 @@
+/* MidiChannel.java -- A MIDI channel
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+/**
+ * A MIDI channel.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public interface MidiChannel
+{
+  
+  /**
+   * Start playing a note.
+   * 
+   * @param noteNumber the MIDI note number
+   * @param velocity the velocity at which the key was pressed
+   */
+  public void noteOn(int noteNumber, int velocity);
+  
+  /**
+   * Stop playing a note.
+   *
+   * @param noteNumber the MIDI note number
+   * @param velocity the volcity at which the ket was released
+   */
+  public void noteOff(int noteNumber, int velocity);
+  
+  /**
+   * Stop playing a note.
+   * 
+   * @param noteNumber the MIDI note number
+   */
+  public void noteOff(int noteNumber);
+  
+  /**
+   * Change in a key pressure for a note.
+   * 
+   * @param noteNumber the MIDI note number
+   * @param pressure the key pressure
+   */
+  public void setPolyPressure(int noteNumber, int pressure);
+  
+  /**
+   * Get the key pressure for a note.
+   * 
+   * @param noteNumber the MIDI note number
+   * @return the key pressure
+   */
+  public int getPolyPressure(int noteNumber);
+  
+  /**
+   * Set the key pressure for the channel.
+   * 
+   * @param pressure the key pressure
+   */
+  public void setChannelPressure(int pressure);
+  
+  /**
+   * Get the key pressure for the channel.
+   * 
+   * @return the key pressure
+   */
+  public int getChannelPressure();
+  
+  /**
+   * Set a change in a controller's value.
+   * 
+   * @param controller the MIDI controller number (0 to 127)
+   * @param value the new value (0 to 127)
+   */
+  public void controlChange(int controller, int value);
+  
+  /**
+   * Get a controller's value.
+   * 
+   * @param controller the MIDI controller number (0 to 127)
+   * @return the controller's value (0 to 127)
+   */
+  public int getController(int controller);
+  
+  /**
+   * Change the patch for this channel.
+   * 
+   * @param program the patch number to switch to (0 to 127)
+   */
+  public void programChange(int program);
+  
+  /**
+   * Change the bank and patch for this channel.
+   * 
+   * @param bank the bank to switch to (0 to 16383)
+   * @param program the patch to switch to (0 to 127)
+   */
+  public void programChange(int bank, int program);
+  
+  /**
+   * Get the current patch for this channel.
+   * 
+   * @return current patch (0 to 127)
+   */
+  public int getProgram();
+  
+  /**
+   * Change the pitch bend for this channel using a positive 14-bit value.
+   * 
+   * @param bend the new pitch bend value
+   */
+  public void setPitchBend(int bend);
+  
+  /**
+   * Get the pitch bend for this channel as a positive 14-bit value.
+   * 
+   * @return the current patch bend value
+   */
+  public int getPitchBend();
+  
+  /**
+   * Reset all MIDI controllers to their default values.
+   */
+  public void resetAllControllers();
+  
+  /**
+   * Stop playing all notes.  Sound may not stop.
+   */
+  public void allNotesOff();
+  
+  /**
+   * Stop all sound.
+   */
+  public void allSoundOff();
+  
+  /**
+   * Set whether or not local controls are on or off.  They are on by
+   * default.
+   * 
+   * @param on true to enable local controls, false to disable
+   * @return the new value
+   */
+  public boolean localControl(boolean on);
+  
+  /**
+   * Turns mono mode on or off.
+   * 
+   * @param on true to enable mono mode, false to disable 
+   */
+  public void setMono(boolean on);
+  
+  /**
+   * Get the current mono mode.
+   * 
+   * @return true if mono is enabled, false otherwise
+   */
+  public boolean getMono();
+  
+  /**
+   * Turns omni mode on or off.
+   * 
+   * @param on true to enable omni mode, false to disable
+   */
+  public void setOmni(boolean on);
+  
+  /**
+   * Get the current omni mode.
+   * 
+   * @return true if omni is enabled, false otherwise
+   */
+  public boolean getOmni();
+  
+  /**
+   * Turns mute mode on or off.
+   * 
+   * @param mute true to enable mute mode, false to disable
+   */
+  public void setMute(boolean mute);
+  
+  /**
+   * Get the current mute mode.
+   * 
+   * @return true if mute is enabled, false otherwise
+   */
+  public boolean getMute();
+  
+  /**
+   * Turns solo mode on or off.  If any channels are soloed, then only those
+   * channels make sounds, otherwise all channels will make sound.
+   * 
+   * @param solo true to enable solo mode, false to disable
+   */
+  public void setSolo(boolean solo);
+  
+  /**
+   * Get the current solo mode.
+   * 
+   * @return true is solo is enabled, false otherwise.
+   */
+  public boolean getSolo();
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiDevice.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiDevice.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiDevice.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiDevice.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,220 @@
+/* MidiDevice.java -- Interface for MIDI devices
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+/**
+ * Interface for all MIDI devices.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public interface MidiDevice
+{
+  /**
+   * Get the Info object describing this device.
+   * @return the Info object describing this device
+   */
+  public Info getDeviceInfo();
+  
+  /**
+   * Open this MIDI device and allocate any system resource we need.
+   * 
+   * @throws MidiUnavailableException if we're not able to open for some reason
+   */
+  public void open() throws MidiUnavailableException;
+  
+  /**
+   * Close this MIDI device, and release any system resources we're using.
+   */
+  public void close();
+  
+  /**
+   * Returns true if this MIDI device is open and false otherwise.
+   * 
+   * @return true if this is open, false otherwise
+   */
+  public boolean isOpen();
+  
+  /**
+   * If this device supports time-stamps, then it will return the number
+   * of microseconds since this device has been open, and -1 otherwise.
+   * 
+   * @return -1 or the number of microseconds since this was opened
+   */
+  public long getMicrosecondPosition();
+  
+  /**
+   * The maximum number of MIDI IN connections we can get as Receivers,
+   * or -1 if there is no maximum.
+   * 
+   * @return -1 or the maximum number of Receivers we can get
+   */
+  public int getMaxReceivers();
+  
+  /**
+   * The maximum number of MIDI OUT connections we can get as Transmitters,
+   * or -1 if there is no maximum.
+   * 
+   * @return -1 or the maximum number of Transmitters we can get
+   */
+  public int getMaxTransmitters();
+  
+  /**
+   * Get a MIDI IN Receiver for this device.
+   * 
+   * @return a MIDI IN Receiver for this device
+   * @throws MidiUnavailableException if we can't get a Receiver
+   */
+  public Receiver getReceiver() throws MidiUnavailableException;
+  
+  /**
+   * Get a MIDI OUT Transmitter for this device.
+   * 
+   * @return a MIDI OUT Transmitter for this device
+   * @throws MidiUnavailableException if we can't get a Transmitter
+   */
+  public Transmitter getTransmitter() throws MidiUnavailableException;
+  
+  /**
+   * A MIDI device descriptor object.
+   * 
+   * @author green at redhat.com
+   *
+   */
+  public static class Info
+  {
+    // Private data describing this device
+    private String name;
+    private String vendor;
+    private String description;
+    private String version;
+    
+    /**
+     * Create an Info object for a MIDI device
+     * 
+     * @param name the device name
+     * @param vendor the vendor name
+     * @param description the device description
+     * @param version the device version string
+     */
+    protected Info(String name, String vendor, String description, String version)
+    {
+      this.name = name;
+      this.vendor = vendor;
+      this.description = description;
+      this.version = version;
+    }
+    
+    /**
+     * This equals method only returns true if this object
+     * is the same as obj.
+     * 
+     * @param obj the object we're comparing to
+     * @return true if this is the same object
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public final boolean equals(Object obj)
+    {
+      return super.equals(obj);
+    }
+  
+    /**
+     * A hash code for this object.
+     *     
+     * @return the hash code for this object
+     * @see java.lang.Object#hashCode()
+     */
+    public final int hashCode()
+    {
+      return super.hashCode();
+    }
+  
+    /**
+     * Get the device name.
+     * 
+     * @return the device name
+     */
+    public final String getName()
+    {
+      return name;
+    }
+    
+    /**
+     * Get the device vendor.
+     * 
+     * @return the device vendor
+     */
+    public final String getVendor()
+    {
+      return vendor;
+    }
+    
+    /**
+     * Get the device description
+     * 
+     * @return the device description
+     */
+    public final String getDescription()
+    {
+      return description;
+    }
+    
+    /**
+     * get the device version
+     * 
+     * @return the device version
+     */
+    public final String getVersion()
+    {
+      return version;
+    }
+    
+    /**
+     * Simple return the name of the device.
+     * 
+     * @return the device name
+     * @see java.lang.Object#toString()
+     */
+    public final String toString()
+    {
+      return name;
+    }
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiEvent.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiEvent.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiEvent.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiEvent.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,95 @@
+/* MidiEvent.java -- A MIDI Event
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+/**
+ * A MIDI event is the combination of a MIDI message and a timestamp specified
+ * in MIDI ticks.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public class MidiEvent
+{
+  private final MidiMessage message;
+  private long tick;
+  
+  /**
+   * Create a MIDI event object from the given MIDI message and timestamp.
+   * 
+   * @param message the MidiMessage for this event
+   * @param tick the timestamp for this event
+   */
+  public MidiEvent(MidiMessage message, long tick)
+  {
+    this.message = message;
+    this.tick = tick;
+  }
+  
+  /**
+   * Get the MIDI message for this event.
+   * 
+   * @return the MidiMessage for this event
+   */
+  public MidiMessage getMessage()
+  {
+    return message;
+  }
+  
+  /**
+   * Set the timestemp for this event in MIDI ticks.
+   * 
+   * @param tick the timestamp
+   */
+  public void setTick(long tick)
+  {
+    this.tick = tick;
+  }
+  
+  /**
+   * Get the timestamp for this event in MIDI ticks.
+   * 
+   * @return the timestamp for this even in MIDI ticks
+   */
+  public long getTick()
+  {
+    return tick;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiFileFormat.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiFileFormat.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiFileFormat.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiFileFormat.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,158 @@
+/* MidiFileFormat.java -- Information about a MIDI file
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+/**
+ * Describe a MIDI file, including specifics about its type, length and timing.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public class MidiFileFormat
+{
+  /**
+   * The MIDI file type.  This is either 0, 1 or 2.  
+   * 
+   * Type 0 files contain a single track and represents a single song
+   * performance.
+   * Type 1 may contain multiple tracks for a single song performance.
+   * Type 2 may contain multiple tracks, each representing a
+   * separate song performance.
+   * 
+   * See http://en.wikipedia.org/wiki/MIDI#MIDI_file_formats for more
+   * information.
+   */
+  protected int type;
+
+  /**
+   * The division type of the MIDI file. 
+   */
+  protected float divisionType;
+  
+  /**
+   * The timing resolution of the MIDI file.
+   */
+  protected int resolution;
+  
+  /**
+   * The size of the MIDI file in bytes. 
+   */
+  protected int byteLength = UNKNOWN_LENGTH;
+  
+  /**
+   * The length of the MIDI file in microseconds. 
+   */
+  protected long microsecondLength = UNKNOWN_LENGTH;
+  
+  /**
+   * A special value indicating an unknown quantity.
+   */
+  public static final int UNKNOWN_LENGTH = -1; // FIXME is this really -1?
+  
+  /**
+   * Create a MidiFileFormat object from the given parameters.
+   *
+   * @param type the MIDI file type (0, 1, or 2)
+   * @param divisionType the MIDI file division type
+   * @param resolution the MIDI file timing resolution
+   * @param bytes the MIDI file size in bytes
+   * @param microseconds the MIDI file length in microseconds
+   */
+  public MidiFileFormat(int type, float divisionType, 
+			int resolution, int bytes, long microseconds)
+  {
+    this.type = type;
+    this.divisionType = divisionType;
+    this.resolution = resolution;
+    this.byteLength = bytes;
+    this.microsecondLength = microseconds;
+  }
+  
+  /**
+   * Get the MIDI file type (0, 1, or 2).
+   * 
+   * @return the MIDI file type (0, 1, or 2)
+   */
+  public int getType()
+  {
+    return type;
+  }
+  
+  /**
+   * Get the file division type.
+   * 
+   * @return the file divison type
+   */
+  public float getDivisionType()
+  {
+    return divisionType;    
+  }
+  
+  /**
+   * Get the file timing resolution.  If the division type is PPQ, then this
+   * is value represents ticks per beat, otherwise it's ticks per frame (SMPTE).
+   * 
+   * @return the timing resolution in ticks per beat or ticks per frame
+   */
+  public int getResolution()
+  {
+    return resolution;
+  }
+  
+  /**
+   * Get the file length in bytes.
+   * 
+   * @return the file length in bytes or UNKNOWN_LENGTH
+   */
+  public int getByteLength()
+  {
+    return byteLength;
+  }
+
+  /**
+   * Get the file length in microseconds.
+   * 
+   * @return the file length in microseconds or UNKNOWN_LENGTH
+   */
+  public long getMicrosecondLength()
+  {
+    return microsecondLength;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiMessage.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiMessage.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiMessage.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiMessage.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,126 @@
+/* MidiMessage.java -- base class for MIDI messages.
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+/**
+ * The base class for all MIDI messages.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public abstract class MidiMessage implements Cloneable
+{
+  /**
+   * MIDI message data.
+   */
+  protected byte data[];
+  
+  /**
+   * The total length of the MIDI message.
+   */
+  protected int length;
+  
+  /**
+   * MidiMessage contructor.
+   * 
+   * @param data a valid MIDI message
+   */
+  protected MidiMessage(byte[] data)
+  {
+    this.data = data;
+    this.length = data.length;
+  }
+  
+  /**
+   * Set the complete MIDI message.
+   * 
+   * @param data The complete MIDI message.
+   * @param length The length of the MIDI message.
+   * @throws InvalidMidiDataException Thrown when the MIDI message is invalid.
+   */
+  protected void setMessage(byte[] data, int length) 
+    throws InvalidMidiDataException
+  {
+    this.data = new byte[length];
+    System.arraycopy(data, 0, this.data, 0, length);
+    this.length = length;
+  }
+  
+  /**
+   * Get the MIDI message data.
+   * 
+   * @return an array containing the MIDI message data
+   */
+  public byte[] getMessage()
+  {
+    byte copy[] = new byte[length];
+    System.arraycopy(data, 0, copy, 0, length);
+    return copy;    
+  }
+  
+  /**
+   * Get the status byte of the MIDI message (as an int)
+   * 
+   * @return the status byte of the MIDI message (as an int), or zero if the message length is zero.
+   */
+  public int getStatus()
+  {
+    if (length > 0)
+      return (data[0] & 0xff);
+    else 
+      return 0;
+  }
+  
+  /**
+   * Get the length of the MIDI message.
+   * 
+   * @return the length of the MIDI messsage
+   */
+  public int getLength()
+  {
+    return length;
+  }
+  
+  /* Create a clone of this object.
+   * 
+   * @see java.lang.Object#clone()
+   */
+  public abstract Object clone();
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiSystem.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiSystem.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiSystem.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiSystem.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,571 @@
+/* MidiSystem.java -- Access system MIDI resources
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+import gnu.classpath.ServiceFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Iterator;
+
+import javax.sound.midi.spi.MidiDeviceProvider;
+import javax.sound.midi.spi.MidiFileReader;
+import javax.sound.midi.spi.MidiFileWriter;
+import javax.sound.midi.spi.SoundbankReader;
+
+/**
+ * MidiSystem provides access to the computer system's MIDI resources, 
+ * as well as utility routines for reading MIDI files and more.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public class MidiSystem
+{
+  private MidiSystem()
+  {
+    // Not instantiable.
+  }
+
+  /**
+   * Get an array of all available MIDI devices.
+   * 
+   * @return a possibly empty array of all available MIDI devices
+   */
+  public static MidiDevice.Info[] getMidiDeviceInfo()
+  {
+    Iterator deviceProviders = 
+	ServiceFactory.lookupProviders(MidiDeviceProvider.class);
+    List infoList = new ArrayList();
+    
+    while (deviceProviders.hasNext())
+    {
+      MidiDeviceProvider provider = (MidiDeviceProvider) deviceProviders.next();
+      MidiDevice.Info[] infos = provider.getDeviceInfo();
+      for (int i = infos.length; i > 0; )
+        infoList.add(infos[--i]);
+    }
+    
+    return (MidiDevice.Info[]) 
+	infoList.toArray(new MidiDevice.Info[infoList.size()]);
+  }
+  
+  /**
+   * Get the specified MIDI device.
+   * 
+   * @param info a description of the device we're looking for
+   * @return the requested MIDI device
+   * @throws MidiUnavailableException if no MIDI devices are configured or found
+   * @throws IllegalArgumentException if the device described by info is not found
+   */
+  public static MidiDevice getMidiDevice(MidiDevice.Info info) 
+    throws MidiUnavailableException
+  {
+    Iterator deviceProviders = 
+	ServiceFactory.lookupProviders(MidiDeviceProvider.class);
+    
+    if (! deviceProviders.hasNext())
+      throw new MidiUnavailableException("No MIDI device providers available.");
+    
+    do
+    {
+      MidiDeviceProvider provider = 
+        (MidiDeviceProvider) deviceProviders.next();
+      if (provider.isDeviceSupported(info))
+        return provider.getDevice(info);
+    } while (deviceProviders.hasNext());
+    
+    throw new IllegalArgumentException("MIDI device " 
+				       + info + " not available.");
+  }
+  
+  /**
+   * Get the default Receiver instance.  This just picks the first one
+   * it finds for now.
+   * 
+   * @return the default Receiver instance
+   * @throws MidiUnavailableException if no Receiver is found
+   */
+  public static Receiver getReceiver() throws MidiUnavailableException
+  {
+    // TODO: The 1.5 spec has a fancy mechanism to specify the default
+    // receiver device.  For now, well just return the first one we find.
+    MidiDevice.Info[] infos = getMidiDeviceInfo();
+    for (int i = 0; i < infos.length; i++)
+    {
+      MidiDevice device = getMidiDevice(infos[i]);
+      if (device instanceof Receiver)
+        return (Receiver) device;
+    }
+    throw new MidiUnavailableException("No Receiver device available");
+  }
+
+  /**
+   * Get the default Transmitter instance.  This just picks the first one
+   * it finds for now.
+   * 
+   * @return the default Transmitter instance
+   * @throws MidiUnavailableException if no Transmitter is found
+   */
+  public static Transmitter getTransmitter() throws MidiUnavailableException
+  {
+    // TODO: The 1.5 spec has a fancy mechanism to specify the default
+    // Transmitter device.  For now, well just return the first one we find.
+    MidiDevice.Info[] infos = getMidiDeviceInfo();
+    for (int i = 0; i < infos.length; i++)
+    {
+      MidiDevice device = getMidiDevice(infos[i]);
+      if (device instanceof Transmitter)
+        return (Transmitter) device;
+    }
+    throw new MidiUnavailableException("No Transmitter device available");
+  }
+
+  /**
+   * Get the default Synthesizer instance.  This just picks the first one
+   * it finds for now.
+   * 
+   * @return the default Synthesizer instance
+   * @throws MidiUnavailableException if no Synthesizer is found
+   */
+  public static Synthesizer getSynthesizer() throws MidiUnavailableException
+  {
+    // TODO: The 1.5 spec has a fancy mechanism to specify the default
+    // Synthesizer device.  For now, well just return the first one we find.
+    MidiDevice.Info[] infos = getMidiDeviceInfo();
+    for (int i = 0; i < infos.length; i++)
+    {
+      MidiDevice device = getMidiDevice(infos[i]);
+      if (device instanceof Synthesizer)
+        return (Synthesizer) device;
+    }
+    throw new MidiUnavailableException("No Synthesizer device available");
+  }
+  
+  /**
+   * Get the default Sequencer instance.  This just picks the first one
+   * it finds for now.
+   * 
+   * @return the default Sequencer instance
+   * @throws MidiUnavailableException if no Sequencer is found
+   */
+  public static Sequencer getSequencer() throws MidiUnavailableException
+  {
+    // TODO: The 1.5 spec has a fancy mechanism to specify the default
+    // Sequencer device.  For now, well just return the first one we find.
+    MidiDevice.Info[] infos = getMidiDeviceInfo();
+    for (int i = 0; i < infos.length; i++)
+    {
+      MidiDevice device = getMidiDevice(infos[i]);
+      if (device instanceof Sequencer)
+        return (Sequencer) device;
+    }
+    throw new MidiUnavailableException("No Sequencer device available");
+  }  
+  
+  /**
+   * Read a Soundbank object from the given stream.
+   * 
+   * @param stream the stream from which to read the Soundbank
+   * @return the Soundbank object
+   * @throws InvalidMidiDataException if we were unable to read the soundbank
+   * @throws IOException if an I/O error happened while reading
+   */
+  public static Soundbank getSoundbank(InputStream stream)
+    throws InvalidMidiDataException, IOException
+  {
+    Iterator readers = ServiceFactory.lookupProviders(SoundbankReader.class);
+    while (readers.hasNext())
+    {
+      SoundbankReader sr = (SoundbankReader) readers.next();
+      Soundbank sb = sr.getSoundbank(stream);
+      if (sb != null)
+        return sb;
+    }
+    throw new InvalidMidiDataException("Cannot read soundbank from stream");
+  }
+
+  /**
+   * Read a Soundbank object from the given url.
+   * 
+   * @param url the url from which to read the Soundbank
+   * @return the Soundbank object
+   * @throws InvalidMidiDataException if we were unable to read the soundbank
+   * @throws IOException if an I/O error happened while reading
+   */
+  public static Soundbank getSoundbank(URL url)
+    throws InvalidMidiDataException, IOException
+  {
+    Iterator readers = ServiceFactory.lookupProviders(SoundbankReader.class);
+    while (readers.hasNext())
+    {
+      SoundbankReader sr = (SoundbankReader) readers.next();
+      Soundbank sb = sr.getSoundbank(url);
+      if (sb != null)
+        return sb;
+    }
+    throw new InvalidMidiDataException("Cannot read from url " + url);
+  }
+
+  /**
+   * Read a Soundbank object from the given file.
+   * 
+   * @param file the file from which to read the Soundbank
+   * @return the Soundbank object
+   * @throws InvalidMidiDataException if we were unable to read the soundbank
+   * @throws IOException if an I/O error happened while reading
+   */
+  public static Soundbank getSoundbank(File file)
+    throws InvalidMidiDataException, IOException
+  {
+    Iterator readers = ServiceFactory.lookupProviders(SoundbankReader.class);
+    while (readers.hasNext())
+    {
+      SoundbankReader sr = (SoundbankReader) readers.next();
+      Soundbank sb = sr.getSoundbank(file);
+      if (sb != null)
+        return sb;
+    }
+    throw new InvalidMidiDataException("Cannot read soundbank from file " 
+				       + file);
+  } 
+
+  /**
+   * Read a MidiFileFormat object from the given stream.
+   * 
+   * @param stream the stream from which to read the MidiFileFormat
+   * @return the MidiFileFormat object
+   * @throws InvalidMidiDataException if we were unable to read the MidiFileFormat
+   * @throws IOException if an I/O error happened while reading
+   */
+  public static MidiFileFormat getMidiFileFormat(InputStream stream)
+    throws InvalidMidiDataException, IOException
+  {
+    Iterator readers = ServiceFactory.lookupProviders(MidiFileReader.class);
+    while (readers.hasNext())
+    {
+      MidiFileReader sr = (MidiFileReader) readers.next();
+      MidiFileFormat sb = sr.getMidiFileFormat(stream);
+      if (sb != null)
+        return sb;
+    }
+    throw new InvalidMidiDataException("Can't read MidiFileFormat from stream");
+  }
+
+  /**
+   * Read a MidiFileFormat object from the given url.
+   * 
+   * @param url the url from which to read the MidiFileFormat
+   * @return the MidiFileFormat object
+   * @throws InvalidMidiDataException if we were unable to read the MidiFileFormat
+   * @throws IOException if an I/O error happened while reading
+   */
+  public static MidiFileFormat getMidiFileFormat(URL url)
+    throws InvalidMidiDataException, IOException
+  {
+    Iterator readers = ServiceFactory.lookupProviders(MidiFileReader.class);
+    while (readers.hasNext())
+    {
+      MidiFileReader sr = (MidiFileReader) readers.next();
+      MidiFileFormat sb = sr.getMidiFileFormat(url);
+      if (sb != null)
+        return sb;
+    }
+    throw new InvalidMidiDataException("Cannot read from url " + url);
+  }
+
+  /**
+   * Read a MidiFileFormat object from the given file.
+   * 
+   * @param file the file from which to read the MidiFileFormat
+   * @return the MidiFileFormat object
+   * @throws InvalidMidiDataException if we were unable to read the MidiFileFormat
+   * @throws IOException if an I/O error happened while reading
+   */
+  public static MidiFileFormat getMidiFileFormat(File file)
+    throws InvalidMidiDataException, IOException
+  {
+    Iterator readers = ServiceFactory.lookupProviders(MidiFileReader.class);
+    while (readers.hasNext())
+    {
+      MidiFileReader sr = (MidiFileReader) readers.next();
+      MidiFileFormat sb = sr.getMidiFileFormat(file);
+      if (sb != null)
+        return sb;
+    }
+    throw new InvalidMidiDataException("Can't read MidiFileFormat from file " 
+                                       + file);
+  } 
+  
+  /**
+   * Read a Sequence object from the given stream.
+   * 
+   * @param stream the stream from which to read the Sequence
+   * @return the Sequence object
+   * @throws InvalidMidiDataException if we were unable to read the Sequence
+   * @throws IOException if an I/O error happened while reading
+   */
+  public static Sequence getSequence(InputStream stream)
+    throws InvalidMidiDataException, IOException
+  {
+    Iterator readers = ServiceFactory.lookupProviders(MidiFileReader.class);
+    while (readers.hasNext())
+    {
+      MidiFileReader sr = (MidiFileReader) readers.next();
+      Sequence sq = sr.getSequence(stream);
+      if (sq != null)
+        return sq;
+    }
+    throw new InvalidMidiDataException("Can't read Sequence from stream");
+  }
+
+  /**
+   * Read a Sequence object from the given url.
+   * 
+   * @param url the url from which to read the Sequence
+   * @return the Sequence object
+   * @throws InvalidMidiDataException if we were unable to read the Sequence
+   * @throws IOException if an I/O error happened while reading
+   */
+  public static Sequence getSequence(URL url)
+    throws InvalidMidiDataException, IOException
+  {
+    Iterator readers = ServiceFactory.lookupProviders(MidiFileReader.class);
+    while (readers.hasNext())
+    {
+      MidiFileReader sr = (MidiFileReader) readers.next();
+      Sequence sq = sr.getSequence(url);
+      if (sq != null)
+        return sq;
+    }
+    throw new InvalidMidiDataException("Cannot read from url " + url);
+  }
+
+  /**
+   * Read a Sequence object from the given file.
+   * 
+   * @param file the file from which to read the Sequence
+   * @return the Sequence object
+   * @throws InvalidMidiDataException if we were unable to read the Sequence
+   * @throws IOException if an I/O error happened while reading
+   */
+  public static Sequence getSequence(File file)
+    throws InvalidMidiDataException, IOException
+  {
+    Iterator readers = ServiceFactory.lookupProviders(MidiFileReader.class);
+    while (readers.hasNext())
+    {
+      MidiFileReader sr = (MidiFileReader) readers.next();
+      Sequence sq = sr.getSequence(file);
+      if (sq != null)
+        return sq;
+    }
+    throw new InvalidMidiDataException("Can't read Sequence from file " 
+                                       + file);
+  } 
+  
+  /**
+   * Return an array of supported MIDI file types on this system.
+   * 
+   * @return the array of supported MIDI file types
+   */
+  public static int[] getMidiFileTypes()
+  {
+    // We only support a max of 3 MIDI file types.
+    boolean supported[] = new boolean[3];
+    // The number of supported formats.
+    int count = 0;
+    Iterator writers = ServiceFactory.lookupProviders(MidiFileWriter.class);
+    while (writers.hasNext())
+    {
+      MidiFileWriter fw = (MidiFileWriter) writers.next();
+      int types[] = fw.getMidiFileTypes();
+      for (int i = types.length; i > 0;)
+      {
+        int type = types[--i];
+        if (supported[type] == false)
+        {
+          count++;
+          supported[type] = true;
+        }
+      }
+    }
+    int result[] = new int[count];
+    for (int i = supported.length; i > 0;)
+    {
+      if (supported[--i])
+        result[--count] = i;
+    }
+    return result;
+  }
+
+  /**
+   * Return true if the system supports writing files of type fileType.
+   * 
+   * @param fileType the MIDI file type we want to write
+   * @return true if we can write fileType files, false otherwise
+   */
+  public static boolean isFileTypeSupported(int fileType)
+  {
+    Iterator writers = ServiceFactory.lookupProviders(MidiFileWriter.class);
+    while (writers.hasNext())
+    {
+      MidiFileWriter fw = (MidiFileWriter) writers.next();
+      
+      if (fw.isFileTypeSupported(fileType))
+        return true;
+    }
+    return false;
+  }
+  
+  /**
+   * Return an array of supported MIDI file types on this system
+   * for the given sequnce.
+   * 
+   * @param sequence the sequnce to write
+   * @return the array of supported MIDI file types
+   */
+  public static int[] getMidiFileTypes(Sequence sequence)
+  {
+    // We only support a max of 3 MIDI file types.
+    boolean supported[] = new boolean[3];
+    // The number of supported formats.
+    int count = 0;
+    Iterator writers = ServiceFactory.lookupProviders(MidiFileWriter.class);
+    while (writers.hasNext())
+    {
+      MidiFileWriter fw = (MidiFileWriter) writers.next();
+      int types[] = fw.getMidiFileTypes(sequence);
+      for (int i = types.length; i > 0;)
+      {
+        int type = types[--i];
+        if (supported[type] == false)
+        {
+          count++;
+          supported[type] = true;
+        }
+      }
+    }
+    int result[] = new int[count];
+    for (int i = supported.length; i > 0;)
+    {
+      if (supported[--i])
+        result[--count] = i;
+    }
+    return result;
+  }
+  
+  /**
+   * Return true if the system supports writing files of type fileType
+   * for the given sequence.
+   * 
+   * @param fileType the MIDI file type we want to write
+   * @param sequence the Sequence we want to write
+   * @return true if we can write fileType files for sequence, false otherwise
+   */
+  public static boolean isFileTypeSupported(int fileType, Sequence sequence)
+  {
+    Iterator writers = ServiceFactory.lookupProviders(MidiFileWriter.class);
+    while (writers.hasNext())
+    {
+      MidiFileWriter fw = (MidiFileWriter) writers.next();
+      
+      if (fw.isFileTypeSupported(fileType, sequence))
+        return true;
+    }
+    return false;
+  }
+
+  /**
+   * Write a sequence to an output stream using a specific MIDI file format.
+   * 
+   * @param in the sequence to write
+   * @param fileType the MIDI file format to use
+   * @param out the output stream to write to
+   * @return the number of bytes written
+   * @throws IOException if an I/O exception happens
+   * @throws IllegalArgumentException if fileType is not supported for in
+   */
+  public static int write(Sequence in, int fileType, OutputStream out)
+    throws IOException
+  {
+    Iterator writers = ServiceFactory.lookupProviders(MidiFileWriter.class);
+    while (writers.hasNext())
+    {
+      MidiFileWriter fw = (MidiFileWriter) writers.next();
+    
+      if (fw.isFileTypeSupported(fileType, in))
+        return fw.write(in, fileType, out);
+    }
+    throw new IllegalArgumentException("File type " 
+				       + fileType + " is not supported");
+  }
+
+  /**
+   * Write a sequence to a file using a specific MIDI file format.
+   * 
+   * @param in the sequence to write
+   * @param fileType the MIDI file format to use
+   * @param out the file to write to
+   * @return the number of bytes written
+   * @throws IOException if an I/O exception happens
+   * @throws IllegalArgumentException if fileType is not supported for in
+   */
+  public static int write(Sequence in, int fileType, File out)
+    throws IOException
+  {
+    Iterator writers = ServiceFactory.lookupProviders(MidiFileWriter.class);
+    while (writers.hasNext())
+    {
+      MidiFileWriter fw = (MidiFileWriter) writers.next();
+    
+      if (fw.isFileTypeSupported(fileType, in))
+        return fw.write(in, fileType, out);
+    }
+    throw new IllegalArgumentException("File type " 
+				       + fileType + " is not supported");
+  }
+}
+

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiUnavailableException.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiUnavailableException.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiUnavailableException.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/MidiUnavailableException.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,69 @@
+/* MidiUnavailableException.java -- MIDI resources are not available
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+/**
+ * This exception is thrown when MIDI resources are not available.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public class MidiUnavailableException extends Exception
+{
+  private static final long serialVersionUID = 6093809578628944323L;
+ 
+  /**
+   * Create a MidiUnavailableException.
+   */
+  public MidiUnavailableException()
+  {
+    super();
+  }
+
+  /**
+   * Create an MidiUnavailableException object.
+   * 
+   * @param s the exception message string
+   */
+  public MidiUnavailableException(String s)
+  {
+    super(s);
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Patch.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Patch.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Patch.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Patch.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,86 @@
+/* Patch.java -- A MIDI patch.
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+/**
+ * A Patch describes where an Instrument is loaded on a Synthesizer.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public class Patch
+{
+  // Private data describing the patch
+  private int bank = 0;
+  private int program = 0;
+  
+  /**
+   * Create a Patch object, specifying the bank and program in which this Patch
+   * is located.
+   * 
+   * @param bank the bank in which this Patch is located
+   * @param program the program in which this Patch is located
+   */
+  public Patch(int bank, int program)
+  {
+    this.bank = bank;
+    this.program = program;
+  }
+  
+  /**
+   * Get the bank in which this Patch is located.
+   * 
+   * @return the bank in which this Patch is located
+   */
+  public int getBank()
+  {
+    return bank;
+  }
+  
+  /**
+   * Get the program in which this Patch is located.
+   * 
+   * @return the program in which this Patch is located
+   */
+  public int getProgram()
+  {
+    return program;
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Receiver.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Receiver.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Receiver.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Receiver.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,66 @@
+/* Receiver.java -- An interface for objects receiving MIDI data
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+/**
+ * This interface describes the methods required by objects receiving MIDI
+ * messages.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public interface Receiver
+{
+  /**
+   * Send a MIDI message and timestamp.  Some receivers don't support
+   * timestamps, in which case timeStamp should be -1.
+   * 
+   * @param message the MIDI message to send
+   * @param timeStamp time timestamp for this message in microseconds (or -1)
+   * @throws IllegalStateException if the receiver is closed
+   */
+  public void send(MidiMessage message, long timeStamp)
+    throws IllegalStateException;
+  
+  /**
+   * Close this receiver, possibly freeing system resources.
+   */
+  public void close();
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Sequence.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Sequence.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Sequence.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Sequence.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,248 @@
+/* Sequence.java -- A sequence of MIDI events
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+import java.util.Iterator;
+import java.util.Vector;
+
+/**
+ * Objects of this type represent sequences of MIDI messages that can be 
+ * played back by a Sequencer.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public class Sequence
+{
+  /**
+   * The timing division type for this sequence (PPQ or SMPTE*) 
+   */
+  protected float divisionType;
+  
+  /**
+   * The timing resolution in ticks/beat or ticks/frame, depending on the 
+   * division type.  
+   */
+  protected int resolution;
+  
+  /**
+   * The MIDI tracks used by this sequence. 
+   */
+  protected Vector tracks;
+  
+  /**
+   * Tempo-based timing.  Resolution is specified in ticks per beat.
+   */
+  public static final float PPQ = 0.0f;
+  
+  /**
+   * 24 frames/second timing.  Resolution is specific in ticks per frame.
+   */
+  public static final float SMPTE_24 = 24.0f;
+  
+  /**
+   * 25 frames/second timing.  Resolution is specific in ticks per frame.
+   */
+  public static final float SMPTE_25 = 25.0f;
+  
+  /**
+   * 30 frames/second timing.  Resolution is specific in ticks per frame.
+   */
+  public static final float SMPTE_30 = 30.0f;
+  
+  /**
+   * 29.97 frames/second timing.  Resolution is specific in ticks per frame.
+   */
+  public static final float SMPTE_30DROP = 29.97f;
+  
+  // Private helper class
+  private void init(float divisionType, int resolution, int numTracks)
+    throws InvalidMidiDataException
+  {
+    if (divisionType != PPQ
+        && divisionType != SMPTE_24 
+        && divisionType != SMPTE_25
+        && divisionType != SMPTE_30
+        && divisionType != SMPTE_30DROP)
+      throw new InvalidMidiDataException("Invalid division type (" 
+                                         + divisionType + ")");
+
+    this.divisionType = divisionType;
+    this.resolution = resolution;
+    
+    tracks = new Vector(numTracks);
+    while (numTracks > 0)
+      tracks.set(--numTracks, new Track());
+  }
+  
+  /**
+   * Create a MIDI sequence object with no initial tracks.
+   * 
+   * @param divisionType the division type (must be one of PPQ or SMPTE_*)
+   * @param resolution the timing resolution
+   * @throws InvalidMidiDataException if the division type is invalid
+   */
+  public Sequence(float divisionType, int resolution)
+    throws InvalidMidiDataException
+  {
+    init(divisionType, resolution, 0);
+  }
+
+  /**
+   * Create a MIDI seqence object.
+   * 
+   * @param divisionType the division type (must be one of PPQ or SMPTE_*)
+   * @param resolution the timing resolution
+   * @param numTracks the number of initial tracks
+   * @throws InvalidMidiDataException if the division type is invalid
+   */
+  public Sequence(float divisionType, int resolution, int numTracks)
+    throws InvalidMidiDataException
+  {
+    init(divisionType, resolution, 0);
+  }
+  
+  /**
+   * The division type of this sequence.
+   * 
+   * @return division type of this sequence
+   */
+  public float getDivisionType()
+  {
+    return divisionType;
+  }
+  
+  /**
+   * The timing resolution for this sequence, relative to the division type.
+   * 
+   * @return the timing resolution for this sequence
+   */
+  public int getResolution()
+  {
+    return resolution;
+  }
+  
+  /**
+   * Create a new empty MIDI track and add it to this sequence.
+   * 
+   * @return the newly create MIDI track
+   */
+  public Track createTrack()
+  {
+    Track track = new Track();
+    tracks.add(track);
+    return track;
+  }
+  
+  /**
+   * Remove the specified MIDI track from this sequence.
+   * 
+   * @param track the track to remove
+   * @return true if track was removed and false othewise
+   */
+  public boolean deleteTrack(Track track)
+  {
+    return tracks.remove(track);
+  }
+  
+  /**
+   * Get an array of MIDI tracks used in this sequence.
+   * 
+   * @return a possibly empty array of tracks
+   */
+  public Track[] getTracks()
+  {
+    return (Track[]) tracks.toArray(new Track[tracks.size()]);
+  }
+  
+  /**
+   * The length of this sequence in microseconds.
+   * 
+   * @return the length of this sequence in microseconds
+   */
+  public long getMicrosecondLength()
+  {
+    long tickLength = getTickLength();
+    
+    if (divisionType == PPQ)
+    {
+      // FIXME
+      // How can this possible be computed?  PPQ is pulses per quarter-note,
+      // which is dependent on the tempo of the Sequencer.
+      throw new 
+	  UnsupportedOperationException("Can't compute PPQ based lengths yet");
+    }
+    else
+    {
+      // This is a fixed tick per frame computation
+      return (long) ((tickLength * 1000000) / (divisionType * resolution));
+    }
+  }
+  
+  /**
+   * The length of this sequence in MIDI ticks.
+   * 
+   * @return the length of this sequence in MIDI ticks
+   */
+  public long getTickLength()
+  {
+    long length = 0;
+    Iterator itr = tracks.iterator();
+    while (itr.hasNext())
+    {
+      Track track = (Track) itr.next();
+      long trackTicks = track.ticks();
+      if (trackTicks > length)
+        length = trackTicks;
+    }
+    return length;
+  }
+  
+  /**
+   * Get an array of patches used in this sequence.
+   * 
+   * @return an array of patches used in this sequence
+   */
+  public Patch[] getPatchList()
+  {
+    // FIXE: not quite sure how to do this yet. 
+    throw new UnsupportedOperationException("Can't get patch list yet");
+  }
+}

Added: llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Sequencer.java
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Sequencer.java?rev=43913&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Sequencer.java (added)
+++ llvm-gcc-4.2/trunk/libjava/classpath/javax/sound/midi/Sequencer.java Thu Nov  8 16:56:19 2007
@@ -0,0 +1,402 @@
+/* Sequencer.java -- A MIDI sequencer object
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.sound.midi;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * A Sequencer object plays MIDI sequences described as Sequence objects.
+ * This class provides methods for loading and unloading sequences, as well
+ * as basic transport controls.
+ * 
+ * @author Anthony Green (green at redhat.com)
+ * @since 1.3
+ *
+ */
+public interface Sequencer extends MidiDevice
+{
+  /**
+   * Set the Sequence object for this sequencer.
+   * 
+   * @param seq the Sequence to process
+   * @throws InvalidMidiDataException if the sequence is invalid for any reason
+   */
+  public void setSequence(Sequence seq) throws InvalidMidiDataException;
+  
+  /**
+   * Set the sequence for this sequencer.  istream reads on a valid MIDI file.
+   * 
+   * @param istream an input stream for a valid MIDI file
+   * @throws IOException if an I/O exception happens
+   * @throws InvalidMidiDataException if the MIDI file contains bad data
+   */
+  public void setSequence(InputStream istream) 
+      throws IOException, InvalidMidiDataException;
+  
+  /**
+   * Get the current sequence object for this sequencer.
+   * 
+   * @return the current sequence object.  May be null.
+   */
+  public Sequence getSequence();
+  
+  /**
+   * Start playback of the current sequence.
+   */
+  public void start();
+  
+  /**
+   * Stop playback of the current sequence.
+   */
+  public void stop();
+  
+  /**
+   * Returns true if the sequence is playing.
+   * 
+   * @return true if the sequence is playing and false otherwise
+   */
+  public boolean isRunning();
+  
+  /**
+   * Start playback and record of MIDI events.
+   * Any tracks enabled for recording will have their events replaced.
+   * Any newly recorded events, and all events from non-recording tracks
+   * will be sent to the sequencer's transmitter.
+   */
+  public void startRecording();
+  
+  /**
+   * Stop recording, although continue playing.
+   */
+  public void stopRecording();
+  
+  /**
+   * Returns true if sequence is recording.
+   * 
+   * @return true if the sequence is recording and false otherwise
+   */
+  public boolean isRecording();
+  
+  /**
+   * Enable recording for a specific track using data from a specific channel.
+   * 
+   * @param track the track to enable for recording 
+   * @param channel the channel from which to record
+   */
+  public void recordEnable(Track track, int channel);
+  
+  /**
+   * Disable recording for a specific track.
+   * 
+   * @param track the track to disable recording for
+   */
+  public void recordDisable(Track track);
+  
+  /**
+   * Get the current tempo in beats per minute.
+   * 
+   * @return the current tempo in beats per minute
+   */
+  public float getTempoInBPM();
+  
+  /**
+   * Sets the current tempo in beats per minute.
+   * 
+   * @param bpm the new tempo in bears per minutes
+   */
+  public void setTempoInBPM(float bpm);
+  
+  /**
+   * Get the current tempo in microseconds per quarter note.
+   * 
+   * @return the current tempo in microseconds per quarter note.
+   */
+  public float getTempoInMPQ();
+  
+  /**
+   * Sets the current tempo in microseconds per quarter note.
+   * 
+   * @param mpq the new tempo in microseconds per quarter note.
+   */
+  public void setTempoInMPQ(float mpq);
+  
+  /**
+   * Set a scaling factor for the playback tempo, which is 1.0 by default.
+   * 
+   * @param factor the new tempo scaling factor
+   */
+  public void setTempoFactor(float factor);
+  
+  /**
+   * Get the current scaling factor for the playback tempo.
+   * 
+   * @return the current tempo scaling factor 
+   */
+  public float getTempoFactor();
+  
+  /**
+   * Get the length of the current sequence in MIDI ticks.
+   *  
+   * @return the length of the current sequence in MIDI ticks
+   */
+  public long getTickLength();
+  
+  /**
+   * Get the current playback position of the sequencer in MIDI ticks.
+   * 
+   * @return the current playback position of the sequencer in MIDI ticks
+   */
+  public long getTickPosition();
+  
+  /**
+   * Set the current playback position of the sequencer in MIDI ticks.
+   * 
+   * @param tick the new playback position of the sequencer in MIDI ticks
+   */
+  public void setTickPosition(long tick);
+
+  /**
+   * Get the length of the current sequence in microseconds.
+   *  
+   * @return the length of the current sequence in microseconds
+   */
+  public long getMicrosecondLength();
+  
+  /**
+   * Get the current playback position of the sequencer in microseconds.
+   * 
+   * @return the current playback position of the sequencer in microseconds
+   */
+  public long getMicrosecondPosition();
+  
+  /**
+   * Set the current playback position of the sequencer in microseconds.
+   * 
+   * @param microsecond the new playback position of the sequencer in microseconds
+   */
+  public void setMicrosecondPosition(long microsecond);
+
+  /**
+   * Set the source of timing information.  sync must be found in the array
+   * returned by getMasterSyncModes().
+   * FIXME: What happens if it isn't?
+   * 
+   * @param sync the new source of timing information
+   */
+  public void setMasterSyncMode(SyncMode sync);
+  
+  /**
+   * Get the source of timing information.
+   * 
+   * @return the current source of timing information
+   */
+  public SyncMode getMasterSyncMode();
+  
+  /**
+   * Get an array of timing sources supported by this sequencer.
+   * 
+   * @return an array of timing sources supported by this sequencer
+   */
+  public SyncMode[] getMasterSyncModes();
+  
+  /**
+   * Set the slave synchronization mode for this sequencer.  sync must be
+   * found in the array returned by getSlaveSyncModes().
+   * FIXME: What happens if it isn't?
+   * 
+   * @param sync the new slave sync mode for this sequencer
+   */
+  public void setSlaveSyncMode(SyncMode sync);
+  
+  /**
+   * Get the current slave synchronization mode.
+   * 
+   * @return the current slave synchronization mode
+   */
+  public SyncMode getSlaveSyncMode();
+  
+  /**
+   * Get an array of slave sync modes supported by this sequencer.
+   * 
+   * @return an array of slave sync modes supported by this sequencer
+   */
+  public SyncMode[] getSlaveSyncModes();
+  
+  /**
+   * Sets the mute state for a specific track.
+   * 
+   * @param track the track to modify
+   * @param mute the new mute state
+   */
+  public void setTrackMute(int track, boolean mute);
+  
+  /**
+   * Get the mute state of a specific track.
+   * 
+   * @param track the track to query
+   * @return the mute state for track
+   */
+  public boolean getTrackMute(int track);
+  
+  /**
+   * Sets the solo state for a specific track.
+   * 
+   * @param track the track to modify
+   * @param solo the new solo state
+   */
+  public void setTrackSolo(int track, boolean solo);
+  
+  /**
+   * Get the solo state for a specific track.
+   * 
+   * @param track the track to query
+   * @return the solo state for track
+   */
+  public boolean getTrackSolo(int track);
+  
+  /**
+   * Add a meta event listening object to this sequencer.  It will receive
+   * notification whenever the sequencer processes a meta event.
+   * A listener may fail to get added if this sequencer doesn't support
+   * meta events.
+   * 
+   * @param listener the listener to add
+   * @return true if listener was added, false othewise
+   */
+  public boolean addMetaEventListener(MetaEventListener listener);
+  
+  /**
+   * Remove a meta event listener from this sequencer.
+   * 
+   * @param listener the listener to remove
+   */
+  public void removeMetaEventListener(MetaEventListener listener);
+  
+  /**
+   * Add a controller event listening object to this sequencer.  It will 
+   * receive notification whenever the sequencer processes a controller 
+   * event for a specified controller number..
+   * 
+   * @param listener the listener to add
+   * @param controllers the conroller numbers to listen to
+   * @return the controller numbers being listened to
+   */
+  public int[] addControllerEventListener(ControllerEventListener listener, 
+                                          int controllers[]);
+  
+  /**
+   * Remove a controller listener from this sequencer for the specified
+   * controller numbers.
+   * 
+   * @param listener the listener to remove
+   * @param controllers the controllers to unlisten
+   * @return the controller numbers being unlistened
+   */
+  public int[] removeControllerEventListener(ControllerEventListener listener,
+                                             int controllers[]);
+  
+  /**
+   * A SyncMode object represents the mechanism by which a MIDI sequencer
+   * synchronizes time with a master or slave device.
+   * 
+   * @author green at redhat.com
+   *
+   */
+  public static class SyncMode
+  {
+    /**
+     * A master sync mode indicating the use of an internal sequencer clock.
+     */
+    public static final SyncMode INTERNAL_CLOCK = new SyncMode("Internal Clock");
+    
+    /**
+     * A master or slave sync mode indicating the use of MIDI clock messages.
+     */
+    public static final SyncMode MIDI_SYNC = new SyncMode("MIDI Sync");
+    
+    /**
+     * A master or slave sync mode indicating the use of MIDI Time Code 
+     * messages.
+     */
+    public static final SyncMode MIDI_TIME_CODE = new SyncMode("MIDI Time Code");
+    
+    /**
+     * A slave sync mode indicating that no timing info will be transmitted.
+     */
+    public static final SyncMode NO_SYNC = new SyncMode("No Timing");
+
+    // The name
+    private String name;
+    
+    /**
+     * Create a new SyncMode object
+     * @param name the SyncMode name
+     */
+    protected SyncMode(String name)
+    {
+      this.name = name;
+    }
+    
+    /**
+     * SyncMode objects are only equal when identical.
+     */
+    public final boolean equals(Object o)
+    {
+      return super.equals(o);
+    }
+    
+    /**
+     * SyncMode objects use the Object hashCode.
+     */
+    public final int hashCode()
+    {
+      return super.hashCode();
+    }
+    
+    /**
+     * Use the SyncMode name as the string representation.
+     * @see java.lang.Object#toString()
+     */
+    public final String toString()
+    {
+      return name;
+    }
+  }
+}





More information about the llvm-commits mailing list